[ovs-dev] [PATCH] tc: Fix build breakage on GCC 7 by annotating fall-through.

Ben Pfaff blp at ovn.org
Mon Nov 27 00:26:50 UTC 2017


Open vSwitch enables the GCC 7+ option that warns about fall-through
switch statements.  This commit fixes newly introduced warnings.

CC: Paul Blakey <paulb at mellanox.com>
Fixes: d6118e628988 ("netdev-tc-offloads: Verify csum flags on dump from tc")
Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 lib/tc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/tc.c b/lib/tc.c
index d3a031237ab1..bfe20ce1a3bd 100644
--- a/lib/tc.c
+++ b/lib/tc.c
@@ -1250,6 +1250,7 @@ csum_update_flag(struct tc_flower *flower,
     switch (htype) {
     case TCA_PEDIT_KEY_EX_HDR_TYPE_IP4:
         flower->csum_update_flags |= TCA_CSUM_UPDATE_FLAG_IPV4HDR;
+        /* Fall through. */
     case TCA_PEDIT_KEY_EX_HDR_TYPE_IP6:
     case TCA_PEDIT_KEY_EX_HDR_TYPE_TCP:
     case TCA_PEDIT_KEY_EX_HDR_TYPE_UDP:
@@ -1269,6 +1270,7 @@ csum_update_flag(struct tc_flower *flower,
                          flower->key.ip_proto);
             break;
         }
+        /* Fall through. */
     case TCA_PEDIT_KEY_EX_HDR_TYPE_ETH:
         return 0; /* success */
 
-- 
2.10.2



More information about the dev mailing list