Minor changes to netlink code.
1. Remove IpRoute._Debug, since it's identical to the superclass
version.
2. Add some setsockopt constants to netlink.py.
3. Do the right thing if the kernel returns an error in a dump
request.
Change-Id: I37e49b35f1366760a408c7c4a73f95164d796a2e
diff --git a/net/test/iproute.py b/net/test/iproute.py
index fef4b5c..7c9eec0 100644
--- a/net/test/iproute.py
+++ b/net/test/iproute.py
@@ -209,10 +209,6 @@
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/net/test/net_test.py b/net/test/net_test.py
index 09a6a55..ada7eba 100755
--- a/net/test/net_test.py
+++ b/net/test/net_test.py
@@ -30,11 +30,14 @@
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/net/test/netlink.py b/net/test/netlink.py
index 65dc4b6..6b2c60d 100644
--- a/net/test/netlink.py
+++ b/net/test/netlink.py
@@ -227,6 +227,10 @@
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