summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/session.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2013-07-10 15:56:07 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2013-07-10 15:56:07 +0000
commite9e26ef558213484b73395d6a214c71c8e2356c0 (patch)
tree3658d35d52845a51d23ec526f37e3ddbd1489a02 /usr.sbin/bgpd/session.c
parent285306027b16876891b376c56aff97ef5057f436 (diff)
Change the way the RDE updates its peer list. The SE is now always sending
a IMSG_SESSION_ADD message to the RDE when a peer comes up or when a reload happens. The IMSG_SESSION_ADD has the full current config of the peer and so the RDE should end up with correct values. This affects mostly maxprefix and the RIB settings. OK henning@
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r--usr.sbin/bgpd/session.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index cc588d7b2ac..d642209bef1 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.331 2013/05/30 20:29:27 florian Exp $ */
+/* $OpenBSD: session.c,v 1.332 2013/07/10 15:56:06 claudio Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -79,7 +79,6 @@ void session_notification(struct peer *, u_int8_t, u_int8_t, void *,
ssize_t);
void session_rrefresh(struct peer *, u_int8_t);
int session_graceful_restart(struct peer *);
-int session_graceful_is_restarting(struct peer *);
int session_graceful_stop(struct peer *);
int session_dispatch_msg(struct pollfd *, struct peer *);
int session_process_msg(struct peer *);
@@ -1724,17 +1723,6 @@ session_graceful_restart(struct peer *p)
}
int
-session_graceful_is_restarting(struct peer *p)
-{
- u_int8_t i;
-
- for (i = 0; i < AID_MAX; i++)
- if (p->capa.neg.grestart.flags[i] & CAPA_GR_RESTARTING)
- return (1);
- return (0);
-}
-
-int
session_graceful_stop(struct peer *p)
{
u_int8_t i;
@@ -2623,7 +2611,7 @@ session_dispatch_imsg(struct imsgbuf *ibuf, int idx, u_int *listener_cnt)
/* sync the RDE in case we keep the peer */
if (reconf == RECONF_KEEP) {
- if (imsg_compose(ibuf_rde, IMSG_RECONF_PEER,
+ if (imsg_compose(ibuf_rde, IMSG_SESSION_ADD,
p->conf.id, 0, -1, &p->conf,
sizeof(struct peer_config)) == -1)
fatalx("imsg_compose error");
@@ -2637,7 +2625,7 @@ session_dispatch_imsg(struct imsgbuf *ibuf, int idx, u_int *listener_cnt)
NULL, np->conf.id,
np->conf.remote_as);
if (imsg_compose(ibuf_rde,
- IMSG_RECONF_PEER,
+ IMSG_SESSION_ADD,
np->conf.id, 0, -1,
&np->conf,
sizeof(struct peer_config))
@@ -3156,10 +3144,9 @@ session_up(struct peer *p)
{
struct session_up sup;
- if (!session_graceful_is_restarting(p))
- if (imsg_compose(ibuf_rde, IMSG_SESSION_ADD, p->conf.id, 0, -1,
- &p->conf, sizeof(p->conf)) == -1)
- fatalx("imsg_compose error");
+ if (imsg_compose(ibuf_rde, IMSG_SESSION_ADD, p->conf.id, 0, -1,
+ &p->conf, sizeof(p->conf)) == -1)
+ fatalx("imsg_compose error");
sa2addr((struct sockaddr *)&p->sa_local, &sup.local_addr);
sa2addr((struct sockaddr *)&p->sa_remote, &sup.remote_addr);