summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-02-02 15:36:22 +0100
committerMaria Matejka <mq@ucw.cz>2022-02-03 10:30:33 +0100
commit216bcb7c68fadcd2a363bf912db743b00b155459 (patch)
tree0a55ccddbc65737f588937de498f49735f43417e /proto
parentd262695d4e8ddee7b9408bb726b4100f68d217d7 (diff)
Protocol limit restart/down must be callable from protocol context
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/bgp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index f427ded1..65cc3a40 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -1273,6 +1273,16 @@ bgp_incoming_connection(sock *sk, uint dummy UNUSED)
return 0;
}
+ if (p->p.loop == &main_birdloop)
+ {
+ /* Protocol is down for whatever reason. No need for locking. */
+ BGP_TRACE(D_EVENTS, "Incoming connection from %I%J (port %d) rejected (protocol is down)",
+ sk->daddr, ipa_is_link_local(sk->daddr) ? sk->iface : NULL,
+ sk->dport);
+ rfree(sk);
+ return 0;
+ }
+
BGP_ENTER(p);
/*