[PATCH] device: use RTMGRP_IPV4_ROUTE to specify multicast groups mask

Tobias Klauser tklauser at distanz.ch
Tue Jul 7 13:15:13 CEST 2020


Use the RTMGRP_IPV4_ROUTE const from x/sys/unix instead of using the
corresponding RTNLGRP_IPV4_ROUTE const to create the multicast groups
mask.

Signed-off-by: Tobias Klauser <tklauser at distanz.ch>
---
 device/sticky_linux.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/device/sticky_linux.go b/device/sticky_linux.go
index e3efc8694090..f1c7069f616a 100644
--- a/device/sticky_linux.go
+++ b/device/sticky_linux.go
@@ -206,7 +206,7 @@ func createNetlinkRouteSocket() (int, error) {
 	}
 	saddr := &unix.SockaddrNetlink{
 		Family: unix.AF_NETLINK,
-		Groups: uint32(1 << (unix.RTNLGRP_IPV4_ROUTE - 1)),
+		Groups: unix.RTMGRP_IPV4_ROUTE,
 	}
 	err = unix.Bind(sock, saddr)
 	if err != nil {
-- 
2.27.0



More information about the WireGuard mailing list