]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: update routing message attributes handling, fix typo
authorMikio Hara <mikioh.mikioh@gmail.com>
Mon, 5 Sep 2011 12:11:51 +0000 (08:11 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 5 Sep 2011 12:11:51 +0000 (08:11 -0400)
R=fullung, golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4986041

src/pkg/syscall/netlink_linux.go
src/pkg/syscall/types_linux.c
src/pkg/syscall/ztypes_linux_386.go
src/pkg/syscall/ztypes_linux_amd64.go
src/pkg/syscall/ztypes_linux_arm.go

index be80d268fbe3a19edb88e3f5a41eb02212b542f2..62d9e15e297c820acc0742b9468b1f93b2901cc7 100644 (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
        }
index abb2a91a7fed3b262112a6c67681f348e60dc50a..68d64a3a3bf9db60b14e70c361fe188d21248a6a 100644 (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),
 };
 
index 252fbff74a21d0d924eb9f1daa5e2726deeaffa9..0335eb5ee24e1f933fd633069e6e12d29dd6f909 100644 (file)
@@ -98,7 +98,7 @@ const (
        SizeofRtAttr            = 0x4
        SizeofIfInfomsg         = 0x10
        SizeofIfAddrmsg         = 0x8
-       SizeofRtmsg             = 0xc
+       SizeofRtMsg             = 0xc
        SizeofRtNexthop         = 0x8
        SizeofSockFilter        = 0x8
        SizeofSockFprog         = 0x8
index 520ba963ab03780cdee5eeee500d9cd420a9271b..c97b7f6fa93fbf5b30acccb0e9ce19996a8b4354 100644 (file)
@@ -98,7 +98,7 @@ const (
        SizeofRtAttr            = 0x4
        SizeofIfInfomsg         = 0x10
        SizeofIfAddrmsg         = 0x8
-       SizeofRtmsg             = 0xc
+       SizeofRtMsg             = 0xc
        SizeofRtNexthop         = 0x8
        SizeofSockFilter        = 0x8
        SizeofSockFprog         = 0x10
index 2421df081bc455212fa5cdb8d2fc4355d89eb543..3d4aded9ca5e357f072aa4ed6571a468b23d7d2a 100644 (file)
@@ -103,7 +103,7 @@ const (
        SizeofRtAttr            = 0x4
        SizeofIfInfomsg         = 0x10
        SizeofIfAddrmsg         = 0x8
-       SizeofRtmsg             = 0xc
+       SizeofRtMsg             = 0xc
        SizeofRtNexthop         = 0x8
        SizeofSockFilter        = 0x8
        SizeofSockFprog         = 0x8