diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2019-03-16 19:40:19 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-08-28 23:20:06 +0200 |
commit | 7755ca116355a3f02d307ad0fc937ffc8b308486 (patch) | |
tree | 317673df68c208340e7450296cd794cac21f0ea9 | |
parent | f7c34aa227693194e53ca0435dba52c2a839bae8 (diff) |
WIP DEBUG
-rw-r--r-- | proto/bgp/packets.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c index 78fdd1e0..dd979834 100644 --- a/proto/bgp/packets.c +++ b/proto/bgp/packets.c @@ -914,7 +914,7 @@ bgp_apply_next_hop(struct bgp_parse_state *s, rta *a, ip_addr gw, ip_addr ll) nbr = neigh_find(&p->p, ll, p->neigh->iface, 0); if (!nbr || (nbr->scope == SCOPE_HOST)) - WITHDRAW(BAD_NEXT_HOP); + WITHDRAW(BAD_NEXT_HOP " 1 %p %I", nbr, gw); a->dest = RTD_UNICAST; a->nh.gw = nbr->addr; @@ -924,7 +924,7 @@ bgp_apply_next_hop(struct bgp_parse_state *s, rta *a, ip_addr gw, ip_addr ll) else /* GW_RECURSIVE */ { if (ipa_zero(gw)) - WITHDRAW(BAD_NEXT_HOP); + WITHDRAW(BAD_NEXT_HOP " 2"); rtable *tab = ipa_is_ip4(gw) ? c->igp_table_ip4 : c->igp_table_ip6; s->hostentry = rt_get_hostentry(tab, gw, ll, c->c.table); @@ -1086,16 +1086,16 @@ bgp_update_next_hop_ip(struct bgp_export_state *s, eattr *a, ea_list **to) /* Forbid zero next hop */ if (ipa_zero(nh[0]) && ((len != 32) || ipa_zero(nh[1]))) - WITHDRAW(BAD_NEXT_HOP); + WITHDRAW(BAD_NEXT_HOP " 3"); /* Forbid next hop equal to neighbor IP */ if (ipa_equal(peer, nh[0]) || ((len == 32) && ipa_equal(peer, nh[1]))) - WITHDRAW(BAD_NEXT_HOP); + WITHDRAW(BAD_NEXT_HOP " 4"); /* Forbid next hop with non-matching AF */ if ((ipa_is_ip4(nh[0]) != bgp_channel_is_ipv4(s->channel)) && !s->channel->ext_next_hop) - WITHDRAW(BAD_NEXT_HOP); + WITHDRAW(BAD_NEXT_HOP " 5"); /* Just check if MPLS stack */ if (s->mpls && !bgp_find_attr(*to, BA_MPLS_LABEL_STACK)) @@ -1170,7 +1170,7 @@ bgp_decode_next_hop_ip(struct bgp_parse_state *s, byte *data, uint len, rta *a) ad->length = 16; if ((bgp_channel_is_ipv4(c) != ipa_is_ip4(nh[0])) && !c->ext_next_hop) - WITHDRAW(BAD_NEXT_HOP); + WITHDRAW(BAD_NEXT_HOP " 6"); // XXXX validate next hop @@ -1251,7 +1251,7 @@ bgp_decode_next_hop_vpn(struct bgp_parse_state *s, byte *data, uint len, rta *a) bgp_parse_error(s, 9); if ((bgp_channel_is_ipv4(c) != ipa_is_ip4(nh[0])) && !c->ext_next_hop) - WITHDRAW(BAD_NEXT_HOP); + WITHDRAW(BAD_NEXT_HOP " 7"); // XXXX validate next hop |