Hi,

SIOCSIFALIFETIME_IN6 has been removed from sys/netinet6/in6_var.h with
the following commit:

commit f487585d711456156cf95432fac5a11ff78440c8
Author: stefan <ste...@openbsd.org>
Date:   Sun Feb 28 07:15:34 2016 +0000

    Remove SIOCSIFALIFETIME_IN6 ioctl, as NetBSD did.
    
    As described in NetBSD kern/35897 PR, the parameters
    this ioctl needs overlay each other in a union. The ioctl
    cannot have worked properly.
    
    Discovered while discussing overflow checks with mmcc@ and mpi@
    The checks were part of the removed code.
    
    ok deraadt@

Can I remove pltime and vltime from ifconfig command?
--
ASOU Masato

Index: regress/sbin/ifconfig/ifaddr.c
===================================================================
RCS file: /cvs/src/regress/sbin/ifconfig/ifaddr.c,v
retrieving revision 1.8
diff -u -p -r1.8 ifaddr.c
--- regress/sbin/ifconfig/ifaddr.c      8 Mar 2023 04:43:06 -0000       1.8
+++ regress/sbin/ifconfig/ifaddr.c      12 Apr 2023 11:02:41 -0000
@@ -159,9 +159,6 @@ void        settunnelinst(const char *, int);
 void   unsettunnelinst(const char *, int);
 void   settunnelttl(const char *, int);
 void   setia6flags(const char *, int);
-void   setia6pltime(const char *, int);
-void   setia6vltime(const char *, int);
-void   setia6lifetime(const char *, const char *);
 void   setia6eui64(const char *, int);
 void   setrdomain(const char *, int);
 void   unsetrdomain(const char *, int);
@@ -195,8 +192,6 @@ const struct        cmd {
        { "-anycast",   -IN6_IFF_ANYCAST,       0,      setia6flags },
        { "tentative",  IN6_IFF_TENTATIVE,      0,      setia6flags },
        { "-tentative", -IN6_IFF_TENTATIVE,     0,      setia6flags },
-       { "pltime",     NEXTARG,        0,              setia6pltime },
-       { "vltime",     NEXTARG,        0,              setia6vltime },
        { "eui64",      0,              0,              setia6eui64 },
 #ifndef SMALL
        { "rtlabel",    NEXTARG,        0,              setifrtlabel },
@@ -345,10 +340,6 @@ main(int argc, char *argv[])
        }
        (void) strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
 
-       /* initialization */
-       in6_addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
-       in6_addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
-
        if (aflag == 0) {
                create = (argc > 0) && strcmp(argv[0], "destroy") != 0;
                (void)getinfo(&ifr, create);
@@ -787,43 +778,6 @@ setia6flags(const char *vname, int value
                in6_addreq.ifra_flags &= ~value;
        } else
                in6_addreq.ifra_flags |= value;
-}
-
-void
-setia6pltime(const char *val, int d)
-{
-
-       setia6lifetime("pltime", val);
-}
-
-void
-setia6vltime(const char *val, int d)
-{
-
-       setia6lifetime("vltime", val);
-}
-
-void
-setia6lifetime(const char *cmd, const char *val)
-{
-       const char *errmsg = NULL;
-       time_t newval, t;
-
-       newval = strtonum(val, 0, 1000000, &errmsg);
-       if (errmsg)
-               errx(1, "invalid %s %s: %s", cmd, val, errmsg);
-
-       t = time(NULL);
-
-       if (afp->af_af != AF_INET6)
-               errx(1, "%s not allowed for this address family", cmd);
-       if (strcmp(cmd, "vltime") == 0) {
-               in6_addreq.ifra_lifetime.ia6t_expire = t + newval;
-               in6_addreq.ifra_lifetime.ia6t_vltime = newval;
-       } else if (strcmp(cmd, "pltime") == 0) {
-               in6_addreq.ifra_lifetime.ia6t_preferred = t + newval;
-               in6_addreq.ifra_lifetime.ia6t_pltime = newval;
-       }
 }
 
 void
Index: sbin/ifconfig/ifconfig.8
===================================================================
RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v
retrieving revision 1.391
diff -u -p -r1.391 ifconfig.8
--- sbin/ifconfig/ifconfig.8    7 Mar 2023 20:09:47 -0000       1.391
+++ sbin/ifconfig/ifconfig.8    12 Apr 2023 11:02:42 -0000
@@ -1347,10 +1347,8 @@ protocol when supported by the access po
 .Op Oo Fl Oc Ns Cm anycast
 .Op Oo Fl Oc Ns Cm temporary
 .Op Cm eui64
