[ovs-dev] [PATCH] ofp-print: Don't abort on unknown reason in role status message.

Ben Pfaff blp at ovn.org
Fri May 26 20:22:26 UTC 2017


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 at sec.t-labs.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 lib/ofp-print.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/ofp-print.c b/lib/ofp-print.c
index 7ca953100539..1932baf4871f 100644
--- a/lib/ofp-print.c
+++ b/lib/ofp-print.c
@@ -2147,7 +2147,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;
     }
 }
 
-- 
2.10.2



More information about the dev mailing list