Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 broken under bhyve unless allow_ip_spoofing is set. #930

Open
sjorge opened this issue Apr 30, 2020 · 24 comments
Open

IPv6 broken under bhyve unless allow_ip_spoofing is set. #930

sjorge opened this issue Apr 30, 2020 · 24 comments

Comments

@sjorge
Copy link
Contributor

sjorge commented Apr 30, 2020

Today on #smartos Alasdair was asking about some odd behavior he was seeing.

I was able to replicate the behavior, it seems to effect both windows and linux so it is probably a issue on the illumos side.

With an interface configured for dhcp and addrconf (slaac or dhcpv6):

[
  {
    "interface": "net0",
    "mac": "52:84:c7:c8:8f:e8",
    "vlan_id": 10,
    "nic_tag": "trunk",
    "ip": "dhcp",
    "ips": [
      "dhcp",
      "addrconf"
    ],
    "model": "virtio",
    "primary": true
  }
]

The interface comes up and gets both a ipv4 and ipv6 address, but that is roughly where it stops.

PS C:\WINDOWS\system32> ipconfig

Windows IP Configuration


Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : vlan10.acheron.be
   IPv6 Address. . . . . . . . . . . : 2001:xxx:xxx:10:3968:b0fa:f23d:e99d
   Temporary IPv6 Address. . . . . . : 2001:xxx:xxx:10:2078:871e:1d20:b0c
   Link-local IPv6 Address . . . . . : fe80::3968:b0fa:f23d:e99d%17
   IPv4 Address. . . . . . . . . . . : 10.23.10.231
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::222:6ff:fe0a:1%17
                                       10.23.10.1

No IPv6 global or local-link address can be reached, ipv4 is working fine.