-.Op Cm pltime Ar n
 .Op Oo Fl Oc Ns Cm soii
 .Op Oo Fl Oc Ns Cm tentative
-.Op Cm vltime Ar n
 .Ek
 .nr nS 0
 .Pp
@@ -1394,8 +1392,6 @@ invalid.
 Fill the interface index
 .Pq the lowermost 64 bits of an IPv6 address
 automatically.
-.It Cm pltime Ar n
-Set preferred lifetime for the address, in seconds.
 .It Cm soii
 Enable persistent Semantically Opaque Interface Identifiers (SOIIs),
 as per RFC 7217, for SLAAC addresses on the interface.
@@ -1416,8 +1412,6 @@ invalid.
 Set the IPv6 tentative address bit.
 .It Cm -tentative
 Clear the IPv6 tentative address bit.
-.It Cm vltime Ar n
-Set valid lifetime for the address, in seconds.
 .El
 .Sh INTERFACE GROUPS
 .Nm ifconfig
Index: sbin/ifconfig/ifconfig.c
===================================================================
RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.462
diff -u -p -r1.462 ifconfig.c
--- sbin/ifconfig/ifconfig.c    8 Mar 2023 04:43:06 -0000       1.462
+++ sbin/ifconfig/ifconfig.c    12 Apr 2023 11:02:42 -0000
@@ -226,9 +226,6 @@ void        delifparent(const char *, int);
 void   getifparent(struct ifencap *);
 void   getencap(void);
 void   setia6flags(const char *, int);
-void   setia6pltime(const char *, int);
-void   setia6vltime(const char *, int);
-void   setia6lifetime(const char *, const char *);
 void   setia6eui64(const char *, int);
 void   setmedia(const char *, int);
 void   setmediaopt(const char *, int);
@@ -460,8 +457,6 @@ const struct        cmd {
        { "-anycast",   -IN6_IFF_ANYCAST,       0,      setia6flags },
        { "tentative",  IN6_IFF_TENTATIVE,      0,      setia6flags },
        { "-tentative", -IN6_IFF_TENTATIVE,     0,      setia6flags },
-       { "pltime",     NEXTARG,        0,              setia6pltime },
-       { "vltime",     NEXTARG,        0,              setia6vltime },
        { "eui64",      0,              0,              setia6eui64 },
        { "temporary",  1,              0,              settemporary },
        { "-temporary", -1,             0,              settemporary },
@@ -863,10 +858,6 @@ main(int argc, char *argv[])
        }
        (void) strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
 
-       /* initialization */
-       in6_addreq.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME;
-       in6_addreq.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME;
-
        /*
         * NOTE:  We must special-case the `create' command right
         * here as we would otherwise fail in getinfo().
@@ -1489,43 +1480,6 @@ setia6flags(const char *vname, int value
                in6_addreq.ifra_flags &= ~value;
        } else
                in6_addreq.ifra_flags |= value;
-}
-
-void
-setia6pltime(const char *val, int d)
-{
-
-       setia6lifetime("pltime", val);
-}
-
-void
-setia6vltime(const char *val, int d)
-{
-
-       setia6lifetime("vltime", val);
-}
-
-void
-setia6lifetime(const char *cmd, const char *val)
-{
-       const char *errmsg = NULL;
-       time_t newval, t;
-
-       newval = strtonum(val, 0, 1000000, &errmsg);
-       if (errmsg)
-               errx(1, "invalid %s %s: %s", cmd, val, errmsg);
-
-       t = time(NULL);
-
-       if (afp->af_af != AF_INET6)
-               errx(1, "%s not allowed for this address family", cmd);
-       if (strcmp(cmd, "vltime") == 0) {
-               in6_addreq.ifra_lifetime.ia6t_expire = t + newval;
-               in6_addreq.ifra_lifetime.ia6t_vltime = newval;
-       } else if (strcmp(cmd, "pltime") == 0) {
-               in6_addreq.ifra_lifetime.ia6t_preferred = t + newval;
-               in6_addreq.ifra_lifetime.ia6t_pltime = newval;
-       }
 }
 
 void

Reply via email to