diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-12-09 13:49:46 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-12-09 13:49:46 +0000 |
commit | 6ccb30917e16d709c269e75c5d1ab85e34eb52e1 (patch) | |
tree | bdf80c4eee7a691334d83ff083086526a4f5094c | |
parent | 4818f026d4c35683222b84976de17da18ae178bb (diff) | |
parent | a213cb48c593f34544da80d0462572b2410e36b1 (diff) | |
download | extras-6ccb30917e16d709c269e75c5d1ab85e34eb52e1.tar.gz |
Merge "Minor changes to netlink code."
-rw-r--r-- | tests/net_test/iproute.py | 4 | ||||
-rwxr-xr-x | tests/net_test/net_test.py | 7 | ||||
-rw-r--r-- | tests/net_test/netlink.py | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/tests/net_test/iproute.py b/tests/net_test/iproute.py index fef4b5c5..7c9eec0f 100644 --- a/tests/net_test/iproute.py +++ b/tests/net_test/iproute.py @@ -209,10 +209,6 @@ class IPRoute(netlink.NetlinkSocket): FAMILY = NETLINK_ROUTE - def _Debug(self, s): - if self.DEBUG: - print s - def _NlAttrIPAddress(self, nla_type, family, address): return self._NlAttr(nla_type, socket.inet_pton(family, address)) diff --git a/tests/net_test/net_test.py b/tests/net_test/net_test.py index 09a6a555..ada7eba9 100755 --- a/tests/net_test/net_test.py +++ b/tests/net_test/net_test.py @@ -30,11 +30,14 @@ IPV6_RECVERR = 25 IP_TRANSPARENT = 19 IPV6_TRANSPARENT = 75 IPV6_TCLASS = 67 -SO_BINDTODEVICE = 25 -SO_MARK = 36 IPV6_FLOWLABEL_MGR = 32 IPV6_FLOWINFO_SEND = 33 +SO_BINDTODEVICE = 25 +SO_MARK = 36 +SO_PROTOCOL = 38 +SO_DOMAIN = 39 + ETH_P_IP = 0x0800 ETH_P_IPV6 = 0x86dd diff --git a/tests/net_test/netlink.py b/tests/net_test/netlink.py index 65dc4b66..6b2c60d1 100644 --- a/tests/net_test/netlink.py +++ b/tests/net_test/netlink.py @@ -227,6 +227,10 @@ class NetlinkSocket(object): response_type = NLMsgHdr(data).type if response_type == NLMSG_DONE: break + elif response_type == NLMSG_ERROR: + # Likely means that the kernel didn't like our dump request. + # Parse the error and throw an exception. + self._ParseAck(data) out.extend(self._GetMsgList(msgtype, data, False)) return out |