After settingallow_ip_spoofing to true and rebooting the vm everything is working fine. (easy to check by going to https://test-ipv6.com)

You can even play with this on a live VM, starting the vm without allow_ip_spoofing set to true.

Notice IPv6 is broken, then toggle it from the global zone:

dladm set-linkprop -z eceec5eb-22c7-e65b-fd6b-81ebdb36406b net0 -p protection=mac-nospoof,dhcp-nospoof,restricted

And imediatly IPv6 starts working.

@jasonbking
Copy link
Contributor

It may be a bit before I can dig into this, but if you want to play around in the meantime, the following D script might help identify what's failing

ipnospoof_check_v6:entry { self->trace = 1 }
check_slaac_ip:return /self->trace/ { trace(arg1); }
check_dhcpv6_dyn_ip:return /self->trace/ { trace(arg1); }
ipnospoof_check_v6:return { self->trace = 0; trace(arg1); }

@sjorge
Copy link
Contributor Author

sjorge commented Apr 30, 2020

So do each of these separate like:

 dtrace -n 'ipnospoof_check_v6:entry { self->trace = 1 }'

Doesn't seem to work, but given the self->trace I assume I need to have them multiline somehow?

@jasonbking
Copy link
Contributor

should be able to put them into a file and run with dtrace -s (or put #!/usr/sbin/dtrace -s on the first line)

@sjorge
Copy link
Contributor Author

sjorge commented Apr 30, 2020

OK, figured it out. Add it all to a file and call dtrace -s filename...

[root@boron ~]# dtrace -s 930.d
dtrace: script '930.d' matched 4 probes
CPU     ID                    FUNCTION:NAME
  8  36559        ipnospoof_check_v6:return                 1
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
 10  36541            check_slaac_ip:return                 0
 10  36521       check_dhcpv6_dyn_ip:return                 0
 10  36559        ipnospoof_check_v6:return                 0
 10  36541            check_slaac_ip:return                 0
 10  36521       check_dhcpv6_dyn_ip:return                 0
 10  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0                                                 [365/418]
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0                                                 [344/418]
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0                                                 [326/418]
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
  2  36541            check_slaac_ip:return                 0
  2  36521       check_dhcpv6_dyn_ip:return                 0
  2  36559        ipnospoof_check_v6:return                 0
  9  36541            check_slaac_ip:return                 0                                                 [305/418]
  9  36521       check_dhcpv6_dyn_ip:return                 0
  9  36559        ipnospoof_check_v6:return                 0
  9  36541            check_slaac_ip:return                 0
  9  36521       check_dhcpv6_dyn_ip:return                 0
  9  36559        ipnospoof_check_v6:return                 0
  9  36541            check_slaac_ip:return                 0
  9  36521       check_dhcpv6_dyn_ip:return                 0
  9  36559        ipnospoof_check_v6:return                 0
  9  36541            check_slaac_ip:return                 0
  9  36521       check_dhcpv6_dyn_ip:return                 0
  9  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
  4  36541            check_slaac_ip:return                 0
  4  36521       check_dhcpv6_dyn_ip:return                 0
  4  36559        ipnospoof_check_v6:return                 0
  4  36541            check_slaac_ip:return                 0
  4  36521       check_dhcpv6_dyn_ip:return                 0
  4  36559        ipnospoof_check_v6:return                 0
 3  36541            check_slaac_ip:return                 0                                                 [278/418]
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
 12  36541            check_slaac_ip:return                 0
 12  36521       check_dhcpv6_dyn_ip:return                 0
 12  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0                                                 [221/418]
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
  6  36541            check_slaac_ip:return                 0
  6  36521       check_dhcpv6_dyn_ip:return                 0
  6  36559        ipnospoof_check_v6:return                 0
  6  36541            check_slaac_ip:return                 0
  6  36521       check_dhcpv6_dyn_ip:return                 0
  6  36559        ipnospoof_check_v6:return                 0
  6  36541            check_slaac_ip:return                 0
  6  36521       check_dhcpv6_dyn_ip:return                 0
  6  36559        ipnospoof_check_v6:return                 0
  4  36541            check_slaac_ip:return                 0
  4  36521       check_dhcpv6_dyn_ip:return                 0
  4  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0                                                 [170/418]
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0                                                 [138/418]
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  7  36541            check_slaac_ip:return                 0
  7  36521       check_dhcpv6_dyn_ip:return                 0
  7  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
  2  36541            check_slaac_ip:return                 0
  2  36521       check_dhcpv6_dyn_ip:return                 0
  2  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0 
 13  36559        ipnospoof_check_v6:return                 0
 13  36541            check_slaac_ip:return                 0
 13  36521       check_dhcpv6_dyn_ip:return                 0
 13  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0                                                [86/418]
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  5  36541            check_slaac_ip:return                 0
  5  36521       check_dhcpv6_dyn_ip:return                 0
  5  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  8  36541            check_slaac_ip:return                 0
  8  36521       check_dhcpv6_dyn_ip:return                 0
  8  36559        ipnospoof_check_v6:return                 0
  2  36541            check_slaac_ip:return                 0
  2  36521       check_dhcpv6_dyn_ip:return                 0
  2  36559        ipnospoof_check_v6:return                 0
  4  36521       check_dhcpv6_dyn_ip:return                 0
  4  36559        ipnospoof_check_v6:return                 0
  4  36541            check_slaac_ip:return                 0
  4  36521       check_dhcpv6_dyn_ip:return                 0
  4  36559        ipnospoof_check_v6:return                 0
  9  36541            check_slaac_ip:return                 0
  9  36521       check_dhcpv6_dyn_ip:return                 0
  9  36559        ipnospoof_check_v6:return                 0
  9  36541            check_slaac_ip:return                 0
  9  36521       check_dhcpv6_dyn_ip:return                 0                                                                                                                                        9  36559        ipnospoof_check_v6:return                 0                                                                                                                                        3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  5  36541            check_slaac_ip:return                 0
  5  36521       check_dhcpv6_dyn_ip:return                 0
  5  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
  5  36541            check_slaac_ip:return                 0
  5  36521       check_dhcpv6_dyn_ip:return                 0
  5  36559        ipnospoof_check_v6:return                 0
  1  36541            check_slaac_ip:return                 0
  1  36521       check_dhcpv6_dyn_ip:return                 0
  1  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0                                                                                                                              [24/410]
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 15  36541            check_slaac_ip:return                 0
 15  36521       check_dhcpv6_dyn_ip:return                 0
 15  36559        ipnospoof_check_v6:return                 0
 14  36541            check_slaac_ip:return                 0
 14  36521       check_dhcpv6_dyn_ip:return                 0
 14  36559        ipnospoof_check_v6:return                 0
 12  36541            check_slaac_ip:return                 0
 12  36521       check_dhcpv6_dyn_ip:return                 0
 12  36559        ipnospoof_check_v6:return                 0
 12  36541            check_slaac_ip:return                 0
 12  36521       check_dhcpv6_dyn_ip:return                 0
 12  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
  3  36541            check_slaac_ip:return                 0
  3  36521       check_dhcpv6_dyn_ip:return                 0
  3  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
 11  36541            check_slaac_ip:return                 0
 11  36521       check_dhcpv6_dyn_ip:return                 0
 11  36559        ipnospoof_check_v6:return                 0
  4  36541            check_slaac_ip:return                 0
  4  36521       check_dhcpv6_dyn_ip:return                 0
  4  36559        ipnospoof_check_v6:return                 0
  4  36541            check_slaac_ip:return                 0
  4  36521       check_dhcpv6_dyn_ip:return                 0
  4  36559        ipnospoof_check_v6:return                 0
 12  36541            check_slaac_ip:return                 0
 12  36521       check_dhcpv6_dyn_ip:return                 0
 12  36559        ipnospoof_check_v6:return                 0
 10  36541            check_slaac_ip:return                 0
 10  36521       check_dhcpv6_dyn_ip:return                 0
 10  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
  0  36541            check_slaac_ip:return                 0
  0  36521       check_dhcpv6_dyn_ip:return                 0
  0  36559        ipnospoof_check_v6:return                 0
^C

@sjorge
Copy link
Contributor Author

sjorge commented Apr 30, 2020

That was captured during boot and trying to load an ipv6 webpage

@jasonbking
Copy link
Contributor

jasonbking commented Apr 30, 2020

That first success is actually interesting... maybe try this (hopefully no bugs):

#!/usr/sbin/dtrace -s
ipnospoof_check_v6:entry { self->addr = args[2]; }
ipnospoof_check_v6:return { printf("addr = %s ret = %lld\n", inet_ntoa6((struct in6_addr *)self->addr), (long long)arg1); }

@sjorge
Copy link
Contributor Author

sjorge commented Apr 30, 2020

dtrace: failed to compile script ./930.d: line 3: self->adds has not yet been declared or assigned

@jasonbking
Copy link
Contributor

I corrected it since autocorrect was so unhelpfully altering the code.. try it again..

@sjorge
Copy link
Contributor Author

sjorge commented Apr 30, 2020

[root@boron ~]# ./930.d
dtrace: script './930.d' matched 2 probes
CPU     ID                    FUNCTION:NAME
  7  36559        ipnospoof_check_v6:return addr = :: ret = 1

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = :: ret = 1

  3  36559        ipnospoof_check_v6:return addr = :: ret = 1

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  6  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  6  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  6  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  6  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 13  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 15  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 10  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 13  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  8  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  8  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  6  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 11  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  2  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  2  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 10  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 10  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  6  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 13  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 15  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 15  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 15  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  8  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  2  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  8  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  8  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  8  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  6  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 13  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  8  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 15  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  1  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 15  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 15  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 15  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 15  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 15  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 11  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 11  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 12  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 12  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  0  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 10  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  2  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  2  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  2  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  2  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 15  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

 14  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  5  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  6  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  8  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  8  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  1  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  2  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  7  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  3  36559        ipnospoof_check_v6:return addr = 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8 ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  3  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  4  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

^C
  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

  9  36559        ipnospoof_check_v6:return addr = fe80::3968:b0fa:f23d:e99d ret = 0

Those addresses are indeed what I have in the vm:

PS C:\WINDOWS\system32> ipconfig

Windows IP Configuration


Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : vlan10.acheron.be
   IPv6 Address. . . . . . . . . . . : 2001:xxx:xxxx:10:3968:b0fa:f23d:e99d
   Temporary IPv6 Address. . . . . . : 2001:xxx:xxxx:10:95bc:7145:6f6f:c8d8
   Link-local IPv6 Address . . . . . : fe80::3968:b0fa:f23d:e99d%17
   IPv4 Address. . . . . . . . . . . : 10.23.10.231
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::222:6ff:fe0a:1%17
                                       10.23.10.1

@jasonbking
Copy link
Contributor

hrm...

#!/usr/sbin/dtrace -s

sdt::intercept_dhcpv6_inbound: {}
sdt::intercept_dhcpv6_outbound: {}
sdt::insert_slaac_ip:generated-addr { trace(inet_ntoa6(arg0)) }

@sjorge
Copy link
Contributor Author

sjorge commented May 1, 2020

dtrace: failed to compile script ./930-2.d: line 5: inet_ntoa6( ) argument #1 is incompatible with prototype:
	prototype: in6_addr_t *
	 argument: int64_t

@sjorge
Copy link
Contributor Author

sjorge commented May 1, 2020

1435static boolean_t
1436insert_slaac_ip(avl_tree_t *tree, in6_addr_t *token, slaac_addr_t *addr)
1437{
1438	uint_t		i;
1439	avl_index_t	where;
1440	in6_addr_t	*prefix = &addr->sla_prefix;
1441	in6_addr_t	*in6p = &addr->sla_addr;
1442
1443	bcopy(prefix, in6p, sizeof (struct in6_addr));
1444
1445	for (i = 0; i < 4; i++) {
1446		in6p->s6_addr32[i] = token->s6_addr32[i] |
1447		    in6p->s6_addr32[i];
1448	}
1449
1450	DTRACE_PROBE1(generated__addr, in6_addr_t *, in6p);
1451
1452	if (avl_find(tree, addr, &where) != NULL)
1453		return (B_FALSE);
1454
1455	avl_insert(tree, addr, where);
1456	return (B_TRUE);
1457}

I think we want arg1 here?

Edit: same error, so I guess not.

@sjorge
Copy link
Contributor Author

sjorge commented May 1, 2020

I removed the net_ntoa6() so it just trace(arg0), that printed nothing.

[root@boron ~]# ./930-2.d
dtrace: script './930-2.d' matched 9 probes
^C

@jasonbking
Copy link
Contributor

What specific method are you using to obtain the IPv6 address?

@sjorge
Copy link
Contributor Author

sjorge commented May 1, 2020

In this case just slaac, with dns server over dhcpv6 (so no addresses via dhcpv6)
Not even sure windows 10 will query the dhcpv6 for DNS.

But the addresses in the ipconfig are slaac.

From what it looks like windows first tries to reach the internet via the temp address and then switch to the normal one afterwards (probably as a fallback)

@jasonbking
Copy link
Contributor

It was probably args[0] -- but doesn't really matter since the probes weren't triggered.

IIUC, it should be detecting and adding the SLAAC address -- which should happen via the insert_slaac_ip function -- but since that isn't happening (the generated-addr probe didn't fire), it seems like it's not detecting that at all. I'll need to dig a bit more to understand how it does that.

@jasonbking
Copy link
Contributor

jasonbking commented May 1, 2020

Maybe broaden our scope a bit... see which of these fires..

#!/usr/sbin/dtrace -s
::intercept_dhcpv6_inbound: {}
::intercept_dhcpv6_outbound: {}
::insert_slaac_ip: {}
::insert_slaac_prefix: {}
::intercept_prefix_info: {}
::intercept_ra_inbound: {}

@sjorge
Copy link
Contributor Author

sjorge commented May 1, 2020

CPU     ID                    FUNCTION:NAME
  0  36536  intercept_dhcpv6_outbound:entry
  0  36537 intercept_dhcpv6_outbound:return

Oddly enough it also returns the above if I disable the dhcpv6 server. It gets the slaac address in both cases and also DNS, so I'm not even sure windows 10 needs dhcpv6.

@jasonbking
Copy link
Contributor

If the VM is sending out a DHCPv6 query, then it would make sense -- that's capturing the outbound traffic. From what I can tell, the address restriction bits act somewhat analogous to a very small stateful firewall in that it tracks the outbound requests and responses. So it looks at the inbound and outbound DHCP packets, and a valid DHCP server response adds the IP to the allowed list of the VM. It does look like I missed a probe in the above script which might help as well, so another one to try:

#!/usr/sbin/dtrace -s
::intercept_dhcpv6_inbound: {}
::intercept_dhcpv6_outbound: {}
::insert_slaac_ip: {}
::insert_slaac_prefix: {}
::intercept_prefix_info: {}
::intercept_ra_inbound: {}
::ipnospoof_check_ndp: {}

@sjorge
Copy link
Contributor Author

sjorge commented May 1, 2020

dtrace: script './930-2.d' matched 32 probes
CPU     ID                    FUNCTION:NAME
  3  36560        ipnospoof_check_ndp:entry
  3  36561       ipnospoof_check_ndp:return
  3  36536  intercept_dhcpv6_outbound:entry
  3  36537 intercept_dhcpv6_outbound:return
  3  36560        ipnospoof_check_ndp:entry
  3  36561       ipnospoof_check_ndp:return
  3  36536  intercept_dhcpv6_outbound:entry
  3  36537 intercept_dhcpv6_outbound:return
  8  36560        ipnospoof_check_ndp:entry
  8  36561       ipnospoof_check_ndp:return
  8  36536  intercept_dhcpv6_outbound:entry
  8  36537 intercept_dhcpv6_outbound:return

@sjorge
Copy link
Contributor Author

sjorge commented May 12, 2020

As mentioned on IRC:

  • native -> OK
  • lx -> quirky
  • bhyve -> broken
  • kvm -> broken

@bahamat
Copy link
Member

bahamat commented Aug 1, 2020

Some additional info here.

  • It seems that link local works fine on any brand
  • Setting allow_ip_spoofing, or adding the subnet prefix or the specific IP to allowed_ips works. But it also works if ips does not include addrconf.

Maybe what we're looking at here is simply that addrconf gets ignored for kvm/bhyve?

The link properties are the same though.

# dladm show-linkprop -p dynamic-methods
LINK         PROPERTY        PERM VALUE          DEFAULT        POSSIBLE
e1000g0      dynamic-methods rw   --             --             dhcpv4,dhcpv6,slaac,
                                                                addrconf 
sdc_underlay0 dynamic-methods rw  --             --             dhcpv4,dhcpv6,slaac,
                                                                addrconf 
net0         dynamic-methods rw   dhcpv4,dhcpv6, --             dhcpv4,dhcpv6,slaac,
                                  slaac                         addrconf 
net0         dynamic-methods rw   dhcpv4,dhcpv6, --             dhcpv4,dhcpv6,slaac,
                                  slaac                         addrconf 
net0         dynamic-methods rw   dhcpv4,dhcpv6, --             dhcpv4,dhcpv6,slaac,
                                  slaac                         addrconf 
net0         dynamic-methods rw   dhcpv4,dhcpv6, --             dhcpv4,dhcpv6,slaac,
                                  slaac                         addrconf 
eth0         dynamic-methods rw   dhcpv4,dhcpv6, --             dhcpv4,dhcpv6,slaac,
                                  slaac                         addrconf 

@sjorge
Copy link
Contributor Author

sjorge commented Aug 1, 2020

But it was seeing the traffic right? So the layer underneath bhyve/kvm is aware of the addrconf configured address?

@bahamat
Copy link
Member

bahamat commented Aug 1, 2020

@sjorge I'm not sure which "it" you mean.

Both kvm and bhyve receive neighbor-solicitations (because they happen over link-local addresses), and respond with neighbor-advertisements, which can be seen with tcpdump in the guest. But they don't always get all the way out.

  • Neighbor-advertisements from bhyve/kvm guest's link-local address are passed onto the wire. This can be seen from snoop in the global zone, and with tcpdump/snoop on network peers.
  • Neighbor-advertisements from bhyve/kvm guest's global ipv6 address get dropped sometime before snoop in the global zone can see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants