summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2012-03-25 21:31:47 +0100
committerPaul Jakma <paul@quagga.net>2012-03-27 11:48:38 +0100
commitfa61e16ddebe10a71d98bcd2eba0f630071ea4a7 (patch)
treebc301257fdb4dbac4aedf1e17ffa3e6c00a77612 /bgpd
parent683f2b86d89fa356d3d1f7a54b0c269baa38b836 (diff)
bgpd: attr_parse call to attr_malformed should deal with PROCEED error case
* bgpd/bgp_attr.c: (bgp_attr_parse) the invalid flag check call to bgp_attr_malformed is pretty useless if it doesn't actually allow for the PROCEED non-error case.
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_attr.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 66704169..c21655c0 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -738,10 +738,10 @@ bgp_attr_malformed (struct bgp_attr_parser_args *args, u_char subcode,
+ args->total);
switch (args->type) {
- /* where an optional attribute is inconsequential, e.g. it does not affect
- * route selection, and can be safely ignored then any such attributes
- * which are malformed should just be ignored and the route processed as
- * normal.
+ /* where an attribute is relatively inconsequential, e.g. it does not
+ * affect route selection, and can be safely ignored, then any such
+ * attributes which are malformed should just be ignored and the route
+ * processed as normal.
*/
case BGP_ATTR_AS4_AGGREGATOR:
case BGP_ATTR_AGGREGATOR:
@@ -749,7 +749,7 @@ bgp_attr_malformed (struct bgp_attr_parser_args *args, u_char subcode,
return BGP_ATTR_PARSE_PROCEED;
/* Core attributes, particularly ones which may influence route
- * selection should always cause session resets
+ * selection, should always cause session resets
*/
case BGP_ATTR_ORIGIN:
case BGP_ATTR_AS_PATH:
@@ -1823,9 +1823,15 @@ bgp_attr_parse (struct peer *peer, struct attr *attr, bgp_size_t size,
Attribute Flags Error. The Data field contains the erroneous
attribute (type, length and value). */
if (bgp_attr_flag_invalid (&attr_args))
- return bgp_attr_malformed (&attr_args,
- BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR,
- attr_args.total);
+ {
+ bgp_attr_parse_ret_t ret;
+ ret = bgp_attr_malformed (&attr_args,
+ BGP_NOTIFY_UPDATE_ATTR_FLAG_ERR,
+ attr_args.total);
+ if (ret == BGP_ATTR_PARSE_PROCEED)
+ continue;
+ return ret;
+ }
/* OK check attribute and store it's value. */
switch (type)