]> git.proxmox.com Git - ovs.git/commitdiff
ofp-print: Don't abort on unknown reason in role status message.
authorBen Pfaff <blp@ovn.org>
Fri, 26 May 2017 20:22:26 +0000 (13:22 -0700)
committerBen Pfaff <blp@ovn.org>
Fri, 7 Jul 2017 17:57:52 +0000 (10:57 -0700)
A buggy or malicious switch could send a role status message with a bad
reason code, which if printed by OVS would cause it to abort.  This fixes
the problem.

Reported-by: Bhargava Shastry <bshastry@sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>
lib/ofp-print.c

index 4370cb5221fc6ff1f8902c08a511f3a7d4c556ed..7e3000f776bd4d0798fc0f5165cd5f977490bfc4 100644 (file)
@@ -2180,7 +2180,8 @@ ofp_print_role_status_message(struct ds *string, const struct ofp_header *oh)
         break;
     case OFPCRR_N_REASONS:
     default:
-        OVS_NOT_REACHED();
+        ds_put_cstr(string, "(unknown)");
+        break;
     }
 }