summaryrefslogtreecommitdiff
path: root/sbin/ifconfig/brconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/ifconfig/brconfig.c')
-rw-r--r--sbin/ifconfig/brconfig.c25
1 files changed, 24 insertions, 1 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];