diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-05-14 18:11:45 -0700 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2015-02-02 17:47:28 +0900 |
commit | 9a2c7bb233a4c0b0d66c5d8fe0a6e264c8759ace (patch) | |
tree | 177dba91e5ea092fdec3908eef78c87b1c6ff3e7 /tests | |
parent | a608717fb126073d5b117f5f3b1d2f8fa5767e8a (diff) | |
download | extras-9a2c7bb233a4c0b0d66c5d8fe0a6e264c8759ace.tar.gz |
Don't check IPv6 echo reply tclass on pre-3.14 kernels
Change-Id: I6044ecd50d608d5d144c50a3e6182150a857fbad
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/net_test/mark_test.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/net_test/mark_test.py b/tests/net_test/mark_test.py index 2e2e5b47..733bd7c5 100755 --- a/tests/net_test/mark_test.py +++ b/tests/net_test/mark_test.py @@ -96,6 +96,8 @@ HAVE_TCP_MARK_ACCEPT = os.path.isfile(TCP_MARK_ACCEPT_SYSCTL) HAVE_EXPERIMENTAL_UID_ROUTING = HaveUidRouting() +LINUX_VERSION = LinuxVersion() + class ConfigurationError(AssertionError): pass @@ -265,7 +267,9 @@ class Packets(object): icmp = {4: icmpv4_reply, 6: scapy.ICMPv6EchoReply}[version] packet = (ip(src=srcaddr, dst=dstaddr) / icmp(id=PING_IDENT, seq=PING_SEQ) / PING_PAYLOAD) - cls._SetPacketTos(packet, PING_TOS) + # IPv6 only started copying the tclass to echo replies in 3.14. + if version == 4 or LINUX_VERSION >= (3, 14): + cls._SetPacketTos(packet, PING_TOS) return ("ICMPv%d echo reply" % version, packet) @classmethod @@ -1474,7 +1478,7 @@ class PMTUTest(InboundMarkingTest): # If this is a connected socket, make sure the socket MTU was set. # Note that in IPv4 this only started working in Linux 3.6! - if use_connect and (version == 6 or LinuxVersion() >= (3, 6)): + if use_connect and (version == 6 or LINUX_VERSION >= (3, 6)): self.assertEquals(1280, self.GetSocketMTU(version, s)) s.close() |