From: Igor Putovny Date: Mon, 19 May 2025 13:39:59 +0000 (+0200) Subject: Cleanup X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bf37e2ef332480ae0510f712dd69570145bf5d4;p=thirdparty%2Fbird.git Cleanup --- diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 8a98b685c..c8f90fadb 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -2883,7 +2883,6 @@ void bgp_error(struct bgp_conn *c, uint code, uint subcode, byte *data, int len) { struct bgp_proto *p = c->bgp; - ASSERT_DIE(p->conn == c); // selze if (c->state == BS_CLOSE) return; diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index 15113dbb9..2eabe6ec1 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -944,7 +944,7 @@ bgp_rx_open(struct bgp_conn *conn, byte *pkt, uint len) /* RFC 5492 5 - check for required capabilities */ if (p->cf->capabilities && !bgp_check_capabilities(conn)) - { bgp_error(conn, 2, 7, NULL, 0); return; } // len je 0, tudiz se nikdy nezavola kod uvnitr if (len) v bgp_log_error() + { bgp_error(conn, 2, 7, NULL, 0); return; } struct bgp_caps *caps = conn->remote_caps; @@ -3404,40 +3404,6 @@ bgp_log_error(struct bgp_proto *p, u8 class, char *msg, uint code, uint subcode, if (bgp_handle_message(p, data, len, &t)) goto done; - /* RFC 5492 - capabilities negotiation */ - // kod se nezavola protoze len je 0 - // pokud se kod vytahne ven z if (len) { ... } tak spadne na to ze p->conn == NULL - if ((code == 2) && (subcode == 7)) - { - ASSERT_DIE(p->conn != NULL); - - const struct bgp_caps *local = p->conn->local_caps; - const struct bgp_caps *remote = p->conn->remote_caps; - - const struct bgp_af_caps *local_ac = NULL; - const struct bgp_af_caps *remote_ac = NULL; - - t += bsprintf(t, "AFI/SAFI mismatch: local has:"); - - WALK_AF_CAPS(local, local_ac) - { - const struct bgp_af_desc *desc = bgp_get_af_desc(local_ac->afi); - ASSERT_DIE(desc != NULL); - t += bsprintf(t, " %s", desc->name); - } - - t += bsprintf(t, ", remote has:"); - - WALK_AF_CAPS(remote, remote_ac) - { - const struct bgp_af_desc *desc = bgp_get_af_desc(remote_ac->afi); - ASSERT_DIE(desc != NULL); - t += bsprintf(t, " %s", desc->name); - } - - goto done; - } - *t++ = ':'; *t++ = ' '; if (len > 128) @@ -3578,7 +3544,6 @@ bgp_rx(sock *sk, uint size) } if (end < pkt_start + len) break; - ASSERT_DIE(conn->bgp->conn == conn); // selze bgp_rx_packet(conn, pkt_start, len); pkt_start += len; }