diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2009-02-03 14:06:19 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2009-02-03 14:06:19 +0000 |
commit | a2e74a5bafb0f621d5594974ef3b54ebca27e117 (patch) | |
tree | 934374f97cc84b241fc8fc7b1cae536a838b55d3 | |
parent | e1169461a59f4f3635d938d7ca5220682b28024e (diff) |
We don't need anything other than link-local addresses and
global-scope prefixes in iface->ifa_list.
ok claudio@
-rw-r--r-- | usr.sbin/ospf6d/kroute.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/usr.sbin/ospf6d/kroute.c b/usr.sbin/ospf6d/kroute.c index e5a78cc69b6..3e70660467f 100644 --- a/usr.sbin/ospf6d/kroute.c +++ b/usr.sbin/ospf6d/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.9 2009/01/04 18:20:22 stsp Exp $ */ +/* $OpenBSD: kroute.c,v 1.10 2009/02/03 14:06:18 stsp Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -838,9 +838,18 @@ if_newaddr(u_short ifindex, struct sockaddr_in6 *ifa, struct sockaddr_in6 *mask, log_warnx("if_newaddr: corresponding if %i not found", ifindex); return; } + + /* We only care about link-local and global-scope. */ + if (IN6_IS_ADDR_UNSPECIFIED(&ifa->sin6_addr) || + IN6_IS_ADDR_LOOPBACK(&ifa->sin6_addr) || + IN6_IS_ADDR_MULTICAST(&ifa->sin6_addr) || + IN6_IS_ADDR_SITELOCAL(&ifa->sin6_addr) || + IN6_IS_ADDR_V4MAPPED(&ifa->sin6_addr) || + IN6_IS_ADDR_V4COMPAT(&ifa->sin6_addr)) + return; + /* XXX thanks, KAME, for this ugliness... adopted from route/show.c */ - if (IN6_IS_ADDR_LINKLOCAL(&ifa->sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&ifa->sin6_addr)) { + if (IN6_IS_ADDR_LINKLOCAL(&ifa->sin6_addr)) { ifa->sin6_addr.s6_addr[2] = 0; ifa->sin6_addr.s6_addr[3] = 0; } |