summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-02-08 17:21:38 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-02-08 17:21:38 +0000
commit4c5f4f3a54802746721b1302af392f79896f845e (patch)
tree44340089c9d6c7609bfd5db8f9997175de220a94 /usr.sbin/bgpd
parentea0670e8c77837685819b0fbebd840c505843384 (diff)
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.
Diffstat (limited to 'usr.sbin/bgpd')
-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