meta-flow: Reduce redundant transport set/get code
authorJoe Stringer <joe@wand.net.nz>
Wed, 11 Jul 2012 23:07:15 +0000 (11:07 +1200)
committerBen Pfaff <blp@nicira.com>
Thu, 12 Jul 2012 00:24:41 +0000 (17:24 -0700)
Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/meta-flow.c

index 8e7d4fc8ae50d698d5f28d07340296bacb120f1b..8ba21fc11f5464c5a61fd312400d28d0c3967d71 100644 (file)
@@ -998,17 +998,11 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
         break;
 
     case MFF_TCP_SRC:
-        value->be16 = flow->tp_src;
-        break;
-
-    case MFF_TCP_DST:
-        value->be16 = flow->tp_dst;
-        break;
-
     case MFF_UDP_SRC:
         value->be16 = flow->tp_src;
         break;
 
+    case MFF_TCP_DST:
     case MFF_UDP_DST:
         value->be16 = flow->tp_dst;
         break;
@@ -1143,17 +1137,11 @@ mf_set_value(const struct mf_field *mf,
         break;
 
     case MFF_TCP_SRC:
-        cls_rule_set_tp_src(rule, value->be16);
-        break;
-
-    case MFF_TCP_DST:
-        cls_rule_set_tp_dst(rule, value->be16);
-        break;
-
     case MFF_UDP_SRC:
         cls_rule_set_tp_src(rule, value->be16);
         break;
 
+    case MFF_TCP_DST:
     case MFF_UDP_DST:
         cls_rule_set_tp_dst(rule, value->be16);
         break;