summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2010-02-08 17:21:37 +0000
committerclaudio <claudio@openbsd.org>2010-02-08 17:21:37 +0000
commitf4f4a2146e3a743654dcdf128f523e44dc9bfccf (patch)
treebd2079c7799edf1c40209e97da9cf4cc3ef046a5
parentfix BBP R82 for RT3572 (diff)
downloadwireguard-openbsd-f4f4a2146e3a743654dcdf128f523e44dc9bfccf.tar.xz
wireguard-openbsd-f4f4a2146e3a743654dcdf128f523e44dc9bfccf.zip
Unbreak IPv6 local address lookups. Some idiot aka me optimised a loop and
because of that either the IPv4 or IPv6 local address was not set. Because of this prefixes were sent out with all zero nexthops.
-rw-r--r--usr.sbin/bgpd/rde.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index d7df9a912d7..10b470aecc0 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.285 2010/02/08 17:16:36 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.286 2010/02/08 17:21:37 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -2822,7 +2822,10 @@ peer_localaddrs(struct rde_peer *peer, struct bgpd_addr *laddr)
ifa = match;
sa2addr(ifa->ifa_addr, &peer->local_v4_addr);
break;
- } else if (ifa->ifa_addr->sa_family == AF_INET6 &&
+ }
+ }
+ for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) {
+ if (ifa->ifa_addr->sa_family == AF_INET6 &&
strcmp(ifa->ifa_name, match->ifa_name) == 0) {
/*
* only accept global scope addresses except explicitly