1
0
mirror of https://github.com/golang/go synced 2024-11-24 22:00:09 -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 {
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
}

View File

@ -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),
};

View File

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

View File

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

View File

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