diff options
| author | Simon Horman <horms@verge.net.au> | 2011-02-07 11:07:14 +0900 |
|---|---|---|
| committer | Jesse Gross <jesse@nicira.com> | 2011-02-07 15:36:41 -0800 |
| commit | a4a2643672e4d2f68f8246e406749009a3f3211b (patch) | |
| tree | 6520e104dc440a2fa80acc30d316541638f7092d /datapath | |
| parent | f4709d4d7c2dfd4a599d8290747f4f3a7ac0cb54 (diff) | |
| download | openvswitch-a4a2643672e4d2f68f8246e406749009a3f3211b.tar.gz | |
datapath: Clear rxhash when using an action that may affect it
Signed-off-by: Simon Horman <horms@verge.net.au>
[Jesse: Change version check from 2.6.37 to 2.6.35]
Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath')
| -rw-r--r-- | datapath/actions.c | 3 | ||||
| -rw-r--r-- | datapath/actions.h | 7 | ||||
| -rw-r--r-- | datapath/tunnel.c | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/datapath/actions.c b/datapath/actions.c index 893937710..c44e00c4c 100644 --- a/datapath/actions.c +++ b/datapath/actions.c @@ -158,6 +158,8 @@ static struct sk_buff *set_nw_addr(struct sk_buff *skb, inet_proto_csum_replace4(check, skb, *nwaddr, new_nwaddr, 1); csum_replace4(&nh->check, *nwaddr, new_nwaddr); + skb_clear_rxhash(skb); + *nwaddr = new_nwaddr; return skb; @@ -217,6 +219,7 @@ static struct sk_buff *set_tp_port(struct sk_buff *skb, port = nla_type(a) == ODP_ACTION_ATTR_SET_TP_SRC ? &th->source : &th->dest; inet_proto_csum_replace2(check, skb, *port, nla_get_be16(a), 0); *port = nla_get_be16(a); + skb_clear_rxhash(skb); return skb; } diff --git a/datapath/actions.h b/datapath/actions.h index 5ad322f75..3348ae2c2 100644 --- a/datapath/actions.h +++ b/datapath/actions.h @@ -20,4 +20,11 @@ int execute_actions(struct datapath *dp, struct sk_buff *skb, const struct sw_flow_key *, const struct nlattr *, u32 actions_len); +static inline void skb_clear_rxhash(struct sk_buff *skb) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35) + skb->rxhash = 0; +#endif +} + #endif /* actions.h */ diff --git a/datapath/tunnel.c b/datapath/tunnel.c index 4cabd93c5..a0d9fd959 100644 --- a/datapath/tunnel.c +++ b/datapath/tunnel.c @@ -436,6 +436,7 @@ void tnl_rcv(struct vport *vport, struct sk_buff *skb) skb_dst_drop(skb); nf_reset(skb); + skb_clear_rxhash(skb); secpath_reset(skb); ecn_decapsulate(skb); @@ -1203,6 +1204,7 @@ int tnl_send(struct vport *vport, struct sk_buff *skb) nf_reset(skb); secpath_reset(skb); skb_dst_drop(skb); + skb_clear_rxhash(skb); /* Offloading */ skb = handle_offloads(skb, mutable, rt); |
