summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ospf6d/ospfe.c17
-rw-r--r--usr.sbin/ospf6d/ospfe.h3
2 files changed, 17 insertions, 3 deletions
diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c
index 770f4768d48..f90cc3b9192 100644
--- a/usr.sbin/ospf6d/ospfe.c
+++ b/usr.sbin/ospf6d/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.32 2010/07/06 13:15:32 bluhm Exp $ */
+/* $OpenBSD: ospfe.c,v 1.33 2010/08/22 20:27:52 bluhm Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -424,6 +424,7 @@ void
ospfe_dispatch_rde(int fd, short event, void *bula)
{
struct lsa_hdr lsa_hdr;
+ struct lsa_link lsa_link;
struct imsgev *iev = bula;
struct imsgbuf *ibuf = &iev->ibuf;
struct nbr *nbr;
@@ -525,6 +526,18 @@ ospfe_dispatch_rde(int fd, short event, void *bula)
}
} else if (lsa_hdr.type == htons(LSA_TYPE_LINK)) {
/*
+ * Save link-LSA options of neighbor.
+ * This is needed to originate network-LSA.
+ */
+ if (l - sizeof(lsa_hdr) < sizeof(lsa_link))
+ fatalx("ospfe_dispatch_rde: "
+ "bad imsg link size");
+ memcpy(&lsa_link, (char *)imsg.data +
+ sizeof(lsa_hdr), sizeof(lsa_link));
+ nbr->link_options = lsa_link.opts &
+ htonl(LSA_24_MASK);
+
+ /*
* flood on interface only
*/
noack += lsa_flood(nbr->iface, nbr,
@@ -967,7 +980,7 @@ orig_net_lsa(struct iface *iface)
if (nbr->state & NBR_STA_FULL) {
if (ibuf_add(buf, &nbr->id, sizeof(nbr->id)))
fatal("orig_net_lsa: ibuf_add failed");
- lsa_net.opts |= nbr->options;
+ lsa_net.opts |= nbr->link_options;
num_rtr++;
}
diff --git a/usr.sbin/ospf6d/ospfe.h b/usr.sbin/ospf6d/ospfe.h
index cce785d2657..3c4ebcca9d3 100644
--- a/usr.sbin/ospf6d/ospfe.h
+++ b/usr.sbin/ospf6d/ospfe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.h,v 1.16 2010/05/26 13:56:08 nicm Exp $ */
+/* $OpenBSD: ospfe.h,v 1.17 2010/08/22 20:27:52 bluhm Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -85,6 +85,7 @@ struct nbr {
u_int32_t ls_ret_cnt;
u_int32_t options;
u_int32_t last_rx_options;
+ u_int32_t link_options; /* options from link-LSA */
time_t uptime;
int state;