Discussion:
SIOCSRTRFLUSH_IN6 and SIOCSPFXFLUSH_IN6
(too old to reply)
Roy Marples
2018-12-14 16:48:08 UTC
Permalink
Hi List!

While debugging a dhcpcd issue with Greg we came across something
peculiar about the SIOCSRTRFLUSH_IN6 and SIOCSPFXFLUSH_IN6 ioctls.

https://nxr.netbsd.org/xref/src/sys/netinet6/in6_var.h#453
Says the passed argument should be a struct in6_ifreq.

https://nxr.netbsd.org/xref/src/usr.sbin/ndp/ndp.c#1400
Disagrees and just passes the interface name.
This *might* be ok (the first member of the struct is the interface name
character array), my C foo isn't that strong to say it won't/will work
but it looks wrong.
dhcpcd was based on this call.

However, our kernel (and the other BSDs) disregard any parameter given
and just flushes the lot.

The issue came about because while running dhcpcd on an interface
without disabling the ipv6 part of dhcpcd, it affected the working
kernel RA setup on another interface.

Fixing this should be straight forward, but my concern is that with dhcp
sending the interface name "dummy0" which is not meant to exist would
break binary compat as ideally a NULL parameter should be sent - dummy0
could be a real interface one day.

Thoughts on this welcome.

Roy

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Roy Marples
2018-12-14 16:52:49 UTC
Permalink
Post by Roy Marples
Fixing this should be straight forward, but my concern is that with dhcp
sending the interface name "dummy0" which is not meant to exist would
break binary compat as ideally a NULL parameter should be sent - dummy0
could be a real interface one day.
s/with dhcp/with ndp/

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Roy Marples
2018-12-14 21:29:01 UTC
Permalink
Post by Roy Marples
Fixing this should be straight forward, but my concern is that with dhcp
sending the interface name "dummy0" which is not meant to exist would
break binary compat as ideally a NULL parameter should be sent - dummy0
could be a real interface one day.
Turns out it is quite easy really and is backwards compat.
Hopefully Greg can test it fixes the issue and I'll commit it.
I'll also adjust ndp and dhcpcd to use in6_ifreq as that's what the
ioctl really expects.

Roy

Loading...