diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-12-17 13:23:43 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2015-02-02 17:47:30 +0900 |
commit | 1892b4bef43fc66e64923debd2619e88faaf2f9b (patch) | |
tree | 6651308dea37cda416d4d5ad5b0fc82939b7592b /tests | |
parent | b2ea5d6fef9445f25d2f1023643fb620d8c1a216 (diff) | |
download | extras-1892b4bef43fc66e64923debd2619e88faaf2f9b.tar.gz |
Don't infinite loop if read() on tun returns 0
Change-Id: I146ca638a250ab1d20655b995f6fa9bf637187a6
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/net_test/mark_test.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/net_test/mark_test.py b/tests/net_test/mark_test.py index 03f3b818..9e78b7a6 100755 --- a/tests/net_test/mark_test.py +++ b/tests/net_test/mark_test.py @@ -659,6 +659,8 @@ class MultiNetworkTest(net_test.NetworkTest): while True: try: packet = posix.read(self.tuns[netid].fileno(), 4096) + if len(packet) == 0: + break ether = scapy.Ether(packet) # Multicast frames are frames where the first byte of the destination # MAC address has 1 in the least-significant bit. |