[ovs-dev] [PATCH 3/3] ofp-util: Log the type of an invalid message being added to a bundle.

Ben Pfaff blp at nicira.com
Mon Jul 6 17:20:23 UTC 2015


This makes troubleshooting easier.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/ofp-util.c     | 2 ++
 tests/ofp-print.at | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index d02ee3a..646bae7 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -9119,6 +9119,8 @@ ofputil_decode_bundle_add(const struct ofp_header *oh,
     }
 
     if (!ofputil_is_bundlable(*type_ptr)) {
+        VLOG_WARN_RL(&bad_ofmsg_rl, "%s message not allowed inside "
+                     "OFPT14_BUNDLE_ADD_MESSAGE", ofptype_get_name(*type_ptr));
         return OFPERR_OFPBFC_MSG_UNSUP;
     }
 
diff --git a/tests/ofp-print.at b/tests/ofp-print.at
index 83c7b9e..6e11150 100644
--- a/tests/ofp-print.at
+++ b/tests/ofp-print.at
@@ -3247,11 +3247,13 @@ AT_CLEANUP
 
 AT_SETUP([OFPT_BUNDLE_ADD_MESSAGE - reject OFPT_HELLO])
 AT_KEYWORDS([ofp-print])
-AT_CHECK([ovs-ofctl ofp-print "\
+AT_CHECK([ovs-ofctl '-vPATTERN:console:%c|%p|%m' ofp-print "\
 05 22 00 20 00 00 00 00 00 00 00 01 00 00 00 01 \
 05 00 00 10 00 00 00 00 00 00 00 00 00 00 00 00 \
 "], [0], [dnl
 OFPT_BUNDLE_ADD_MESSAGE (OF1.4) (xid=0x0): ***decode error: OFPBFC_MSG_UNSUP***
+], [dnl
+ofp_util|WARN|OFPT_HELLO message not allowed inside OFPT14_BUNDLE_ADD_MESSAGE
 ])
 AT_CLEANUP
 
-- 
2.1.3




More information about the dev mailing list