summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2021-01-12 09:11:09 +0000
committerclaudio <claudio@openbsd.org>2021-01-12 09:11:09 +0000
commitb3a8ee7d52f9d444a877733ba496d023a83606bf (patch)
tree4f40fa7ab668a2987c61eb15fe5f4265d9e4eb38
parentTotally rework the exabgp integration tests. Instead of a simple shell (diff)
downloadwireguard-openbsd-b3a8ee7d52f9d444a877733ba496d023a83606bf.tar.xz
wireguard-openbsd-b3a8ee7d52f9d444a877733ba496d023a83606bf.zip
Use the interface index of struct ip_mreqn in IP_ADD_MEMBERSHIP to send
out packets. This way ospfd can work on interfaces that share the same IP. OK dlg@
-rw-r--r--usr.sbin/ospfd/interface.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c
index 7911f05bb38..9d63869546e 100644
--- a/usr.sbin/ospfd/interface.c
+++ b/usr.sbin/ospfd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.84 2020/11/02 00:30:56 dlg Exp $ */
+/* $OpenBSD: interface.c,v 1.85 2021/01/12 09:11:09 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -711,7 +711,7 @@ LIST_HEAD(,if_group_count) ifglist = LIST_HEAD_INITIALIZER(ifglist);
int
if_join_group(struct iface *iface, struct in_addr *addr)
{
- struct ip_mreq mreq;
+ struct ip_mreqn mreq;
struct if_group_count *ifg;
switch (iface->type) {
@@ -734,7 +734,7 @@ if_join_group(struct iface *iface, struct in_addr *addr)
return (0);
mreq.imr_multiaddr.s_addr = addr->s_addr;
- mreq.imr_interface.s_addr = iface->addr.s_addr;
+ mreq.imr_ifindex = iface->ifindex;
if (setsockopt(iface->fd, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(void *)&mreq, sizeof(mreq)) == -1) {
@@ -760,7 +760,7 @@ if_join_group(struct iface *iface, struct in_addr *addr)
int
if_leave_group(struct iface *iface, struct in_addr *addr)
{
- struct ip_mreq mreq;
+ struct ip_mreqn mreq;
struct if_group_count *ifg;
switch (iface->type) {
@@ -782,7 +782,7 @@ if_leave_group(struct iface *iface, struct in_addr *addr)
}
mreq.imr_multiaddr.s_addr = addr->s_addr;
- mreq.imr_interface.s_addr = iface->addr.s_addr;
+ mreq.imr_ifindex = iface->ifindex;
if (setsockopt(iface->fd, IPPROTO_IP, IP_DROP_MEMBERSHIP,
(void *)&mreq, sizeof(mreq)) == -1) {