1
0
mirror of https://github.com/golang/go synced 2024-11-21 22:34:48 -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:
Mikio Hara 2011-09-05 08:11:51 -04:00 committed by Russ Cox
parent 8ddd66145e
commit 73d27dd5ba
5 changed files with 8 additions and 8 deletions

View File

@ -195,12 +195,12 @@ func ParseNetlinkRouteAttr(msg *NetlinkMessage) ([]NetlinkRouteAttr, int) {
) )
switch msg.Header.Type { switch msg.Header.Type {
case RTM_NEWLINK: case RTM_NEWLINK, RTM_DELLINK:
buf = msg.Data[SizeofIfInfomsg:] buf = msg.Data[SizeofIfInfomsg:]
case RTM_NEWADDR: case RTM_NEWADDR, RTM_DELADDR:
buf = msg.Data[SizeofIfAddrmsg:] buf = msg.Data[SizeofIfAddrmsg:]
case RTM_NEWROUTE: case RTM_NEWROUTE, RTM_DELROUTE:
buf = msg.Data[SizeofRtmsg:] buf = msg.Data[SizeofRtMsg:]
default: default:
return nil, EINVAL return nil, EINVAL
} }

View File

@ -212,7 +212,7 @@ enum {
$SizeofRtAttr = sizeof(struct rtattr), $SizeofRtAttr = sizeof(struct rtattr),
$SizeofIfInfomsg = sizeof(struct ifinfomsg), $SizeofIfInfomsg = sizeof(struct ifinfomsg),
$SizeofIfAddrmsg = sizeof(struct ifaddrmsg), $SizeofIfAddrmsg = sizeof(struct ifaddrmsg),
$SizeofRtmsg = sizeof(struct rtmsg), $SizeofRtMsg = sizeof(struct rtmsg),
$SizeofRtNexthop = sizeof(struct rtnexthop), $SizeofRtNexthop = sizeof(struct rtnexthop),
}; };

View File

@ -98,7 +98,7 @@ const (
SizeofRtAttr = 0x4 SizeofRtAttr = 0x4
SizeofIfInfomsg = 0x10 SizeofIfInfomsg = 0x10
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtmsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x8 SizeofSockFprog = 0x8

View File

@ -98,7 +98,7 @@ const (
SizeofRtAttr = 0x4 SizeofRtAttr = 0x4
SizeofIfInfomsg = 0x10 SizeofIfInfomsg = 0x10
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtmsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x10 SizeofSockFprog = 0x10

View File

@ -103,7 +103,7 @@ const (
SizeofRtAttr = 0x4 SizeofRtAttr = 0x4
SizeofIfInfomsg = 0x10 SizeofIfInfomsg = 0x10
SizeofIfAddrmsg = 0x8 SizeofIfAddrmsg = 0x8
SizeofRtmsg = 0xc SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8 SizeofRtNexthop = 0x8
SizeofSockFilter = 0x8 SizeofSockFilter = 0x8
SizeofSockFprog = 0x8 SizeofSockFprog = 0x8