On 25/10/17(Wed) 21:53, Jonathan Gray wrote: > On Wed, Oct 25, 2017 at 12:20:45PM +0200, Martin Pieuchot wrote: > > Diff below remove some more deprecated ioctl(2). The first group below > > correspond to features now deprecated by slaacd(8): > > > > SIOCSIFINFO_FLAGS, SIOCSNDFLUSH_IN6, SIOCSPFXFLUSH_IN6, SIOCSRTRFLUSH_IN6 > > > > Removing those might break some ports. This is good! Because now they > > are broken at compile time and can be fixed. Currently they might or > > might not work. On codesearch.debian.net only dhcpcd5 seems to try to use > > them. > > > > The second group of ioctl(2)s is not used in base and should be used > > conditionally in ports, so it should be safe: > > SIOCGIFADDR_IN6, SIOCGIFSTAT_IN6, SIOCGIFSTAT_ICMP6 > > > > Diff below also move some define around in netinet6/in6_var.h to reduce > > the number of #ifdef _KERNEL chunks. > > > > ok? > > no, this will break the build > > src/usr.sbin/ndp/ndp.c: if (ioctl(s, SIOCSNDFLUSH_IN6, > (caddr_t)&dummyif) < 0)
This is dead code, here's a diff to remove it, ok? Index: ndp.c =================================================================== RCS file: /cvs/src/usr.sbin/ndp/ndp.c,v retrieving revision 1.86 diff -u -p -r1.86 ndp.c --- ndp.c 9 Aug 2017 17:35:38 -0000 1.86 +++ ndp.c 25 Oct 2017 10:55:22 -0000 @@ -135,7 +135,6 @@ void usage(void); int rtmsg(int); int rtget(struct sockaddr_in6 **, struct sockaddr_dl **); void ifinfo(char *); -void harmonize_rtr(void); static char *sec2str(time_t); static void ts_print(const struct timeval *); static int rdomain; @@ -904,21 +903,6 @@ ifinfo(char *ifname) printf(", reachable=%ds", nd.ndi.reachable); printf(", retrans=%ds%dms\n", nd.ndi.retrans / 1000, nd.ndi.retrans % 1000); - - close(s); -} - -void -harmonize_rtr(void) -{ - char dummyif[IFNAMSIZ+8]; - int s; - - if ((s = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) - err(1, "socket"); - strlcpy(dummyif, "lo0", sizeof(dummyif)); /* dummy */ - if (ioctl(s, SIOCSNDFLUSH_IN6, (caddr_t)&dummyif) < 0) - err(1, "ioctl(SIOCSNDFLUSH_IN6)"); close(s); }