Commit 73d27dd5 authored by Mikio Hara's avatar Mikio Hara Committed by Russ Cox

syscall: update routing message attributes handling, fix typo

R=fullung, golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4986041
parent 8ddd6614
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment