diff options
author | Joe Stringer <joestringer@nicira.com> | 2015-10-19 22:18:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-21 22:33:40 -0400 |
commit | 4f0909ee3d8e3514a274121f3bf217a4920fa12d (patch) | |
tree | fc2ed5af16d4d1f0d1061e6d6304eac2d9c7f181 /net/openvswitch/conntrack.c | |
parent | 1d008a1df927846788b9dc02e770f65951f98ddc (diff) |
openvswitch: Mark connections new when not confirmed.
New, related connections are marked as such as part of ovs_ct_lookup(),
but they are not marked as "new" if the commit flag is used. Make this
consistent by setting the "new" flag whenever !nf_ct_is_confirmed(ct).
Reported-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/conntrack.c')
-rw-r--r-- | net/openvswitch/conntrack.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index 80bf702715bb..8ad121871834 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c | |||
@@ -151,6 +151,8 @@ static void ovs_ct_update_key(const struct sk_buff *skb, | |||
151 | ct = nf_ct_get(skb, &ctinfo); | 151 | ct = nf_ct_get(skb, &ctinfo); |
152 | if (ct) { | 152 | if (ct) { |
153 | state = ovs_ct_get_state(ctinfo); | 153 | state = ovs_ct_get_state(ctinfo); |
154 | if (!nf_ct_is_confirmed(ct)) | ||
155 | state |= OVS_CS_F_NEW; | ||
154 | if (ct->master) | 156 | if (ct->master) |
155 | state |= OVS_CS_F_RELATED; | 157 | state |= OVS_CS_F_RELATED; |
156 | zone = nf_ct_zone(ct); | 158 | zone = nf_ct_zone(ct); |
@@ -377,7 +379,7 @@ static bool skb_nfct_cached(const struct net *net, const struct sk_buff *skb, | |||
377 | return true; | 379 | return true; |
378 | } | 380 | } |
379 | 381 | ||
380 | static int __ovs_ct_lookup(struct net *net, const struct sw_flow_key *key, | 382 | static int __ovs_ct_lookup(struct net *net, struct sw_flow_key *key, |
381 | const struct ovs_conntrack_info *info, | 383 | const struct ovs_conntrack_info *info, |
382 | struct sk_buff *skb) | 384 | struct sk_buff *skb) |
383 | { | 385 | { |
@@ -408,6 +410,8 @@ static int __ovs_ct_lookup(struct net *net, const struct sw_flow_key *key, | |||
408 | } | 410 | } |
409 | } | 411 | } |
410 | 412 | ||
413 | ovs_ct_update_key(skb, key, true); | ||
414 | |||
411 | return 0; | 415 | return 0; |
412 | } | 416 | } |
413 | 417 | ||
@@ -430,8 +434,6 @@ static int ovs_ct_lookup(struct net *net, struct sw_flow_key *key, | |||
430 | err = __ovs_ct_lookup(net, key, info, skb); | 434 | err = __ovs_ct_lookup(net, key, info, skb); |
431 | if (err) | 435 | if (err) |
432 | return err; | 436 | return err; |
433 | |||
434 | ovs_ct_update_key(skb, key, true); | ||
435 | } | 437 | } |
436 | 438 | ||
437 | return 0; | 439 | return 0; |
@@ -460,8 +462,6 @@ static int ovs_ct_commit(struct net *net, struct sw_flow_key *key, | |||
460 | if (nf_conntrack_confirm(skb) != NF_ACCEPT) | 462 | if (nf_conntrack_confirm(skb) != NF_ACCEPT) |
461 | return -EINVAL; | 463 | return -EINVAL; |
462 | 464 | ||
463 | ovs_ct_update_key(skb, key, true); | ||
464 | |||
465 | return 0; | 465 | return 0; |
466 | } | 466 | } |
467 | 467 | ||