Martin Pieuchot wrote:
> On 17/02/16(Wed) 20:38, Stefan Kempf wrote:
> > Martin Pieuchot wrote:
> > It looks like NetBSD removed the SIOCSIFALIFETIME_IN6 ioctl a long time
> > ago, along with the overflow checks, saying that this ioctl could never
> > have worked:
> > http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet6/in6.c?rev=1.132&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
> 
> Indeed we should remove it as well.

Here's a diff to remove this ioctl, now that the tree is unlocked.
Nothing in base uses it.

ok?

Index: netinet6/in6.c
===================================================================
RCS file: /cvs/src/sys/netinet6/in6.c,v
retrieving revision 1.183
diff -u -p -r1.183 in6.c
--- netinet6/in6.c      21 Jan 2016 11:23:48 -0000      1.183
+++ netinet6/in6.c      27 Feb 2016 17:24:02 -0000
@@ -253,7 +253,6 @@ in6_control(struct socket *so, u_long cm
        case SIOCSPFXFLUSH_IN6:
        case SIOCSRTRFLUSH_IN6:
        case SIOCGIFALIFETIME_IN6:
-       case SIOCSIFALIFETIME_IN6:
        case SIOCGIFSTAT_IN6:
        case SIOCGIFSTAT_ICMP6:
                sa6 = &ifr->ifr_addr;
@@ -337,26 +336,6 @@ in6_control(struct socket *so, u_long cm
                if (ia6 == NULL)
                        return (EADDRNOTAVAIL);
                break;
-       case SIOCSIFALIFETIME_IN6:
-           {
-               struct in6_addrlifetime *lt;
-
-               if (!privileged)
-                       return (EPERM);
-               if (ia6 == NULL)
-                       return (EADDRNOTAVAIL);
-               /* sanity for overflow - beware unsigned */
-               lt = &ifr->ifr_ifru.ifru_lifetime;
-               if (lt->ia6t_vltime != ND6_INFINITE_LIFETIME
-                && lt->ia6t_vltime + time_second < time_second) {
-                       return EINVAL;
-               }
-               if (lt->ia6t_pltime != ND6_INFINITE_LIFETIME
-                && lt->ia6t_pltime + time_second < time_second) {
-                       return EINVAL;
-               }
-               break;
-           }
        }
 
        switch (cmd) {
@@ -425,21 +404,6 @@ in6_control(struct socket *so, u_long cm
                        } else
                                retlt->ia6t_preferred = maxexpire;
                }
-               break;
-
-       case SIOCSIFALIFETIME_IN6:
-               ia6->ia6_lifetime = ifr->ifr_ifru.ifru_lifetime;
-               /* for sanity */
-               if (ia6->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) {
-                       ia6->ia6_lifetime.ia6t_expire =
-                               time_second + ia6->ia6_lifetime.ia6t_vltime;
-               } else
-                       ia6->ia6_lifetime.ia6t_expire = 0;
-               if (ia6->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) {
-                       ia6->ia6_lifetime.ia6t_preferred =
-                               time_second + ia6->ia6_lifetime.ia6t_pltime;
-               } else
-                       ia6->ia6_lifetime.ia6t_preferred = 0;
                break;
 
        case SIOCAIFADDR_IN6:
Index: netinet6/in6_var.h
===================================================================
RCS file: /cvs/src/sys/netinet6/in6_var.h,v
retrieving revision 1.59
diff -u -p -r1.59 in6_var.h
--- netinet6/in6_var.h  21 Jan 2016 11:23:48 -0000      1.59
+++ netinet6/in6_var.h  27 Feb 2016 17:24:02 -0000
@@ -405,7 +405,6 @@ struct      in6_rrenumreq {
 #define SIOCSRTRFLUSH_IN6      _IOWR('i', 80, struct in6_ifreq)
 
 #define SIOCGIFALIFETIME_IN6   _IOWR('i', 81, struct in6_ifreq)
-#define SIOCSIFALIFETIME_IN6   _IOWR('i', 82, struct in6_ifreq)
 #define SIOCGIFSTAT_IN6                _IOWR('i', 83, struct in6_ifreq)
 #define SIOCGIFSTAT_ICMP6      _IOWR('i', 84, struct in6_ifreq)
 

Reply via email to