summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2009-01-02 21:05:27 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2009-01-02 21:05:27 +0000
commitf675bf6a17fb7c9e06650f0e0c1f761ddd6023c7 (patch)
tree717d9c07a196977bc77c26c9e1bff40d63935814 /usr.sbin
parentc4dd4bbc5be11c4a117feb00e408dff90767e512 (diff)
Add support for originating router LSAs over point-to-point links.
OK claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospf6d/ospfe.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c
index e1b43daf6e5..8a685d62aba 100644
--- a/usr.sbin/ospf6d/ospfe.c
+++ b/usr.sbin/ospf6d/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.15 2008/12/30 22:51:52 claudio Exp $ */
+/* $OpenBSD: ospfe.c,v 1.16 2009/01/02 21:05:26 stsp Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -735,45 +735,23 @@ orig_rtr_lsa_area(struct area *area)
bzero(&rtr_link, sizeof(rtr_link));
switch (iface->type) {
-#if 0 /* TODO pointtopoint */
case IF_TYPE_POINTOPOINT:
LIST_FOREACH(nbr, &iface->nbr_list, entry)
if (nbr != iface->self &&
nbr->state & NBR_STA_FULL)
break;
- if (nbr) {
+ if (nbr && iface->state & IF_STA_POINTTOPOINT) {
log_debug("orig_rtr_lsa: point-to-point, "
"interface %s", iface->name);
- rtr_link.id = nbr->id.s_addr;
-//XXX rtr_link.data = iface->addr.s_addr;
rtr_link.type = LINK_TYPE_POINTTOPOINT;
- /* RFC 3137: stub router support */
- if (oeconf->flags & OSPFD_FLAG_STUB_ROUTER ||
- oe_nofib)
- rtr_link.metric = 0xffff;
- else
- rtr_link.metric = htons(iface->metric);
- if (buf_add(buf, &rtr_link, sizeof(rtr_link)))
- fatalx("orig_rtr_lsa: buf_add failed");
- }
- if (iface->state & IF_STA_POINTTOPOINT) {
- log_debug("orig_rtr_lsa: stub net, "
- "interface %s", iface->name);
- bzero(&rtr_link, sizeof(rtr_link));
- if (nbr) {
-//XXX rtr_link.id = nbr->addr.s_addr;
- rtr_link.data = 0xffffffff;
- } else {
-//XXX rtr_link.id = iface->addr.s_addr;
-//XXX rtr_link.data = iface->mask.s_addr;
- }
- rtr_link.type = LINK_TYPE_STUB_NET;
rtr_link.metric = htons(iface->metric);
+ rtr_link.iface_id = htonl(iface->ifindex);
+ rtr_link.nbr_iface_id = htonl(nbr->iface_id);
+ rtr_link.nbr_rtr_id = nbr->id.s_addr;
if (buf_add(buf, &rtr_link, sizeof(rtr_link)))
fatalx("orig_rtr_lsa: buf_add failed");
}
continue;
-#endif /* pointtopoint */
case IF_TYPE_BROADCAST:
case IF_TYPE_NBMA:
if ((iface->state & IF_STA_MULTI)) {