summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2010-12-13 13:43:38 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2010-12-13 13:43:38 +0000
commitb0df33e6be664a058d2ab847721047a6d38aeefb (patch)
tree5d237ba99b4aef1d846ab5cba7afb7ff3205a1f3
parent6f34bebf1bae9862f0956f8da54378c6d095eb20 (diff)
Do not use a carp address as ospf router id because it is not unique.
ok claudio@
-rw-r--r--usr.sbin/ospf6d/parse.y4
-rw-r--r--usr.sbin/ospfd/parse.y4
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/ospf6d/parse.y b/usr.sbin/ospf6d/parse.y
index f1cca75a3db..7afae43a814 100644
--- a/usr.sbin/ospf6d/parse.y
+++ b/usr.sbin/ospf6d/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.19 2010/08/22 21:15:25 bluhm Exp $ */
+/* $OpenBSD: parse.y,v 1.20 2010/12/13 13:43:37 bluhm Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -1042,6 +1042,8 @@ get_rtr_id(void)
fatal("getifaddrs");
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+ if (strncmp(ifa->ifa_name, "carp", 4) == 0)
+ continue;
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
cur = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr;
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y
index 01f91be2a01..f329acc620d 100644
--- a/usr.sbin/ospfd/parse.y
+++ b/usr.sbin/ospfd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.72 2010/08/03 18:42:41 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.73 2010/12/13 13:43:37 bluhm Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -1270,6 +1270,8 @@ get_rtr_id(void)
fatal("getifaddrs");
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
+ if (strncmp(ifa->ifa_name, "carp", 4) == 0)
+ continue;
if (ifa->ifa_addr->sa_family != AF_INET)
continue;
cur = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr;