ifconfig <if> deletetunnel is different from other ifconfig <if> commands,
as others have options "something" and "-something".

Here i add "-tunnel" and keep "deletetunnel", but undocumented to be removed
2 releases hence. I would update current.html with this.

ok?

(benno_ifconfig_tunnel2.diff)

diff --git sbin/ifconfig/ifconfig.8 sbin/ifconfig/ifconfig.8
index 0e9da423f0c..fdbea82b652 100644
--- sbin/ifconfig/ifconfig.8
+++ sbin/ifconfig/ifconfig.8
@@ -1531,9 +1531,8 @@ for a complete list of the available protocols.
 .Bk -words
 .Nm ifconfig
 .Ar tunnel-interface
-.Op Cm deletetunnel Ar src_address dest_address
 .Op Oo Fl Oc Ns Cm keepalive Ar period count
-.Op Cm tunnel Ar src_address dest_address
+.Op Oo Fl Oc Ns Cm tunnel Ar src_address dest_address
 .Op Cm tunneldomain Ar tableid
 .Op Oo Fl Oc Ns Cm vnetid Ar network-id
 .Ek
@@ -1547,8 +1546,6 @@ and
 are all tunnel interfaces.
 The following options are available:
 .Bl -tag -width Ds
-.It Cm deletetunnel Ar src_address dest_address
-Remove the source and destination tunnel addresses.
 .It Cm keepalive Ar period count
 Enable
 .Xr gre 4
@@ -1576,6 +1573,8 @@ Both addresses must be of the same family.
 The optional destination port can be specified for interfaces such as
 .Xr vxlan 4 ,
 which further encapsulate the packets in UDP datagrams.
+.It Cm -tunnel Ar src_address dest_address
+Remove the source and destination tunnel addresses.
 .It Cm tunneldomain Ar tableid
 Use routing table
 .Ar tableid
diff --git sbin/ifconfig/ifconfig.c sbin/ifconfig/ifconfig.c
index 86cf4f505b0..6e371bb8b1d 100644
--- sbin/ifconfig/ifconfig.c
+++ sbin/ifconfig/ifconfig.c
@@ -424,10 +424,12 @@ const struct      cmd {
        { "maxupd",     NEXTARG,        0,              setpfsync_maxupd },
        { "defer",      1,              0,              setpfsync_defer },
        { "-defer",     0,              0,              setpfsync_defer },
-       { "tunnel",     NEXTARG2,       0,              NULL, settunnel } ,
-       { "deletetunnel",  0,           0,              deletetunnel } ,
-       { "tunneldomain", NEXTARG,      0,              settunnelinst } ,
-       { "tunnelttl",  NEXTARG,        0,              settunnelttl } ,
+       { "tunnel",     NEXTARG2,       0,              NULL, settunnel },
+       { "-tunnel",    0,              0,              deletetunnel },
+       /* deletetunnel is for backward compat, remove during 6.4-current */
+       { "deletetunnel",  0,           0,              deletetunnel },
+       { "tunneldomain", NEXTARG,      0,              settunnelinst },
+       { "tunnelttl",  NEXTARG,        0,              settunnelttl },
        { "pppoedev",   NEXTARG,        0,              setpppoe_dev },
        { "pppoesvc",   NEXTARG,        0,              setpppoe_svc },
        { "-pppoesvc",  1,              0,              setpppoe_svc },

Reply via email to