]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: fix sending of invalid nexthops on the wire 592/head
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 19 May 2017 13:51:00 +0000 (10:51 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 19 May 2017 20:01:29 +0000 (17:01 -0300)
commit3800c7b0674073dd1c8ab111f5638686db4da767
treeda3f6aa8559ec70bf36d94dd22c77c7a37fdb991
parentebb0c02ad3c985db4c185e5ac599fb54cc0dc37f
bgpd: fix sending of invalid nexthops on the wire

The bpacket_reformat_for_peer() function rewrites the nexthop of outgoing
route updates on a per-peer basis in order to handle route-maps ("set
ip next-hop") and locally-originated routes missing a nexthop.

In the latter case, RFC 4271 says the following: "When announcing a
locally-originated route to an internal peer, the BGP speaker SHOULD use
the interface address of the router through which the announced network
is reachable for the speaker as the NEXT_HOP".

We were doing this for regular IPv4/IPv6 routes, but not for
VPN/EVPN/ENCAP routes, which were being announced with invalid nexthops
(0.0.0.0 or ::).

This patch fixes this problem.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
bgpd/bgp_attr.c
bgpd/bgp_updgrp_packet.c