summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d
diff options
context:
space:
mode:
authorremi <remi@cvs.openbsd.org>2019-12-23 11:25:42 +0000
committerremi <remi@cvs.openbsd.org>2019-12-23 11:25:42 +0000
commita0487c8690ee9a5fc613d126ed008e26f34ec57e (patch)
tree4ebde753358927fe42b1011151de082900641a65 /usr.sbin/ospf6d
parent61bd8c94012f55b4eb8ec420bfa99a24cd88bd48 (diff)
Log a warning when a neighbor changes its address.
Same as ospfd's hello.c rev 1.23. ok denis@
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r--usr.sbin/ospf6d/hello.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.sbin/ospf6d/hello.c b/usr.sbin/ospf6d/hello.c
index 0ba35897213..a2cc1c47859 100644
--- a/usr.sbin/ospf6d/hello.c
+++ b/usr.sbin/ospf6d/hello.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hello.c,v 1.20 2019/12/23 07:33:49 denis Exp $ */
+/* $OpenBSD: hello.c,v 1.21 2019/12/23 11:25:41 remi Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -173,10 +173,16 @@ recv_hello(struct iface *iface, struct in6_addr *src, u_int32_t rtr_id,
nbr->dr.s_addr = hello.d_rtr;
nbr->bdr.s_addr = hello.bd_rtr;
nbr->priority = LSA_24_GETHI(ntohl(hello.opts));
+ /* XXX neighbor address shouldn't be stored on virtual links */
+ nbr->addr = *src;
+ }
+
+ if (!IN6_ARE_ADDR_EQUAL(&nbr->addr, src)) {
+ log_warnx("%s: neighbor ID %s changed its address to %s",
+ __func__, inet_ntoa(nbr->id), log_in6addr(src));
+ nbr->addr = *src;
}
- /* actually the neighbor address shouldn't be stored on virtual links */
- nbr->addr = *src;
nbr->options = opts;
nbr_fsm(nbr, NBR_EVT_HELLO_RCVD);