[ovs-dev] [PATCH] meta-flow: Slightly simplify usable_protocols selection in mf_set()

Simon Horman simon.horman at netronome.com
Tue Nov 4 06:13:21 UTC 2014


If usable_protocols_bitwise and usable_protocols_cidr are equal
then it does not matter which one is returned. This leads to
a slight simplification of the selection logic.

Signed-off-by: Simon Horman <simon.horman at netronome.com>
---
 lib/meta-flow.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/meta-flow.c b/lib/meta-flow.c
index ddf0431..bfdae2f 100644
--- a/lib/meta-flow.c
+++ b/lib/meta-flow.c
@@ -1519,8 +1519,7 @@ mf_set(const struct mf_field *mf,
         OVS_NOT_REACHED();
     }
 
-    return ((mf->usable_protocols_bitwise == mf->usable_protocols_cidr
-             || ip_is_cidr(mask->be32))
+    return (ip_is_cidr(mask->be32)
             ? mf->usable_protocols_cidr
             : mf->usable_protocols_bitwise);
 }
-- 
2.1.1




More information about the dev mailing list