mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
tests: Skip proxyarp tests properly if ebtables rule install fails
Otherwise the test will continue on and fail later due to unexpected foreign ARP request. The try/except design here did not work properly to detect this. Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
This commit is contained in:
parent
82f2e3ddce
commit
7ec86f6599
@ -4672,9 +4672,12 @@ def _test_proxyarp_open(dev, apdev, params, ebtables=False):
|
|||||||
if ebtables:
|
if ebtables:
|
||||||
for chain in ['FORWARD', 'OUTPUT']:
|
for chain in ['FORWARD', 'OUTPUT']:
|
||||||
try:
|
try:
|
||||||
subprocess.call(['ebtables', '-A', chain, '-p', 'ARP',
|
err = subprocess.call(['ebtables', '-A', chain, '-p', 'ARP',
|
||||||
'-d', 'Broadcast', '-o', apdev[0]['ifname'],
|
'-d', 'Broadcast',
|
||||||
'-j', 'DROP'])
|
'-o', apdev[0]['ifname'],
|
||||||
|
'-j', 'DROP'])
|
||||||
|
if err != 0:
|
||||||
|
raise
|
||||||
except:
|
except:
|
||||||
raise HwsimSkip("No ebtables available")
|
raise HwsimSkip("No ebtables available")
|
||||||
|
|
||||||
@ -4998,10 +5001,15 @@ def _test_proxyarp_open_ipv6(dev, apdev, params, ebtables=False):
|
|||||||
if ebtables:
|
if ebtables:
|
||||||
for chain in ['FORWARD', 'OUTPUT']:
|
for chain in ['FORWARD', 'OUTPUT']:
|
||||||
try:
|
try:
|
||||||
subprocess.call(['ebtables', '-A', chain, '-d', 'Multicast',
|
err = subprocess.call(['ebtables', '-A', chain,
|
||||||
'-p', 'IPv6', '--ip6-protocol', 'ipv6-icmp',
|
'-d', 'Multicast',
|
||||||
'--ip6-icmp-type', 'neighbor-solicitation',
|
'-p', 'IPv6',
|
||||||
'-o', apdev[0]['ifname'], '-j', 'DROP'])
|
'--ip6-protocol', 'ipv6-icmp',
|
||||||
|
'--ip6-icmp-type',
|
||||||
|
'neighbor-solicitation',
|
||||||
|
'-o', apdev[0]['ifname'], '-j', 'DROP'])
|
||||||
|
if err != 0:
|
||||||
|
raise
|
||||||
subprocess.call(['ebtables', '-A', chain, '-d', 'Multicast',
|
subprocess.call(['ebtables', '-A', chain, '-d', 'Multicast',
|
||||||
'-p', 'IPv6', '--ip6-protocol', 'ipv6-icmp',
|
'-p', 'IPv6', '--ip6-protocol', 'ipv6-icmp',
|
||||||
'--ip6-icmp-type', 'neighbor-advertisement',
|
'--ip6-icmp-type', 'neighbor-advertisement',
|
||||||
|
Loading…
Reference in New Issue
Block a user