)]}'
{
  "commit": "518a4b7eadcba567f01061e6659d8179380efcdf",
  "tree": "0bc751d4e0024954e1bf3bf5a7e0ce84b219ba1f",
  "parents": [
    "18ab08b71e6b29e67b36df5e2261569d381b1708"
  ],
  "author": {
    "name": "Paul Jakma",
    "email": "paul.jakma@hpe.com",
    "time": "Thu Feb 04 13:27:04 2016 +0000"
  },
  "committer": {
    "name": "Paul Jakma",
    "email": "paul.jakma@hpe.com",
    "time": "Tue Mar 08 17:53:21 2016 +0000"
  },
  "message": "bgpd: Regularise bgp_update_receive, add missing notifies and checks\n\n* bgp_packet.c: (bgp_update_receive) Lots of repeated code, doing same\n  thing for each AFI/SAFI.  Except when it doesn\u0027t, e.g.  the IPv4/VPN\n  case was missing the EoR bgp_clear_stale_route call - the only action\n  really needed for EoR.\n\n  Make this function a lot more regular, using common, AFI/SAFI\n  independent blocks so far as possible.\n\n  Replace the 4 separate bgp_nlris with an array, indexed by an enum.\n\n  The distinct blocks that handle calling bgp_nlri_parse for each\n  different AFI/SAFI can now be replaced with a loop.\n\n  Transmogrify the nlri SAFI from the SAFI_MPLS_LABELED_VPN code-point\n  used on the wire, to the SAFI_MPLS_VPN safi_t enum we use internally\n  as early as possible.\n\n  The existing code was not necessarily sending a NOTIFY for NLRI\n  parsing errors, if they arose via bgp_nlri_sanity_check.  Send the\n  correct NOTIFY - INVAL_NETWORK for the classic NLRIs and OPT_ATTR_ERR\n  for the MP ones.\n\n  EoR can now be handled in one block.  The existing code seemed broken\n  for EoR recognition in a number of ways:\n\n  1.  A v4/unicast EoR should be an empty UPDATE.  However, it seemed\n     to be treating an UPDATE with attributes, inc.  MP REACH/UNREACH,\n     but no classic NLRIs, as a v4/uni EoR.\n\n  2.  For other AFI/SAFIs, it was treating UPDATEs with no classic\n     withraw and with a zero-length MP withdraw as EoRs.  However, that\n     would mean an UPDATE packet _with_ update NLRIs and a 0-len MP\n     withdraw could be classed as an EoR.\n\n  This seems to be loose coding leading to ambiguous protocol\n  situations and likely incorrect behaviour, rather than simply being\n  liberal.  Be more strict about checking that an UPDATE really is an\n  EoR and definitely is not trying to update any NLRIs.\n\n  This same loose EoR parsing was noted by Chris Hall previously on\n  list.\n\n  (bgp_nlri_parse) Front end NLRI parse function, to fan-out to the correct\n  parser for the AFI/SAFI.\n\n* bgp_route.c: (bgp_nlri_sanity_check) We try convert NLRI safi to\n  internal code-point ASAP, adjust switch for that.  Leave the wire\n  code point in for defensive coding.\n\n  (bgp_nlri_parse) rename to bgp_nlri_parse_ip.\n\n* tests/bgp_mp_attr_test.c: Can just use bgp_nlri_parse frontend.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "900bc4875a2276d4ca98bdcd3008c2ad6f5d742d",
      "old_mode": 33188,
      "old_path": "bgpd/bgp_mplsvpn.c",
      "new_id": "83bb6ca9d9019d1e4815e42f7e2e9600b6a169a3",
      "new_mode": 33188,
      "new_path": "bgpd/bgp_mplsvpn.c"
    },
    {
      "type": "modify",
      "old_id": "d40c24c2cf75fb2238f5d36614fe1decec1de85e",
      "old_mode": 33188,
      "old_path": "bgpd/bgp_packet.c",
      "new_id": "628c333abdc6ec206b7fd803dca0980d6677bf03",
      "new_mode": 33188,
      "new_path": "bgpd/bgp_packet.c"
    },
    {
      "type": "modify",
      "old_id": "8f0ebe318c618b07b33483aaaaffa47077e019fe",
      "old_mode": 33188,
      "old_path": "bgpd/bgp_packet.h",
      "new_id": "6b0b7f4d40a48aee643d6e69c9c8a40e01afaff6",
      "new_mode": 33188,
      "new_path": "bgpd/bgp_packet.h"
    },
    {
      "type": "modify",
      "old_id": "c1e5e59b12232d5ab92487ca1e44e4c4cd9daa07",
      "old_mode": 33188,
      "old_path": "bgpd/bgp_route.c",
      "new_id": "b581fd9908828dbb0a641494935caa4ede09c8b4",
      "new_mode": 33188,
      "new_path": "bgpd/bgp_route.c"
    },
    {
      "type": "modify",
      "old_id": "c16eca7bb3288556939bf2a4165bdc7405d9444a",
      "old_mode": 33188,
      "old_path": "bgpd/bgp_route.h",
      "new_id": "8064598c46d71549310410bf80ace6ada47f9c76",
      "new_mode": 33188,
      "new_path": "bgpd/bgp_route.h"
    },
    {
      "type": "modify",
      "old_id": "39f3b0da12f2b8315031ac71e23b8ace87ed7c40",
      "old_mode": 33188,
      "old_path": "tests/bgp_mp_attr_test.c",
      "new_id": "5400dd17929ef1e78d032acdb64619227b902dd5",
      "new_mode": 33188,
      "new_path": "tests/bgp_mp_attr_test.c"
    }
  ]
}
