diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2008-12-28 17:56:17 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2008-12-28 17:56:17 +0000 |
commit | b6e5d760f9a8b5c340e827e8afd205a642367933 (patch) | |
tree | 373fcfba48d8aa2616e483815cf1f36bc417f64f /usr.sbin/ospf6d | |
parent | 06bfb4ec5a249fc20c46245bcd509d79d48cbb4a (diff) |
Send the interface index in the correct byte order and add iface_id to
struct nbr to identify the neighbors correclty.
From Stefan Sperling stsp (at) stsp.name
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r-- | usr.sbin/ospf6d/hello.c | 5 | ||||
-rw-r--r-- | usr.sbin/ospf6d/neighbor.c | 4 | ||||
-rw-r--r-- | usr.sbin/ospf6d/ospfe.h | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/ospf6d/hello.c b/usr.sbin/ospf6d/hello.c index 3face36474d..b4037c5ba5a 100644 --- a/usr.sbin/ospf6d/hello.c +++ b/usr.sbin/ospf6d/hello.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hello.c,v 1.9 2007/12/13 08:54:05 claudio Exp $ */ +/* $OpenBSD: hello.c,v 1.10 2008/12/28 17:56:16 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -71,7 +71,7 @@ send_hello(struct iface *iface) goto fail; /* hello header */ - hello.iface_id = iface->ifindex; + hello.iface_id = htonl(iface->ifindex); hello.rtr_priority = iface->priority; opts = ntohl(area_ospf_options(area_find(oeconf, iface->area_id))); @@ -220,6 +220,7 @@ 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 = hello.rtr_priority; + nbr->iface_id = ntohl(hello.iface_id); return; } diff --git a/usr.sbin/ospf6d/neighbor.c b/usr.sbin/ospf6d/neighbor.c index 51b67596021..5de16fa99a3 100644 --- a/usr.sbin/ospf6d/neighbor.c +++ b/usr.sbin/ospf6d/neighbor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: neighbor.c,v 1.6 2008/02/11 13:48:39 norby Exp $ */ +/* $OpenBSD: neighbor.c,v 1.7 2008/12/28 17:56:16 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -301,9 +301,9 @@ nbr_new(u_int32_t nbr_id, struct iface *iface, int self) if (self) { nbr->state = NBR_STA_FULL; -//XXX nbr->addr.s_addr = iface->addr.s_addr; nbr->addr = iface->addr; nbr->priority = iface->priority; + nbr->iface_id = iface->ifindex; } /* set event structures */ diff --git a/usr.sbin/ospf6d/ospfe.h b/usr.sbin/ospf6d/ospfe.h index 0a7b8100f18..5f4eb8316c1 100644 --- a/usr.sbin/ospf6d/ospfe.h +++ b/usr.sbin/ospf6d/ospfe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ospfe.h,v 1.9 2007/12/13 08:54:05 claudio Exp $ */ +/* $OpenBSD: ospfe.h,v 1.10 2008/12/28 17:56:16 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org> @@ -77,6 +77,7 @@ struct nbr { struct lsa_entry *ls_req; struct lsa_entry *dd_end; + u_int32_t iface_id; /* id of neighbor's iface */ u_int32_t dd_seq_num; u_int32_t dd_pending; u_int32_t peerid; /* unique ID in DB */ |