summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2017-08-11 16:02:53 +0000
committerclaudio <claudio@openbsd.org>2017-08-11 16:02:53 +0000
commit6828d6268970fb52f4d2cf7df150f8d2bd8efc1b (patch)
treef2b8c6494b207849607a8391bb5af1ef89e057db
parentKernel compilation with DDBPROF enabled fails as db_sym_t is no longer (diff)
downloadwireguard-openbsd-6828d6268970fb52f4d2cf7df150f8d2bd8efc1b.tar.xz
wireguard-openbsd-6828d6268970fb52f4d2cf7df150f8d2bd8efc1b.zip
softreconfig in and out are on by default for ever and machines now have
enough memory that it does not make sense to provide these knobs anymore. They just make the code more complex for no much gain. OK phessler@, benno@
-rw-r--r--usr.sbin/bgpd/bgpd.conf.523
-rw-r--r--usr.sbin/bgpd/bgpd.h4
-rw-r--r--usr.sbin/bgpd/control.c11
-rw-r--r--usr.sbin/bgpd/parse.y13
-rw-r--r--usr.sbin/bgpd/printconf.c13
-rw-r--r--usr.sbin/bgpd/rde.c33
6 files changed, 18 insertions, 79 deletions
diff --git a/usr.sbin/bgpd/bgpd.conf.5 b/usr.sbin/bgpd/bgpd.conf.5
index d7945b810c3..6f3beb71ae9 100644
--- a/usr.sbin/bgpd/bgpd.conf.5
+++ b/usr.sbin/bgpd/bgpd.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: bgpd.conf.5,v 1.161 2017/06/26 10:05:57 phessler Exp $
+.\" $OpenBSD: bgpd.conf.5,v 1.162 2017/08/11 16:02:53 claudio Exp $
.\"
.\" Copyright (c) 2004 Claudio Jeker <claudio@openbsd.org>
.\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -16,7 +16,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 26 2017 $
+.Dd $Mdocdate: August 11 2017 $
.Dt BGPD.CONF 5
.Os
.Sh NAME
@@ -973,25 +973,6 @@ and
These sets are rewritten into filter rules and can be viewed with
.Dq bgpd -nv .
.Pp
-.It Xo
-.Ic softreconfig
-.Pq Ic in Ns | Ns Ic out
-.Pq Ic yes Ns | Ns Ic no
-.Xc
-Turn soft reconfiguration on or off for the specified direction.
-If soft reconfiguration is turned on, filter changes will be applied on
-configuration reloads.
-If turned off, a BGP session needs to be cleared to apply the filter changes.
-Enabling
-.Ic softreconfig in
-will raise the memory requirements of
-.Xr bgpd 8
-because the unmodified
-.Em AS path attributes
-need to be stored as well.
-The default is
-.Ic yes .
-.Pp
.It Ic tcp md5sig password Ar secret
.It Ic tcp md5sig key Ar secret
Enable TCP MD5 signatures per RFC 2385.
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 32698a03fb6..33727448b92 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.312 2017/08/10 14:12:34 benno Exp $ */
+/* $OpenBSD: bgpd.h,v 1.313 2017/08/11 16:02:53 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -328,8 +328,6 @@ struct peer_config {
u_int8_t down;
u_int8_t announce_capa;
u_int8_t reflector_client;
- u_int8_t softreconfig_in;
- u_int8_t softreconfig_out;
u_int8_t ttlsec; /* TTL security hack */
u_int8_t flags;
};
diff --git a/usr.sbin/bgpd/control.c b/usr.sbin/bgpd/control.c
index db4f8bb1108..633a6344180 100644
--- a/usr.sbin/bgpd/control.c
+++ b/usr.sbin/bgpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.89 2017/08/10 14:12:34 benno Exp $ */
+/* $OpenBSD: control.c,v 1.90 2017/08/11 16:02:53 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -457,15 +457,6 @@ control_dispatch_msg(struct pollfd *pfd, u_int *ctl_cnt)
control_result(c, CTL_RES_NOSUCHPEER);
break;
}
- if ((ribreq->flags & F_CTL_ADJ_IN) && p &&
- !p->conf.softreconfig_in) {
- /*
- * without softreconfig_in we do not
- * have an Adj-RIB-In table
- */
- control_result(c, CTL_RES_NOCAP);
- break;
- }
if ((imsg.hdr.type == IMSG_CTL_SHOW_RIB_PREFIX)
&& (ribreq->prefix.aid == AID_UNSPEC)) {
/* malformed request, must specify af */
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 93da2a4bf4f..7312e15bcbf 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.312 2017/06/26 10:08:06 phessler Exp $ */
+/* $OpenBSD: parse.y,v 1.313 2017/08/11 16:02:53 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -190,7 +190,7 @@ typedef struct {
%token GROUP NEIGHBOR NETWORK
%token LOCALAS REMOTEAS DESCR LOCALADDR MULTIHOP PASSIVE MAXPREFIX RESTART
%token ANNOUNCE CAPABILITIES REFRESH AS4BYTE CONNECTRETRY
-%token DEMOTE ENFORCE NEIGHBORAS REFLECTOR DEPEND DOWN SOFTRECONFIG
+%token DEMOTE ENFORCE NEIGHBORAS REFLECTOR DEPEND DOWN
%token DUMP IN OUT SOCKET RESTRICTED
%token LOG ROUTECOLL TRANSPARENT
%token TCP MD5SIG PASSWORD KEY TTLSECURITY
@@ -1421,12 +1421,6 @@ peeropts : REMOTEAS as4number {
YYERROR;
}
}
- | SOFTRECONFIG inout yesno {
- if ($2)
- curpeer->conf.softreconfig_in = $3;
- else
- curpeer->conf.softreconfig_out = $3;
- }
| TRANSPARENT yesno {
if ($2 == 1)
curpeer->conf.flags |= PEERFLAG_TRANS_AS;
@@ -2442,7 +2436,6 @@ lookup(char *s)
{ "self", SELF},
{ "set", SET},
{ "socket", SOCKET },
- { "softreconfig", SOFTRECONFIG},
{ "source-as", SOURCEAS},
{ "spi", SPI},
{ "static", STATIC},
@@ -3273,8 +3266,6 @@ alloc_peer(void)
p->conf.capabilities.as4byte = 1;
p->conf.local_as = conf->as;
p->conf.local_short_as = conf->short_as;
- p->conf.softreconfig_in = 1;
- p->conf.softreconfig_out = 1;
return (p);
}
diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c
index afa96e40bb4..7ca47c76046 100644
--- a/usr.sbin/bgpd/printconf.c
+++ b/usr.sbin/bgpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.104 2017/05/31 10:44:00 claudio Exp $ */
+/* $OpenBSD: printconf.c,v 1.105 2017/08/11 16:02:53 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -538,17 +538,6 @@ print_peer(struct peer_config *p, struct bgpd_config *conf, const char *c)
print_announce(p, c);
- if (p->softreconfig_in == 1)
- printf("%s\tsoftreconfig in yes\n", c);
- else
- printf("%s\tsoftreconfig in no\n", c);
-
- if (p->softreconfig_out == 1)
- printf("%s\tsoftreconfig out yes\n", c);
- else
- printf("%s\tsoftreconfig out no\n", c);
-
-
print_mrt(conf, p->id, p->groupid, c, "\t");
printf("%s}\n", c);
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 0ad81ac8512..b7cb0baf533 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.370 2017/08/10 15:44:09 benno Exp $ */
+/* $OpenBSD: rde.c,v 1.371 2017/08/11 16:02:53 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1326,13 +1326,12 @@ rde_update_update(struct rde_peer *peer, struct rde_aspath *asp,
{
struct rde_aspath *fasp;
enum filter_actions action;
- int r = 0, f = 0;
u_int16_t i;
peer->prefix_rcvd_update++;
/* add original path to the Adj-RIB-In */
- if (peer->conf.softreconfig_in)
- r += path_update(&ribs[0].rib, peer, asp, prefix, prefixlen);
+ path_update(&ribs[0].rib, peer, asp, prefix, prefixlen);
+ peer->prefix_cnt++;
for (i = 1; i < rib_size; i++) {
if (*ribs[i].name == '\0')
@@ -1347,49 +1346,40 @@ rde_update_update(struct rde_peer *peer, struct rde_aspath *asp,
if (action == ACTION_ALLOW) {
rde_update_log("update", i, peer,
&fasp->nexthop->exit_nexthop, prefix, prefixlen);
- r += path_update(&ribs[i].rib, peer, fasp, prefix,
+ path_update(&ribs[i].rib, peer, fasp, prefix,
prefixlen);
} else if (prefix_remove(&ribs[i].rib, peer, prefix, prefixlen,
0)) {
rde_update_log("filtered withdraw", i, peer,
NULL, prefix, prefixlen);
- f++;
}
/* free modified aspath */
if (fasp != asp)
path_put(fasp);
}
-
- if (r)
- peer->prefix_cnt++;
- else if (f)
- peer->prefix_cnt--;
}
void
rde_update_withdraw(struct rde_peer *peer, struct bgpd_addr *prefix,
u_int8_t prefixlen)
{
- int r = 0;
u_int16_t i;
- peer->prefix_rcvd_withdraw++;
-
- for (i = rib_size - 1; ; i--) {
+ for (i = 1; i < rib_size; i++) {
if (*ribs[i].name == '\0')
break;
if (prefix_remove(&ribs[i].rib, peer, prefix, prefixlen, 0)) {
rde_update_log("withdraw", i, peer, NULL, prefix,
prefixlen);
- r++;
}
- if (i == 0)
- break;
}
- if (r)
+ /* remove original path form the Adj-RIB-In */
+ if (prefix_remove(&ribs[0].rib, peer, prefix, prefixlen, 0))
peer->prefix_cnt--;
+
+ peer->prefix_rcvd_withdraw++;
}
/*
@@ -2940,8 +2930,7 @@ rde_reload_done(void)
peer->reconf_rib = 1;
continue;
}
- if (peer->conf.softreconfig_out &&
- !rde_filter_equal(out_rules, out_rules_tmp, peer)) {
+ if (!rde_filter_equal(out_rules, out_rules_tmp, peer)) {
peer->reconf_out = 1;
}
}
@@ -3658,7 +3647,7 @@ network_delete(struct network_config *nc, int flagstatic)
}
}
- for (i = rib_size - 1; i > 0; i--) {
+ for (i = 1; i < rib_size; i++) {
if (*ribs[i].name == '\0')
break;
prefix_remove(&ribs[i].rib, peerself, &nc->prefix,