Bug 256813

Summary: no neighbor advertisement after repeatedly setting ipv6
Product: Base System Reporter: jcaplan
Component: kernAssignee: freebsd-net (Nobody) <net>
Status: New ---    
Severity: Affects Some People CC: lwhsu
Priority: --- Keywords: ipv6
Version: 13.0-STABLE   
Hardware: Any   
OS: Any   

Description jcaplan 2021-06-24 16:00:43 UTC

Repeatedly setting the ipv6 address for an interface on two targets and then trying to ping one from the other fails. The sender sends neighbor solicitations but gets no reply. 

Steps to Reproduce
Two devices D1 and D2

D1> ifconfig vmx0 inet6 2001::2 up
D2> ifconfig vmx0 inet6 2001::3 up
D1> ping6   2001::3              
PING6(56=40+8+8 bytes) 2001::2 --> 2001::3

--- 2001::3 ping6 statistics ---
9 packets transmitted, 0 packets received, 100.0% packet loss

Check with tcpdump that D2 shows no received packets.
Actual Results

All packets lost

Expected Results
D2 replies with neighbor advertisement and ping works

Build Date & Hardware

FreeBSD freebsd 13.0-RELEASE FreeBSD 13.0-RELEASE #6 releng/13.0-n244733-ea31abc261f: Sat Jun 19 06:23:53 UTC 2021

Additional Information

- Produced same result with both em and vmx drivers.
- Flapping the interface does not fix the problem, only deleting the address and then re-adding it.
- Sometimes it takes multiple address assignments for problem to manifest.
- DDB breakpoint for ip6_input is never hit when problem occurs
- Wireshark on linux host shows solicitation packets.

Issue is not reproduceable with Linux because they have:

sudo ifconfig vmnet21 inet6 add 2001::4/64
SIOCSIFADDR: File exists

while on freebsd it appears that ifconfig tries to delete and then re-add the same interface