diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2009-01-03 00:18:52 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2009-01-03 00:18:52 +0000 |
commit | 1a4470b69096b9c76b4484f00a41f0286e0d6870 (patch) | |
tree | 55e2c64d03d2f0d1966045012c4b110da70ac3c2 /usr.sbin/ospf6d | |
parent | b845c006faaee044b45b2935b605066c47c01c64 (diff) |
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')
-rw-r--r-- | usr.sbin/ospf6d/ospfe.c | 21 |
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), |