diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2013-06-01 18:35:03 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2013-06-01 18:35:03 +0000 |
commit | 204316bee57f022dea637a9d94567f3c852d1131 (patch) | |
tree | 8d284d4c9cc54e5b19e12208df2eaead208df97a /usr.sbin | |
parent | 12ce88afbc54312fc23d8fe50736b79d3ef0c947 (diff) |
Drop support for passive interfaces.
Support for passive interfaces was inherited from ospfd but it doesn't
make any sense at all for ldpd.
Diff from Renato Westphal
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ldpd/address.c | 8 | ||||
-rw-r--r-- | usr.sbin/ldpd/hello.c | 5 | ||||
-rw-r--r-- | usr.sbin/ldpd/init.c | 5 | ||||
-rw-r--r-- | usr.sbin/ldpd/interface.c | 3 | ||||
-rw-r--r-- | usr.sbin/ldpd/keepalive.c | 5 | ||||
-rw-r--r-- | usr.sbin/ldpd/labelmapping.c | 17 | ||||
-rw-r--r-- | usr.sbin/ldpd/ldpd.conf.5 | 32 | ||||
-rw-r--r-- | usr.sbin/ldpd/ldpd.h | 4 | ||||
-rw-r--r-- | usr.sbin/ldpd/notification.c | 5 | ||||
-rw-r--r-- | usr.sbin/ldpd/packet.c | 8 | ||||
-rw-r--r-- | usr.sbin/ldpd/parse.y | 13 | ||||
-rw-r--r-- | usr.sbin/ldpd/printconf.c | 4 |
12 files changed, 31 insertions, 78 deletions
diff --git a/usr.sbin/ldpd/address.c b/usr.sbin/ldpd/address.c index 0c456e91827..1ea0e129331 100644 --- a/usr.sbin/ldpd/address.c +++ b/usr.sbin/ldpd/address.c @@ -1,4 +1,4 @@ -/* $OpenBSD: address.c,v 1.6 2010/11/04 09:52:16 claudio Exp $ */ +/* $OpenBSD: address.c,v 1.7 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -48,9 +48,6 @@ send_address(struct nbr *nbr, struct iface *iface) struct iface *niface; u_int16_t size, iface_count = 0; - if (nbr->iface->passive) - return; - log_debug("send_address: neighbor ID %s", inet_ntoa(nbr->id)); if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) @@ -176,9 +173,6 @@ send_address_withdraw(struct nbr *nbr, struct iface *iface) struct ibuf *buf; u_int16_t size; - if (nbr->iface->passive) - return; - log_debug("send_address_withdraw: neighbor ID %s", inet_ntoa(nbr->id)); if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) diff --git a/usr.sbin/ldpd/hello.c b/usr.sbin/ldpd/hello.c index d56905d3de9..1262bb7b060 100644 --- a/usr.sbin/ldpd/hello.c +++ b/usr.sbin/ldpd/hello.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hello.c,v 1.15 2013/06/01 01:34:56 claudio Exp $ */ +/* $OpenBSD: hello.c,v 1.16 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -54,9 +54,6 @@ send_hello(struct iface *iface) dst.sin_len = sizeof(struct sockaddr_in); inet_aton(AllRouters, &dst.sin_addr); - if (iface->passive) - return (0); - if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) fatal("send_hello"); diff --git a/usr.sbin/ldpd/init.c b/usr.sbin/ldpd/init.c index 121ac201073..11ad2280470 100644 --- a/usr.sbin/ldpd/init.c +++ b/usr.sbin/ldpd/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.7 2011/01/10 12:02:48 claudio Exp $ */ +/* $OpenBSD: init.c,v 1.8 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -46,9 +46,6 @@ send_init(struct nbr *nbr) struct ibuf *buf; u_int16_t size; - if (nbr->iface->passive) - return; - log_debug("send_init: neighbor ID %s", inet_ntoa(nbr->id)); if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) diff --git a/usr.sbin/ldpd/interface.c b/usr.sbin/ldpd/interface.c index 480e13bdb29..fa875dd2082 100644 --- a/usr.sbin/ldpd/interface.c +++ b/usr.sbin/ldpd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.12 2013/06/01 18:26:40 claudio Exp $ */ +/* $OpenBSD: interface.c,v 1.13 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org> @@ -279,7 +279,6 @@ if_to_ctl(struct iface *iface) ictl.linkstate = iface->linkstate; ictl.mediatype = iface->media_type; ictl.priority = iface->priority; - ictl.passive = iface->passive; gettimeofday(&now, NULL); if (evtimer_pending(&iface->hello_timer, &tv)) { diff --git a/usr.sbin/ldpd/keepalive.c b/usr.sbin/ldpd/keepalive.c index 933e3093aaf..dce3c1166fb 100644 --- a/usr.sbin/ldpd/keepalive.c +++ b/usr.sbin/ldpd/keepalive.c @@ -1,4 +1,4 @@ -/* $OpenBSD: keepalive.c,v 1.7 2010/11/04 09:52:16 claudio Exp $ */ +/* $OpenBSD: keepalive.c,v 1.8 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -43,9 +43,6 @@ send_keepalive(struct nbr *nbr) struct ibuf *buf; u_int16_t size; - if (nbr->iface->passive) - return; - if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) fatal("send_keepalive"); diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c index b099bec2852..c9b43ee89fe 100644 --- a/usr.sbin/ldpd/labelmapping.c +++ b/usr.sbin/ldpd/labelmapping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: labelmapping.c,v 1.19 2011/01/10 11:52:04 claudio Exp $ */ +/* $OpenBSD: labelmapping.c,v 1.20 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -56,9 +56,6 @@ send_labelmapping(struct nbr *nbr) struct ldp_hdr *ldp_hdr; u_int16_t tlv_size, size; - if (nbr->iface->passive) - return; - if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) fatal("send_labelmapping"); @@ -170,9 +167,6 @@ send_labelrequest(struct nbr *nbr) struct ldp_hdr *ldp_hdr; u_int16_t tlv_size, size; - if (nbr->iface->passive) - return; - if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) fatal("send_labelrequest"); @@ -267,9 +261,6 @@ send_labelwithdraw(struct nbr *nbr) struct ldp_hdr *ldp_hdr; u_int16_t tlv_size, size; - if (nbr->iface->passive) - return; - if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) fatal("send_labelwithdraw"); @@ -408,9 +399,6 @@ send_labelrelease(struct nbr *nbr) struct ldp_hdr *ldp_hdr; u_int16_t tlv_size, size; - if (nbr->iface->passive) - return; - if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) fatal("send_labelrelease"); @@ -546,9 +534,6 @@ send_labelabortreq(struct nbr *nbr) struct ibuf *buf; u_int16_t size; - if (nbr->iface->passive) - return; - if ((buf = ibuf_open(LDP_MAX_LEN)) == NULL) fatal("send_labelabortreq"); diff --git a/usr.sbin/ldpd/ldpd.conf.5 b/usr.sbin/ldpd/ldpd.conf.5 index 4d1b548c915..8a78c4fcf6c 100644 --- a/usr.sbin/ldpd/ldpd.conf.5 +++ b/usr.sbin/ldpd/ldpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ldpd.conf.5,v 1.8 2012/08/29 20:15:19 jmc Exp $ +.\" $OpenBSD: ldpd.conf.5,v 1.9 2013/06/01 18:35:02 claudio Exp $ .\" .\" Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> .\" Copyright (c) 2005, 2006 Esben Norby <norby@openbsd.org> @@ -18,7 +18,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: August 29 2012 $ +.Dd $Mdocdate: June 1 2013 $ .Dt LDPD.CONF 5 .Os .Sh NAME @@ -62,7 +62,8 @@ interface em0 { } .Ed .Sh GLOBAL CONFIGURATION -Global settings concerns the main behaviour of the daemon. +All interface related settings can be configured globally and per interface. +The only settings that can be set globally and not overruled are listed below. .Pp .Bl -tag -width Ds -compact .It Xo @@ -83,18 +84,6 @@ Set the router ID; in combination with labelspace it forms the LSR-ID. Set the label space advertised by .Xr ldpd 8 . .Pp -.It Ic holdtime Ar seconds -Set the hello holdtime in seconds. -The maximum time -.Xr ldpd 8 -will wait between two consecutive hello messages from a peer before it is -marked as being down. -The default value is 15. -.Pp -.It Ic hello-interval Ar seconds -Set the hello interval in seconds. -The default value is 5; valid range is 1\-65535. -.Pp .It Ic keepalive Ar seconds Set the keepalive interval in seconds. The default value is 180; valid range is 1\-65535. @@ -142,8 +131,17 @@ interface em0 { .Pp Interface-specific parameters are listed below. .Bl -tag -width Ds -.It Ic passive -Prevent transmission and reception of LDP packets on this interface. +.It Ic holdtime Ar seconds +Set the hello holdtime in seconds. +The maximum time +.Xr ldpd 8 +will wait between two consecutive hello messages from a peer before it is +marked as being down. +The default value is 15. +.Pp +.It Ic hello-interval Ar seconds +Set the hello interval in seconds. +The default value is 5; valid range is 1\-65535. .El .Sh FILES .Bl -tag -width "/etc/ldpd.conf" -compact diff --git a/usr.sbin/ldpd/ldpd.h b/usr.sbin/ldpd/ldpd.h index 9ac07a6d46e..516a33f86e5 100644 --- a/usr.sbin/ldpd/ldpd.h +++ b/usr.sbin/ldpd/ldpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpd.h,v 1.32 2013/06/01 18:26:40 claudio Exp $ */ +/* $OpenBSD: ldpd.h,v 1.33 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -220,7 +220,6 @@ struct iface { u_int8_t media_type; u_int8_t linkstate; u_int8_t priority; - u_int8_t passive; }; /* ldp_conf */ @@ -313,7 +312,6 @@ struct ctl_iface { u_int8_t linkstate; u_int8_t mediatype; u_int8_t priority; - u_int8_t passive; }; struct ctl_nbr { diff --git a/usr.sbin/ldpd/notification.c b/usr.sbin/ldpd/notification.c index d7f763a1cd2..454584240b9 100644 --- a/usr.sbin/ldpd/notification.c +++ b/usr.sbin/ldpd/notification.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notification.c,v 1.9 2011/01/20 23:12:33 jasper Exp $ */ +/* $OpenBSD: notification.c,v 1.10 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -45,9 +45,6 @@ send_notification_nbr(struct nbr *nbr, u_int32_t status, u_int32_t msgid, { struct ibuf *buf; - if (nbr->iface->passive) - return; - buf = send_notification(status, nbr->iface, msgid, type); evbuf_enqueue(&nbr->wbuf, buf); } diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c index 9e5b8bdc96b..f32a807647e 100644 --- a/usr.sbin/ldpd/packet.c +++ b/usr.sbin/ldpd/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.21 2013/06/01 18:24:28 claudio Exp $ */ +/* $OpenBSD: packet.c,v 1.22 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -233,15 +233,13 @@ find_iface(struct ldpd_conf *xconf, unsigned int ifindex, struct in_addr src) switch (iface->type) { case IF_TYPE_POINTOPOINT: if (ifindex == iface->ifindex && - iface->dst.s_addr == src.s_addr && - !iface->passive) + iface->dst.s_addr == src.s_addr) return (iface); break; default: if (ifindex == iface->ifindex && (iface->addr.s_addr & iface->mask.s_addr) == - (src.s_addr & iface->mask.s_addr) && - !iface->passive) + (src.s_addr & iface->mask.s_addr)) return (iface); break; } diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y index deed3756bd6..29b429b51c1 100644 --- a/usr.sbin/ldpd/parse.y +++ b/usr.sbin/ldpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.11 2013/06/01 18:30:32 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.12 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org> @@ -112,7 +112,7 @@ typedef struct { %token LSPACE INTERFACE ROUTERID FIBUPDATE %token HOLDTIME HELLOINTERVAL KEEPALIVE %token DISTRIBUTION RETENTION ADVERTISEMENT -%token EXTTAG PASSIVE +%token EXTTAG %token HELLOINTERVAL %token YES NO %token ERROR @@ -313,12 +313,8 @@ interface_block : '{' optnl interfaceopts_l '}' | /* nothing */ ; -interfaceopts_l : interfaceopts_l interfaceoptsl nl - | interfaceoptsl optnl - ; - -interfaceoptsl : PASSIVE { iface->passive = 1; } - | defaults +interfaceopts_l : interfaceopts_l defaults nl + | defaults optnl ; %% @@ -364,7 +360,6 @@ lookup(char *s) {"interface", INTERFACE}, {"keepalive", KEEPALIVE}, {"labelspace", LSPACE}, - {"passive", PASSIVE}, {"retention", RETENTION}, {"router-id", ROUTERID}, {"yes", YES} diff --git a/usr.sbin/ldpd/printconf.c b/usr.sbin/ldpd/printconf.c index f9833380cda..3cfbcda0e13 100644 --- a/usr.sbin/ldpd/printconf.c +++ b/usr.sbin/ldpd/printconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printconf.c,v 1.3 2010/05/25 13:29:45 claudio Exp $ */ +/* $OpenBSD: printconf.c,v 1.4 2013/06/01 18:35:02 claudio Exp $ */ /* * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org> @@ -58,8 +58,6 @@ print_iface(struct iface *iface) printf("\ninterface %s {\n", iface->name); printf("\tholdtime %d\n", iface->holdtime); printf("\thello-interval %d\n", iface->hello_interval); - if (iface->passive) - printf("\tpassive\n"); printf("}\n"); } |