Skip to content

Commit ef92605

Browse files
fixed listening for link changes (#1343)
netlink.AddrSubscribeWithOptions() was causing systemd-resolved not to obtain DNS servers, and therefore the system was unable to resolve domain names. This ssue started happening on Fedora 42, with systemd-resolved 257 and kernels 6.14.x. Using netlink.AddrSubscribe() solves this issue for now. Closes #1343
1 parent e0c6599 commit ef92605

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

daemon/procmon/ebpf/monitor.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,15 @@ func monitorLocalAddresses() {
5050
done := make(chan struct{})
5151
defer close(done)
5252

53-
lock.Lock()
54-
localAddresses = daemonNetlink.GetLocalAddrs()
55-
lock.Unlock()
56-
57-
netlink.AddrSubscribeWithOptions(newAddrChan, done,
58-
netlink.AddrSubscribeOptions{
59-
ErrorCallback: func(err error) {
60-
log.Error("AddrSubscribeWithOptions error: %s", err)
61-
},
62-
ListExisting: true,
63-
})
53+
addrs := daemonNetlink.GetLocalAddrs()
54+
if addrs != nil {
55+
lock.Lock()
56+
localAddresses = addrs
57+
lock.Unlock()
58+
log.Debug("local Addrs: %v", localAddresses)
59+
}
60+
61+
netlink.AddrSubscribe(newAddrChan, done)
6462

6563
for {
6664
select {

0 commit comments

Comments
 (0)