On Wed, Apr 25, 2018 at 11:58:30AM +0100, Jason McIntyre wrote:
> On Wed, Apr 25, 2018 at 12:20:35PM +0200, Sebastian Benoit wrote:
> > ok
> > 
> 
> while doing it, can you move the tunneldomain options (both) to after
> tunneldf instead of before it (both in the mini synopsis and the list)?
> if not, i can fix it later.

Sure thing, updated below.


Index: ifconfig.8
===================================================================
RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v
retrieving revision 1.304
diff -u -p -u -r1.304 ifconfig.8
--- ifconfig.8  23 Feb 2018 05:17:39 -0000      1.304
+++ ifconfig.8  26 Apr 2018 05:29:43 -0000
@@ -1606,8 +1606,8 @@ for a complete list of the available pro
 .Ar tunnel-interface
 .Op Oo Fl Oc Ns Cm keepalive Ar period count
 .Op Oo Fl Oc Ns Cm tunnel Ar src_address dest_address
-.Op Cm tunneldomain Ar tableid
 .Op Oo Fl Oc Ns Cm tunneldf
+.Op Oo Fl Oc Ns Cm tunneldomain Ar tableid
 .Op Cm tunnelttl Ar ttl
 .Op Oo Fl Oc Ns Cm vnetflowid
 .Op Oo Fl Oc Ns Cm vnetid Ar network-id
@@ -1651,6 +1651,10 @@ The optional destination port can be spe
 which further encapsulate the packets in UDP datagrams.
 .It Cm -tunnel
 Remove the source and destination tunnel addresses.
+.It Cm tunneldf
+Do not allow fragmentation of encapsulated packets.
+.It Cm -tunneldf
+Allow fragmentation of encapsulated packets.
 .It Cm tunneldomain Ar tableid
 Use routing table
 .Ar tableid
@@ -1660,10 +1664,8 @@ interface itself.
 .Ar tableid
 can be set to any valid routing table ID;
 the corresponding routing domain is derived from this table.
-.It Cm tunneldf
-Do not allow fragmentation of encapsulated packets.
-.It Cm -tunneldf
-Allow fragmentation of encapsulated packets.
+.It Cm -tunneldomain
+Use the default routing table and routing domain 0.
 .It Cm tunnelttl Ar ttl
 Set the IP or multicast TTL of the tunnel packets.
 If supported by the tunnel protocol,
Index: ifconfig.c
===================================================================
RCS file: /cvs/src/sbin/ifconfig/ifconfig.c,v
retrieving revision 1.361
diff -u -p -u -r1.361 ifconfig.c
--- ifconfig.c  23 Feb 2018 05:17:39 -0000      1.361
+++ ifconfig.c  26 Apr 2018 05:29:44 -0000
@@ -202,6 +202,7 @@ void        setifprefixlen(const char *, int);
 void   settunnel(const char *, const char *);
 void   deletetunnel(const char *, int);
 void   settunnelinst(const char *, int);
+void   unsettunnelinst(const char *, int);
 void   settunnelttl(const char *, int);
 void   setvnetid(const char *, int);
 void   delvnetid(const char *, int);
@@ -457,6 +458,7 @@ const struct        cmd {
        /* deletetunnel is for backward compat, remove during 6.4-current */
        { "deletetunnel",  0,           0,              deletetunnel },
        { "tunneldomain", NEXTARG,      0,              settunnelinst },
+       { "-tunneldomain", 0,           0,              unsettunnelinst },
        { "tunnelttl",  NEXTARG,        0,              settunnelttl },
        { "tunneldf",   0,              0,              settunneldf },
        { "-tunneldf",  0,              0,              settunnelnodf },
@@ -3293,6 +3295,15 @@ settunnelinst(const char *id, int param)
 
        strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
        ifr.ifr_rdomainid = rdomainid;
+       if (ioctl(s, SIOCSLIFPHYRTABLE, (caddr_t)&ifr) < 0)
+               warn("SIOCSLIFPHYRTABLE");
+}
+
+void
+unsettunnelinst(const char *ignored, int alsoignored)
+{
+       strlcpy(ifr.ifr_name, name, sizeof(ifr.ifr_name));
+       ifr.ifr_rdomainid = 0;
        if (ioctl(s, SIOCSLIFPHYRTABLE, (caddr_t)&ifr) < 0)
                warn("SIOCSLIFPHYRTABLE");
 }

Reply via email to