From 7d9ab86b7ac7d1f039af92a58eb749a24811b5c9 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 4 May 2014 00:01:06 +0200 Subject: [PATCH 1/3] Fixes BGP crash when update with some attributes and empty NLRI is received. --- proto/bgp/packets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index b6239025..4464523d 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -1112,7 +1112,7 @@ bgp_do_rx_update(struct bgp_conn *conn, if (conn->state != BS_ESTABLISHED) /* fatal error during decoding */ return; - if (a0 && ! bgp_set_next_hop(p, a0)) + if (a0 && nlri_len && !bgp_set_next_hop(p, a0)) a0 = NULL; last_id = 0; From 66370eac1f88ec74b3017f1c39038d7b8b776de6 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 4 May 2014 00:01:06 +0200 Subject: [PATCH 2/3] Fixes BGP crash when update with some attributes and empty NLRI is received. Thanks to Charlie Allom for the bugreport. --- proto/bgp/packets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index b6239025..4464523d 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -1112,7 +1112,7 @@ bgp_do_rx_update(struct bgp_conn *conn, if (conn->state != BS_ESTABLISHED) /* fatal error during decoding */ return; - if (a0 && ! bgp_set_next_hop(p, a0)) + if (a0 && nlri_len && !bgp_set_next_hop(p, a0)) a0 = NULL; last_id = 0; From 1149aa977d906a6400f998d5f6600871584395d0 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 5 May 2014 11:05:12 +0200 Subject: [PATCH 3/3] Fixes a problem with undoing of deconfiguring of protocol. Thanks to Sergey Popovich for the original patch. --- nest/proto.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nest/proto.c b/nest/proto.c index 6278580c..7a1e9bf7 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -605,6 +605,7 @@ proto_rethink_goal(struct proto *p) { struct proto_config *nc = p->cf_new; DBG("%s has shut down for reconfiguration\n", p->name); + p->cf->proto = NULL; config_del_obstacle(p->cf->global); rem_node(&p->n); rem_node(&p->glob_node);