Test scenario (HEAD, local addr IPv4/IPv6 case):
- add printf() to LLE_IFADDR check
- add printf() to IFF_SIMPLEX unicast case
- try to ping IPv4/IPv6 LL/global addresses on ethernet interface
Results:
IPv4: no match for both printfs (loopback route shortcuts the way)
IPv6: match for first check for both LL/global addresses (Hello, D3868)
Test scenario: HEAD, insert IPv6 GU lle with our local mac:
Host1 runs the script, host2 runs the ping.
```
#!/usr/local/bin/python2.7
from scapy.all import *
#interface we're using
SRC_IF="vtnet0"
# real local MAC
SRC_MAC="52:54:00:f1:46:81"
# SRC address we're answering
SRC_OUT6="2a02::5054:ff:1111:2222"
# lladdr of victim machine
DST_MAC="52:54:00:04:17:89"
# Victim machine addr (for unicast reply)
DST_OUT6="2a02::5054:ff:fe04:1789"
ip=IPv6(src=SRC_OUT6, dst=DST_OUT6)/ICMPv6ND_NA(tgt=SRC_OUT6, S=1)/ICMPv6NDOptDstLLAddr(lladdr=DST_MAC)
eth=Ether(src=SRC_MAC, dst=DST_MAC)/ip
sendp(eth, iface=SRC_IF)
```
host2: ping6 SRC_OUT6 (issues NS)
host1: python script.py (issues NA)
host2: sees NA, installs new ND record with lladdr==local addr
host2: sends ICMP6 which gets to if_simploop(), ip6_input() -> check forwarding -> drop
host2: sysctl net.inet6.ip6.forwarding=1
host2: sends ICMP6 which gets to if_simploop(), ip6_input() -> ip6_forward() -> ether_output() -> if_simloop() ... (till TTL expires)
Results:
packets towards external network node with our mac are either dropped (no forwarding) or cycled in the kernel until TTL expires