summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospf6d/ospfe.c
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2009-01-03 00:18:51 +0000
committerstsp <stsp@openbsd.org>2009-01-03 00:18:51 +0000
commit412b2c531bd7c95e35386f684a137e0ad599665f (patch)
tree90a5f2944db7e847dec6686602a495e577666a96 /usr.sbin/ospf6d/ospfe.c
parent- get rid of the function that was mostly just a wrapper for the old (diff)
downloadwireguard-openbsd-412b2c531bd7c95e35386f684a137e0ad599665f.tar.xz
wireguard-openbsd-412b2c531bd7c95e35386f684a137e0ad599665f.zip
orig_link_lsa() was assuming either virtual or broadcast link.
Make it handle other types of links, too. ok claudio@
Diffstat (limited to 'usr.sbin/ospf6d/ospfe.c')
-rw-r--r--usr.sbin/ospf6d/ospfe.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c
index 8a685d62aba..57b18def3db 100644
--- a/usr.sbin/ospf6d/ospfe.c
+++ b/usr.sbin/ospf6d/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.16 2009/01/02 21:05:26 stsp Exp $ */
+/* $OpenBSD: ospfe.c,v 1.17 2009/01/03 00:18:51 stsp Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -979,11 +979,22 @@ orig_link_lsa(struct iface *iface)
log_debug("orig_link_lsa: interface %s", iface->name);
- if (iface->type == IF_TYPE_VIRTUALLINK)
- return;
-
- if ((iface->state & IF_STA_MULTI) == 0)
+ switch (iface->type) {
+ case IF_TYPE_VIRTUALLINK: /* forbidden by rfc5340 */
return;
+ case IF_TYPE_BROADCAST:
+ case IF_TYPE_NBMA:
+ if ((iface->state & IF_STA_MULTI) == 0)
+ return;
+ break;
+ case IF_TYPE_POINTOPOINT:
+ case IF_TYPE_POINTOMULTIPOINT:
+ if ((iface->state & IF_STA_POINTTOPOINT) == 0)
+ return;
+ break;
+ default:
+ fatalx("orig_link_lsa: unknown interface type");
+ }
/* XXX READ_BUF_SIZE */
if ((buf = buf_dynamic(sizeof(lsa_hdr) + sizeof(lsa_link),