diff options
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/brconfig.c | 25 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 19 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 5 | ||||
-rw-r--r-- | sbin/ifconfig/ifconfig.h | 3 |
4 files changed, 46 insertions, 6 deletions
diff --git a/sbin/ifconfig/brconfig.c b/sbin/ifconfig/brconfig.c index f6a3d0ef619..4eb8d6cd45d 100644 --- a/sbin/ifconfig/brconfig.c +++ b/sbin/ifconfig/brconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brconfig.c,v 1.32 2023/11/23 03:38:34 dlg Exp $ */ +/* $OpenBSD: brconfig.c,v 1.33 2025/01/06 17:49:29 denis Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -693,6 +693,29 @@ bridge_addendpoint(const char *endpoint, const char *addr) } void +bridge_delendpoint(const char *addr, int d) +{ + struct ifbareq ifba; + struct ether_addr *ea; + int ecode; + + ea = ether_aton(addr); + if (ea == NULL) { + errx(1, "%s -endpoint %s: invalid Ethernet address", + ifname, addr); + } + + memset(&ifba, 0, sizeof(ifba)); + strlcpy(ifba.ifba_name, ifname, sizeof(ifba.ifba_name)); + strlcpy(ifba.ifba_ifsname, ifname, sizeof(ifba.ifba_ifsname)); + memcpy(&ifba.ifba_dst, ea, sizeof(struct ether_addr)); + ifba.ifba_flags = IFBAF_STATIC; + + if (ioctl(sock, SIOCBRDGDADDR, &ifba) == -1) + err(1, "%s -endpoint %s", ifname, addr); +} + +void bridge_addrs(const char *delim, int d) { char dstaddr[NI_MAXHOST]; diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 121bb1e8f75..421c6b29113 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ifconfig.8,v 1.400 2024/06/09 16:25:27 jan Exp $ +.\" $OpenBSD: ifconfig.8,v 1.401 2025/01/06 17:49:29 denis 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: June 9 2024 $ +.Dd $Mdocdate: January 6 2025 $ .Dt IFCONFIG 8 .Os .Sh NAME @@ -1841,6 +1841,7 @@ for a complete list of the available protocols. .Bk -words .Nm ifconfig .Ar tunnel-interface +.Op Oo Fl Oc Ns Cm endpoint Ar dest_address dest_mac .Op Oo Fl Oc Ns Cm keepalive Ar period count .Op Oo Fl Oc Ns Cm parent Ar parent-interface .Op Cm rxprio Ar prio @@ -1867,6 +1868,20 @@ and are all tunnel interfaces. The following options are available: .Bl -tag -width Ds +.It Cm endpoint Ar dest_address dest_mac +When +.Xr vxlan 4 +is in endpoint mode, set the tunnel endpoint +.Ar dest_address +where +.Ar dest_mac +MAC address can be reached. +.It Cm -endpoint Ar dest_mac +When +.Xr vxlan 4 +is in endpoint mode, remove the tunnel endpoint for +.Ar dest_mac +MAC address. .It Cm keepalive Ar period count Enable .Xr gre 4 diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index e3b925fbcd5..4e865668a2b 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.474 2024/06/29 12:09:51 jsg Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.475 2025/01/06 17:49:29 denis Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -578,6 +578,7 @@ const struct cmd { { "flushall", 0, 0, bridge_flushall }, { "static", NEXTARG2, 0, NULL, bridge_addaddr }, { "endpoint", NEXTARG2, 0, NULL, bridge_addendpoint }, + { "-endpoint", NEXTARG, 0, bridge_delendpoint }, { "deladdr", NEXTARG, 0, bridge_deladdr }, { "maxaddr", NEXTARG, 0, bridge_maxaddr }, { "addr", 0, 0, bridge_addrs }, @@ -624,7 +625,7 @@ const struct cmd { { "wgpeer", NEXTARG, A_WIREGUARD, setwgpeer}, { "wgdescription", NEXTARG, A_WIREGUARD, setwgpeerdesc}, { "wgdescr", NEXTARG, A_WIREGUARD, setwgpeerdesc}, - { "wgendpoint", NEXTARG2, A_WIREGUARD, NULL, setwgpeerep}, + { "wgendpoint", NEXTARG2, A_WIREGUARD, NULL, setwgpeerep}, { "wgaip", NEXTARG, A_WIREGUARD, setwgpeeraip}, { "wgpsk", NEXTARG, A_WIREGUARD, setwgpeerpsk}, { "wgpka", NEXTARG, A_WIREGUARD, setwgpeerpka}, diff --git a/sbin/ifconfig/ifconfig.h b/sbin/ifconfig/ifconfig.h index 7df268f46bf..6bc17d56aaf 100644 --- a/sbin/ifconfig/ifconfig.h +++ b/sbin/ifconfig/ifconfig.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.h,v 1.5 2023/11/23 03:38:34 dlg Exp $ */ +/* $OpenBSD: ifconfig.h,v 1.6 2025/01/06 17:49:29 denis Exp $ */ /* * Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org> @@ -49,6 +49,7 @@ void bridge_flush(const char *, int); void bridge_flushall(const char *, int); void bridge_addaddr(const char *, const char *); void bridge_addendpoint(const char *, const char *); +void bridge_delendpoint(const char *, int); void bridge_deladdr(const char *, int); void bridge_maxaddr(const char *, int); void bridge_addrs(const char *, int); |