Browse Source

global: use RTMGRP_* consts from x/sys/unix

Update the golang.org/x/sys/unix dependency and use the newly introduced
RTMGRP_* consts instead of using the corresponding RTNLGRP_* const to
create a mask.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Tobias Klauser 2 months ago
parent
commit
b33219c2cf
4 changed files with 5 additions and 5 deletions
  1. 1
    1
      device/conn_linux.go
  2. 1
    1
      go.mod
  3. 2
    2
      go.sum
  4. 1
    1
      tun/tun_linux.go

+ 1
- 1
device/conn_linux.go View File

@@ -118,7 +118,7 @@ func createNetlinkRouteSocket() (int, error) {
118 118
 	}
119 119
 	saddr := &unix.SockaddrNetlink{
120 120
 		Family: unix.AF_NETLINK,
121
-		Groups: uint32(1 << (unix.RTNLGRP_IPV4_ROUTE - 1)),
121
+		Groups: unix.RTMGRP_IPV4_ROUTE,
122 122
 	}
123 123
 	err = unix.Bind(sock, saddr)
124 124
 	if err != nil {

+ 1
- 1
go.mod View File

@@ -5,6 +5,6 @@ go 1.12
5 5
 require (
6 6
 	golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc
7 7
 	golang.org/x/net v0.0.0-20191003171128-d98b1b443823
8
-	golang.org/x/sys v0.0.0-20191003212358-c178f38b412c
8
+	golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527
9 9
 	golang.org/x/text v0.3.2
10 10
 )

+ 2
- 2
go.sum View File

@@ -6,8 +6,8 @@ golang.org/x/net v0.0.0-20191003171128-d98b1b443823 h1:Ypyv6BNJh07T1pUSrehkLemqP
6 6
 golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
7 7
 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
8 8
 golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
9
-golang.org/x/sys v0.0.0-20191003212358-c178f38b412c h1:6Zx7DRlKXf79yfxuQ/7GqV3w2y7aDsk6bGg0MzF5RVU=
10
-golang.org/x/sys v0.0.0-20191003212358-c178f38b412c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
9
+golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
10
+golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
11 11
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
12 12
 golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
13 13
 golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=

+ 1
- 1
tun/tun_linux.go View File

@@ -85,7 +85,7 @@ func createNetlinkSocket() (int, error) {
85 85
 	}
86 86
 	saddr := &unix.SockaddrNetlink{
87 87
 		Family: unix.AF_NETLINK,
88
-		Groups: uint32((1 << (unix.RTNLGRP_LINK - 1)) | (1 << (unix.RTNLGRP_IPV4_IFADDR - 1)) | (1 << (unix.RTNLGRP_IPV6_IFADDR - 1))),
88
+		Groups: unix.RTMGRP_LINK | unix.RTMGRP_IPV4_IFADDR | unix.RTMGRP_IPV6_IFADDR,
89 89
 	}
90 90
 	err = unix.Bind(sock, saddr)
91 91
 	if err != nil {

Loading…
Cancel
Save