From df5adb2e2333b9de4e8e46b87d710ea4edbee49c Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 22 Feb 2021 19:38:07 -0800 Subject: [PATCH] wgengine/monitor: on linux, also monitor for IPv6 changes. Signed-off-by: David Anderson --- wgengine/monitor/monitor_linux.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wgengine/monitor/monitor_linux.go b/wgengine/monitor/monitor_linux.go index 1c186ec25..07395c8f0 100644 --- a/wgengine/monitor/monitor_linux.go +++ b/wgengine/monitor/monitor_linux.go @@ -39,12 +39,11 @@ type nlConn struct { func newOSMon(logf logger.Logf) (osMon, error) { conn, err := netlink.Dial(unix.NETLINK_ROUTE, &netlink.Config{ - // IPv4 address and route changes. Routes get us most of the - // events of interest, but we need address as well to cover - // things like DHCP deciding to give us a new address upon - // renewal - routing wouldn't change, but all reachability - // would. - Groups: unix.RTMGRP_IPV4_IFADDR | unix.RTMGRP_IPV4_ROUTE, + // Routes get us most of the events of interest, but we need + // address as well to cover things like DHCP deciding to give + // us a new address upon renewal - routing wouldn't change, + // but all reachability would. + Groups: unix.RTMGRP_IPV4_IFADDR | unix.RTMGRP_IPV6_IFADDR | unix.RTMGRP_IPV4_ROUTE | unix.RTMGRP_IPV6_ROUTE, }) if err != nil { return nil, fmt.Errorf("dialing netlink socket: %v", err)