From: Benjamin Cama Date: Tue, 19 Jul 2011 22:29:02 +0000 (+0200) Subject: Disable IPv6 routes adv when peer doesn't support it. X-Git-Tag: debian/2.2.1-1fdn1~1^2^2~16 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/78a7085778868f1bc0e5e5542b7e208f943e3778 Disable IPv6 routes adv when peer doesn't support it. Signed-off-by: Benjamin Cama --- diff --git a/bgp.c b/bgp.c index 2deeeb3..ea15faf 100644 --- a/bgp.c +++ b/bgp.c @@ -1093,6 +1093,17 @@ static int bgp_handle_input(struct bgp_peer *peer) return 0; } + if (notification->error_code == BGP_ERR_OPEN + && notification->subcode == BGP_ERR_OPN_UNSUP_CAP) + { + /* the only capability we advertise is this one, so upon receiving + an "unsupported capability" message, we disable IPv6 routes for + this peer */ + LOG(4, 0, 0, "BGP peer %s doesn't support IPv6 routes advertisement\n", peer->name); + peer->handle_ipv6_routes = 0; + break; + } + /* FIXME: should handle more notifications */ LOG(4, 0, 0, "BGP peer %s sent unhandled NOTIFICATION %d\n", peer->name, (int) notification->error_code);