]> git.karo-electronics.de Git - linux-beck.git/commitdiff
openvswitch: Fix output of SCTP mask.
authorJarno Rajahalme <jrajahalme@nicira.com>
Thu, 27 Mar 2014 19:47:11 +0000 (12:47 -0700)
committerJesse Gross <jesse@nicira.com>
Fri, 16 May 2014 20:40:29 +0000 (13:40 -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>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
net/openvswitch/flow_netlink.c

index 84caa99b37690ac7246ba6bce294f6091fc5fb44..32a725cfeb0e83d06b812a13ae3f827a0d65b36c 100644 (file)
@@ -1059,11 +1059,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) {