diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-04-29 12:09:29 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-04-29 12:09:29 +0000 |
commit | 23c1ea05f4ae6acb3e67573d05298993f54af4c0 (patch) | |
tree | 258d8dbc368234429059195e43f9965d0a86d110 /usr.sbin/ldpd/packet.c | |
parent | 84e7323137f5c27bbed25121c0003dcb2e4704e3 (diff) |
Remove some more ospfd-ism from the interface code. This time remove
of most of the IF_TYPE_ special cases and most interface types.
Point-to-point and broadcast still present because of find_iface()
which needs addtional fixing.
OK michele@
Diffstat (limited to 'usr.sbin/ldpd/packet.c')
-rw-r--r-- | usr.sbin/ldpd/packet.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c index 1df9ae4d204..d87bf6a7fdf 100644 --- a/usr.sbin/ldpd/packet.c +++ b/usr.sbin/ldpd/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.8 2010/04/15 15:37:51 claudio Exp $ */ +/* $OpenBSD: packet.c,v 1.9 2010/04/29 12:09:28 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -210,22 +210,12 @@ ldp_hdr_sanity_check(struct ldp_hdr *ldp_hdr, u_int16_t len, { struct in_addr addr; - if (iface->type != IF_TYPE_VIRTUALLINK) { - if (ldp_hdr->lspace_id != iface->lspace_id) { - addr.s_addr = ldp_hdr->lspace_id; - log_debug("ldp_hdr_sanity_check: invalid label space " - "ID %s, interface %s", inet_ntoa(addr), - iface->name); - return (-1); - } - } else { - if (ldp_hdr->lspace_id != 0) { - addr.s_addr = ldp_hdr->lspace_id; - log_debug("ldp_hdr_sanity_check: invalid label space " - "ID %s, interface %s", inet_ntoa(addr), - iface->name); - return (-1); - } + if (ldp_hdr->lspace_id != iface->lspace_id) { + addr.s_addr = ldp_hdr->lspace_id; + log_debug("ldp_hdr_sanity_check: invalid label space " + "ID %s, interface %s", inet_ntoa(addr), + iface->name); + return (-1); } return (ntohs(ldp_hdr->length)); @@ -239,11 +229,6 @@ find_iface(struct ldpd_conf *xconf, unsigned int ifindex, struct in_addr src) /* returned interface needs to be active */ LIST_FOREACH(iface, &xconf->iface_list, entry) { switch (iface->type) { - case IF_TYPE_VIRTUALLINK: - if ((src.s_addr == iface->dst.s_addr) && - !iface->passive) - return (iface); - break; case IF_TYPE_POINTOPOINT: if (ifindex == iface->ifindex && iface->dst.s_addr == src.s_addr && @@ -482,11 +467,6 @@ session_find_iface(struct ldpd_conf *xconf, struct in_addr src) /* returned interface needs to be active */ LIST_FOREACH(iface, &xconf->iface_list, entry) { switch (iface->type) { - case IF_TYPE_VIRTUALLINK: - if ((src.s_addr == iface->dst.s_addr) && - !iface->passive) - return (iface); - break; case IF_TYPE_POINTOPOINT: if (iface->dst.s_addr == src.s_addr && !iface->passive) |