From ebeef5b165fff88eff987628b5d849a6bffd017b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 26 May 2017 13:22:26 -0700 Subject: [PATCH] ofp-print: Don't abort on unknown reason in role status message. 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 Signed-off-by: Ben Pfaff Acked-by: Yi-Hung Wei --- 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 c03af61c3f..796039e728 100644 --- a/lib/ofp-print.c +++ b/lib/ofp-print.c @@ -2098,7 +2098,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; } }