diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-12-11 16:30:17 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2015-12-14 17:01:27 +0900 |
commit | 7265a2cec99da06ccecb8740f7dd451efa18b757 (patch) | |
tree | d87f1acf3bd0341f1d0241eba9237545661704ef | |
parent | ffb57eac0632f91f5ae6ccfa39e5e48b3d03ba87 (diff) | |
download | extras-7265a2cec99da06ccecb8740f7dd451efa18b757.tar.gz |
Deal with flowlabel randomization.
Recent kernels randomize flowlabels by default. This causes our
packet comparisons to fail. Fix this by copying over the
flowlabel like we do with the IP id and the DF bit.
Change-Id: I8cf2685e622d89ca25fab443bab3bb1c3079b076
-rw-r--r-- | tests/net_test/multinetwork_base.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/net_test/multinetwork_base.py b/tests/net_test/multinetwork_base.py index 2282bbab..c178bdd9 100644 --- a/tests/net_test/multinetwork_base.py +++ b/tests/net_test/multinetwork_base.py @@ -517,6 +517,12 @@ class MultiNetworkBaseTest(net_test.NetworkTest): actualip.flags &= 5 actualip.chksum = None # Change the header, recalculate the checksum. + # Blank out the flow label, since new kernels randomize it by default. + actualipv6 = actual.getlayer("IPv6") + expectedipv6 = expected.getlayer("IPv6") + if actualipv6 and expectedipv6: + actualipv6.fl = expectedipv6.fl + # Blank out UDP fields that we can't predict (e.g., the source port for # kernel-originated packets). actualudp = actual.getlayer("UDP") @@ -529,7 +535,6 @@ class MultiNetworkBaseTest(net_test.NetworkTest): # Since the TCP code below messes with options, recalculate the length. if actualip: actualip.len = None - actualipv6 = actual.getlayer("IPv6") if actualipv6: actualipv6.plen = None |