summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2015-07-19 20:50:04 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2015-07-19 20:50:04 +0000
commitd5090c4ffd20eb040b8d194bf803318547553814 (patch)
treedcb46f24bb46f4e4bd6d2ee7e5431170c3e1b675
parentffbfe414eda6b8ccf1c7ce4e6577af21b67eaeb8 (diff)
Remove incomplete support for unnecessary modes of operation.
LDP has several modes of operation, it was designed in that way so it could run on legacy equipment like ATM/FR switches with very strict memory limitations. For modern hardware there's no point on using either the "Conservative Label Retention" or "Downstream On Demand" modes of operation since they save memory at cost of blackholing traffic when routing changes. Major vendors implement only the "Liberal Label Retention" and "Downstream Unsolicited" modes for non ATM/FR hardware. Let's do that too. As for using either "Independent Control" or "Ordered Control", let's stick with the first option mainly because it's easier to implement and because it doesn't really matter which control mode is used. For reference, Cisco implements only "Independent Control" and Juniper only "Ordered Control". Both modes are interoperable. The point of supporting only one combination of all modes of operation is that it will allow for the writing of a simpler code without removing useful functionality. ok claudio@
-rw-r--r--usr.sbin/ldpd/lde.c8
-rw-r--r--usr.sbin/ldpd/lde_lib.c14
-rw-r--r--usr.sbin/ldpd/ldpd.conf.537
-rw-r--r--usr.sbin/ldpd/ldpd.h10
-rw-r--r--usr.sbin/ldpd/neighbor.c8
-rw-r--r--usr.sbin/ldpd/parse.y51
-rw-r--r--usr.sbin/ldpd/printconf.c17
7 files changed, 10 insertions, 135 deletions
diff --git a/usr.sbin/ldpd/lde.c b/usr.sbin/ldpd/lde.c
index 3c4e972254f..354d6d6ad93 100644
--- a/usr.sbin/ldpd/lde.c
+++ b/usr.sbin/ldpd/lde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lde.c,v 1.31 2015/07/19 18:34:32 renato Exp $ */
+/* $OpenBSD: lde.c,v 1.32 2015/07/19 20:50:03 renato Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -677,12 +677,6 @@ lde_nbr_do_mappings(struct rt_node *rn)
/* LMp.28 Is this from a pending request? */
lre = (struct lde_req *)fec_find(&ln->recv_req, &rn->fec);
- /* Check for the only case where no mapping should be sent.
- * This is the On Demand case of LMp.29 */
- if (ldeconf->mode & MODE_ADV_ONDEMAND && lre == NULL)
- /* adv. on demand but no req pending, skip */
- continue;
-
lde_send_labelmapping(ln, rn);
/* LMp.30 & 31 are not needed because labels are always added */
}
diff --git a/usr.sbin/ldpd/lde_lib.c b/usr.sbin/ldpd/lde_lib.c
index 918320c7b9c..2977a6171eb 100644
--- a/usr.sbin/ldpd/lde_lib.c
+++ b/usr.sbin/ldpd/lde_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lde_lib.c,v 1.35 2015/07/19 18:34:32 renato Exp $ */
+/* $OpenBSD: lde_lib.c,v 1.36 2015/07/19 20:50:03 renato Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -364,11 +364,6 @@ lde_check_mapping(struct map *map, struct lde_nbr *ln)
rn = (struct rt_node *)fec_find_prefix(&rt, map->prefix.s_addr,
map->prefixlen);
if (rn == NULL) {
- /* The route is not yet in fib. If we are in liberal mode
- * create a route and record the label */
- if (ldeconf->mode & MODE_RET_CONSERVATIVE)
- return;
-
rn = rt_add(map->prefix, map->prefixlen);
rn->local_label = lde_assign_label();
}
@@ -409,13 +404,6 @@ lde_check_mapping(struct map *map, struct lde_nbr *ln)
break;
}
if (addr == NULL) {
- /* route not yet available LMp.13 */
- if (ldeconf->mode & MODE_RET_CONSERVATIVE) {
- log_debug("FEC %s: conservative ret but no route",
- log_fec(map));
- lde_send_labelrelease(ln, rn, map->label);
- return;
- }
/* in liberal mode just note the mapping */
if (me == NULL)
me = lde_map_add(ln, rn, 0);
diff --git a/usr.sbin/ldpd/ldpd.conf.5 b/usr.sbin/ldpd/ldpd.conf.5
index acbb58983b5..fc765bf3758 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.14 2013/06/04 06:41:35 jmc Exp $
+.\" $OpenBSD: ldpd.conf.5,v 1.15 2015/07/19 20:50:03 renato 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: June 4 2013 $
+.Dd $Mdocdate: July 19 2015 $
.Dt LDPD.CONF 5
.Os
.Sh NAME
@@ -87,39 +87,6 @@ Set the keepalive timeout in seconds.
The default value is 180; valid range is 1\-65535.
.Pp
.It Xo
-.Ic distribution
-.Pq Ic independent Ns | Ns Ic ordered
-.Xc
-Select the distribution mode.
-.Ic independent
-distributes labels at any time;
-.Ic ordered
-forces
-.Xr ldpd 8
-to wait a mapping from nexthop before distributing it to peers.
-.Pp
-.It Xo
-.Ic retention
-.Pq Ic liberal Ns | Ns Ic conservative
-.Xc
-Select the retention mode.
-.Ic conservative
-retains just the labels advertised from nexthop;
-.Ic liberal
-mode retains every label received, even those not advertised
-from nexthops.
-.Pp
-.It Xo
-.Ic advertisement
-.Pq Ic unsolicited Ns | Ns Ic ondemand
-.Xc
-Select the advertisement mode.
-.Ic unsolicited
-advertises labels according to the distribution mode;
-.Ic ondemand
-advertises labels solely upon explicit request from peers.
-.Pp
-.It Xo
.Ic targeted-hello-accept
.Pq Ic yes Ns | Ns Ic no
.Xc
diff --git a/usr.sbin/ldpd/ldpd.h b/usr.sbin/ldpd/ldpd.h
index 5212d072e8b..31dd4342122 100644
--- a/usr.sbin/ldpd/ldpd.h
+++ b/usr.sbin/ldpd/ldpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.h,v 1.46 2015/07/19 18:27:59 renato Exp $ */
+/* $OpenBSD: ldpd.h,v 1.47 2015/07/19 20:50:03 renato Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -230,13 +230,6 @@ enum hello_type {
HELLO_TARGETED
};
-#define MODE_DIST_INDEPENDENT 0x01
-#define MODE_DIST_ORDERED 0x02
-#define MODE_RET_LIBERAL 0x04
-#define MODE_RET_CONSERVATIVE 0x08
-#define MODE_ADV_ONDEMAND 0x10
-#define MODE_ADV_UNSOLICITED 0x20
-
struct ldpd_conf {
struct event disc_ev;
struct event edisc_ev;
@@ -254,7 +247,6 @@ struct ldpd_conf {
int ldp_ediscovery_socket;
int ldp_session_socket;
int flags;
- u_int8_t mode;
u_int16_t keepalive;
u_int16_t thello_holdtime;
u_int16_t thello_interval;
diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c
index e9fd44574d3..849516860a1 100644
--- a/usr.sbin/ldpd/neighbor.c
+++ b/usr.sbin/ldpd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.45 2015/03/21 18:34:01 renato Exp $ */
+/* $OpenBSD: neighbor.c,v 1.46 2015/07/19 20:50:03 renato Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -534,10 +534,8 @@ nbr_act_session_operational(struct nbr *nbr)
void
nbr_send_labelmappings(struct nbr *nbr)
{
- if (leconf->mode & MODE_ADV_UNSOLICITED) {
- ldpe_imsg_compose_lde(IMSG_LABEL_MAPPING_FULL, nbr->peerid, 0,
- NULL, 0);
- }
+ ldpe_imsg_compose_lde(IMSG_LABEL_MAPPING_FULL, nbr->peerid, 0,
+ NULL, 0);
}
void
diff --git a/usr.sbin/ldpd/parse.y b/usr.sbin/ldpd/parse.y
index b75128c8d5f..4a6a9f40d9a 100644
--- a/usr.sbin/ldpd/parse.y
+++ b/usr.sbin/ldpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.23 2014/11/20 05:51:20 jsg Exp $ */
+/* $OpenBSD: parse.y,v 1.24 2015/07/19 20:50:03 renato Exp $ */
/*
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
@@ -118,7 +118,6 @@ typedef struct {
%token THELLOHOLDTIME THELLOINTERVAL
%token THELLOACCEPT
%token KEEPALIVE
-%token DISTRIBUTION RETENTION ADVERTISEMENT
%token EXTTAG
%token YES NO
%token ERROR
@@ -179,48 +178,6 @@ conf_main : ROUTERID STRING {
else
conf->flags &= ~LDPD_FLAG_NO_FIB_UPDATE;
}
- | DISTRIBUTION STRING {
- conf->mode &= ~(MODE_DIST_INDEPENDENT |
- MODE_DIST_ORDERED);
-
- if (!strcmp($2, "independent"))
- conf->mode |= MODE_DIST_INDEPENDENT;
- else if (!strcmp($2, "ordered"))
- conf->mode |= MODE_DIST_ORDERED;
- else {
- yyerror("unknown distribution type");
- free($2);
- YYERROR;
- }
- }
- | RETENTION STRING {
- conf->mode &= ~(MODE_RET_CONSERVATIVE |
- MODE_RET_LIBERAL);
-
- if (!strcmp($2, "conservative"))
- conf->mode |= MODE_RET_CONSERVATIVE;
- else if (!strcmp($2, "liberal"))
- conf->mode |= MODE_RET_LIBERAL;
- else {
- yyerror("unknown retention type");
- free($2);
- YYERROR;
- }
- }
- | ADVERTISEMENT STRING {
- conf->mode &= ~(MODE_ADV_ONDEMAND |
- MODE_ADV_UNSOLICITED);
-
- if (!strcmp($2, "ondemand"))
- conf->mode |= MODE_ADV_ONDEMAND;
- else if (!strcmp($2, "unsolicited"))
- conf->mode |= MODE_ADV_UNSOLICITED;
- else {
- yyerror("unknown retention type");
- free($2);
- YYERROR;
- }
- }
| THELLOACCEPT yesno {
if ($2 == 0)
conf->flags &= ~LDPD_FLAG_TH_ACCEPT;
@@ -398,8 +355,6 @@ lookup(char *s)
{
/* this has to be sorted always */
static const struct keywords keywords[] = {
- {"advertisement", ADVERTISEMENT},
- {"distribution", DISTRIBUTION},
{"external-tag", EXTTAG},
{"fib-update", FIBUPDATE},
{"interface", INTERFACE},
@@ -407,7 +362,6 @@ lookup(char *s)
{"link-hello-holdtime", LHELLOHOLDTIME},
{"link-hello-interval", LHELLOINTERVAL},
{"no", NO},
- {"retention", RETENTION},
{"router-id", ROUTERID},
{"targeted-hello-accept", THELLOACCEPT},
{"targeted-hello-holdtime", THELLOHOLDTIME},
@@ -753,9 +707,6 @@ parse_config(char *filename, int opts)
conf->thello_holdtime = TARGETED_DFLT_HOLDTIME;
conf->thello_interval = DEFAULT_HELLO_INTERVAL;
- conf->mode = (MODE_DIST_INDEPENDENT | MODE_RET_LIBERAL |
- MODE_ADV_UNSOLICITED);
-
if ((file = pushfile(filename, !(conf->opts & LDPD_OPT_NOACTION))) == NULL) {
free(conf);
return (NULL);
diff --git a/usr.sbin/ldpd/printconf.c b/usr.sbin/ldpd/printconf.c
index cbdddd52544..626b6745359 100644
--- a/usr.sbin/ldpd/printconf.c
+++ b/usr.sbin/ldpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.7 2013/06/04 02:25:28 claudio Exp $ */
+/* $OpenBSD: printconf.c,v 1.8 2015/07/19 20:50:03 renato Exp $ */
/*
* Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org>
@@ -42,21 +42,6 @@ print_mainconf(struct ldpd_conf *conf)
else
printf("fib-update yes\n");
- if (conf->mode & MODE_DIST_INDEPENDENT)
- printf("distribution independent\n");
- else
- printf("distribution ordered\n");
-
- if (conf->mode & MODE_RET_LIBERAL)
- printf("retention liberal\n");
- else
- printf("retention conservative\n");
-
- if (conf->mode & MODE_ADV_ONDEMAND)
- printf("advertisement ondemand\n");
- else
- printf("advertisement unsolicited\n");
-
if (conf->flags & LDPD_FLAG_TH_ACCEPT)
printf("targeted-hello-accept yes\n");
else