mirror of
https://github.com/golang/go
synced 2024-11-21 22:04:39 -07:00
syscall: update routing message attributes handling, fix typo
R=fullung, golang-dev, rsc CC=golang-dev https://golang.org/cl/4986041
This commit is contained in:
parent
8ddd66145e
commit
73d27dd5ba
@ -195,12 +195,12 @@ func ParseNetlinkRouteAttr(msg *NetlinkMessage) ([]NetlinkRouteAttr, int) {
|
||||
)
|
||||
|
||||
switch msg.Header.Type {
|
||||
case RTM_NEWLINK:
|
||||
case RTM_NEWLINK, RTM_DELLINK:
|
||||
buf = msg.Data[SizeofIfInfomsg:]
|
||||
case RTM_NEWADDR:
|
||||
case RTM_NEWADDR, RTM_DELADDR:
|
||||
buf = msg.Data[SizeofIfAddrmsg:]
|
||||
case RTM_NEWROUTE:
|
||||
buf = msg.Data[SizeofRtmsg:]
|
||||
case RTM_NEWROUTE, RTM_DELROUTE:
|
||||
buf = msg.Data[SizeofRtMsg:]
|
||||
default:
|
||||
return nil, EINVAL
|
||||
}
|
||||
|
@ -212,7 +212,7 @@ enum {
|
||||
$SizeofRtAttr = sizeof(struct rtattr),
|
||||
$SizeofIfInfomsg = sizeof(struct ifinfomsg),
|
||||
$SizeofIfAddrmsg = sizeof(struct ifaddrmsg),
|
||||
$SizeofRtmsg = sizeof(struct rtmsg),
|
||||
$SizeofRtMsg = sizeof(struct rtmsg),
|
||||
$SizeofRtNexthop = sizeof(struct rtnexthop),
|
||||
};
|
||||
|
||||
|
@ -98,7 +98,7 @@ const (
|
||||
SizeofRtAttr = 0x4
|
||||
SizeofIfInfomsg = 0x10
|
||||
SizeofIfAddrmsg = 0x8
|
||||
SizeofRtmsg = 0xc
|
||||
SizeofRtMsg = 0xc
|
||||
SizeofRtNexthop = 0x8
|
||||
SizeofSockFilter = 0x8
|
||||
SizeofSockFprog = 0x8
|
||||
|
@ -98,7 +98,7 @@ const (
|
||||
SizeofRtAttr = 0x4
|
||||
SizeofIfInfomsg = 0x10
|
||||
SizeofIfAddrmsg = 0x8
|
||||
SizeofRtmsg = 0xc
|
||||
SizeofRtMsg = 0xc
|
||||
SizeofRtNexthop = 0x8
|
||||
SizeofSockFilter = 0x8
|
||||
SizeofSockFprog = 0x10
|
||||
|
@ -103,7 +103,7 @@ const (
|
||||
SizeofRtAttr = 0x4
|
||||
SizeofIfInfomsg = 0x10
|
||||
SizeofIfAddrmsg = 0x8
|
||||
SizeofRtmsg = 0xc
|
||||
SizeofRtMsg = 0xc
|
||||
SizeofRtNexthop = 0x8
|
||||
SizeofSockFilter = 0x8
|
||||
SizeofSockFprog = 0x8
|
||||
|
Loading…
Reference in New Issue
Block a user