]> git.puffer.fish Git - matthieu/frr.git/commit
bgpd: well-known attr check only run for v4/uni, which could cause a crash.
authorPaul Jakma <paul@opensourcerouting.org>
Tue, 23 Sep 2014 14:23:01 +0000 (15:23 +0100)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 20:13:10 +0000 (20:13 +0000)
commitbb7bef1490138c464ffe5f065a5f3755fc6e1b6f
treed656cf422fe28272a6c48bea83c3fb7816318ccd
parent4799375a87f028c057613753d056434d1fe1856d
bgpd: well-known attr check only run for v4/uni, which could cause a crash.

* ANVL testing by Martin Winter threw up a crash in bgpd in aspath_dup
  called from bgp_packet_attribute, if attr->aspath was NULL, on an IPv6
  UPDATE.

  This root cause is that the checks for well-known, mandatory attributes
  were being applied only if an UPDATE contained the IPv4 NLRI and the
  peer was configured for v4/unicast (i.e. not deconfigured). This is
  something inherited from GNU Zebra, and never noticed before.

* bgp_attr.c: (bgp_attr_parse) Move the well-known mandatory attribute
  check to here, so that it can be run immediately after all attributes
  are parsed, and before any further processing of attributes that might
  assume the existence of WK/M attributes (e.g. AS4-Path).
  (bgp_attr_munge_as4_attrs) Missing AS_PATH shouldn't happen here anymore,
  but retain a check anyway for robustness - it's definitely a hard error
  though.
* bgp_attr.h: (bgp_attr_check) No longer needs to be exported, make static.
* bgp_packet.c: (bgp_update_receive) Responsibility for well-known check
  now in bgp_attr_parse.

(cherry picked from commit 055086f70febc30fdfd94bb4406e9075d6934cd8)

Conflicts:
bgpd/bgp_attr.c
bgpd/bgp_attr.h
bgpd/bgp_packet.c
bgpd/bgp_attr.c
bgpd/bgp_attr.h
bgpd/bgp_packet.c