datapath: Fix output of SCTP mask.
authorJarno Rajahalme <jrajahalme@nicira.com>
Tue, 18 Mar 2014 23:32:45 +0000 (16:32 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Mon, 24 Mar 2014 16:50:50 +0000 (09:50 -0700)
The 'output' argument of the ovs_nla_put_flow() is the one from which
the bits are written to the netlink attributes.  For SCTP we
accidentally used the bits from the 'swkey' instead.  This caused the
mask attributes to include the bits from the actual flow key instead
of the mask.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
datapath/flow_netlink.c

index 4c68a68..a70acfc 100644 (file)
@@ -1060,11 +1060,11 @@ int ovs_nla_put_flow(const struct sw_flow_key *swkey,
                                goto nla_put_failure;
                        sctp_key = nla_data(nla);
                        if (swkey->eth.type == htons(ETH_P_IP)) {
-                               sctp_key->sctp_src = swkey->ipv4.tp.src;
-                               sctp_key->sctp_dst = swkey->ipv4.tp.dst;
+                               sctp_key->sctp_src = output->ipv4.tp.src;
+                               sctp_key->sctp_dst = output->ipv4.tp.dst;
                        } else if (swkey->eth.type == htons(ETH_P_IPV6)) {
-                               sctp_key->sctp_src = swkey->ipv6.tp.src;
-                               sctp_key->sctp_dst = swkey->ipv6.tp.dst;
+                               sctp_key->sctp_src = output->ipv6.tp.src;
+                               sctp_key->sctp_dst = output->ipv6.tp.dst;
                        }
                } else if (swkey->eth.type == htons(ETH_P_IP) &&
                           swkey->ip.proto == IPPROTO_ICMP) {