]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: attr_parse call to attr_malformed should deal with PROCEED error case
authorPaul Jakma <paul@quagga.net>
Sun, 25 Mar 2012 20:31:47 +0000 (21:31 +0100)
committerPaul Jakma <paul@quagga.net>
Tue, 27 Mar 2012 10:48:38 +0000 (11:48 +0100)
* 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.

bgpd/bgp_attr.c

index 66704169e709b38a6ab7fe0f9675fd8c451522f3..c21655c0725afaf6380b7d3bb26241d7efd2e0e6 100644 (file)
@@ -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)