diff options
author | akoshibe <akoshibe@cvs.openbsd.org> | 2018-04-26 06:58:51 +0000 |
---|---|---|
committer | akoshibe <akoshibe@cvs.openbsd.org> | 2018-04-26 06:58:51 +0000 |
commit | 697a1a979a5c4e69221e5c3abc11de59996b9a57 (patch) | |
tree | ce791f06020962235ef8178d9dc539450dbe9433 /sbin | |
parent | e104457a21985bfcb9e4822e3df915cc50925351 (diff) |
Add a '-tunneldomain' ifconfig(8) option as shorthand for 'tunneldomain 0'
to be consistent with the '-rdomain' option.
Suggested by dlg
OK benno, jca, kn, phessler, jmc
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 16 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 13 |
2 files changed, 21 insertions, 8 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 9d73a53b939..aea53873019 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ifconfig.8,v 1.305 2018/03/16 19:45:13 benno Exp $ +.\" $OpenBSD: ifconfig.8,v 1.306 2018/04/26 06:58:50 akoshibe Exp $ .\" $NetBSD: ifconfig.8,v 1.11 1996/01/04 21:27:29 pk Exp $ .\" $FreeBSD: ifconfig.8,v 1.16 1998/02/01 07:03:29 steve Exp $ .\" @@ -31,7 +31,7 @@ .\" .\" @(#)ifconfig.8 8.4 (Berkeley) 6/1/94 .\" -.Dd $Mdocdate: March 16 2018 $ +.Dd $Mdocdate: April 26 2018 $ .Dt IFCONFIG 8 .Os .Sh NAME @@ -1613,8 +1613,8 @@ for a complete list of the available protocols. .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 @@ -1658,6 +1658,10 @@ The optional destination port can be specified for interfaces such as 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 @@ -1667,10 +1671,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, diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 993a1ed32c8..01924216c35 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.362 2018/02/27 22:32:26 dlg Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.363 2018/04/26 06:58:50 akoshibe Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -203,6 +203,7 @@ void settunnel(const char *, const char *); void settunneladdr(const char *, int); 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); @@ -459,6 +460,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 }, @@ -3368,6 +3370,15 @@ settunnelinst(const char *id, int param) } 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"); +} + +void settunnelttl(const char *id, int param) { const char *errmsg = NULL; |