diff options
author | Jarno Rajahalme <jarno@ovn.org> | 2017-02-17 21:11:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-20 10:18:43 -0500 |
commit | 2317c6b51e4249dbfa093e1b88cab0a9f0564b7f (patch) | |
tree | f3eb28d5928cdf21df39b4ea2d11e5b822b9997e /net | |
parent | 5ed3fea0d6ffcef494b111ade0910a4ff149c331 (diff) |
openvswitch: Set event bit after initializing labels.
Connlabels are included in conntrack netlink event messages only if
the IPCT_LABEL bit is set in the event cache (see
ctnetlink_conntrack_event()). Set it after initializing labels for a
new connection.
Found upon further system testing, where it was noticed that labels
were missing from the conntrack events.
Fixes: 193e30967897 ("openvswitch: Do not trigger events for unconfirmed connections.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/openvswitch/conntrack.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c index c2d452eab0c5..85cd59526670 100644 --- a/net/openvswitch/conntrack.c +++ b/net/openvswitch/conntrack.c | |||
@@ -339,9 +339,7 @@ static struct nf_conn_labels *ovs_ct_get_conn_labels(struct nf_conn *ct) | |||
339 | 339 | ||
340 | /* Initialize labels for a new, yet to be committed conntrack entry. Note that | 340 | /* Initialize labels for a new, yet to be committed conntrack entry. Note that |
341 | * since the new connection is not yet confirmed, and thus no-one else has | 341 | * since the new connection is not yet confirmed, and thus no-one else has |
342 | * access to it's labels, we simply write them over. Also, we refrain from | 342 | * access to it's labels, we simply write them over. |
343 | * triggering events, as receiving change events before the create event would | ||
344 | * be confusing. | ||
345 | */ | 343 | */ |
346 | static int ovs_ct_init_labels(struct nf_conn *ct, struct sw_flow_key *key, | 344 | static int ovs_ct_init_labels(struct nf_conn *ct, struct sw_flow_key *key, |
347 | const struct ovs_key_ct_labels *labels, | 345 | const struct ovs_key_ct_labels *labels, |
@@ -374,6 +372,11 @@ static int ovs_ct_init_labels(struct nf_conn *ct, struct sw_flow_key *key, | |||
374 | & mask->ct_labels_32[i]); | 372 | & mask->ct_labels_32[i]); |
375 | } | 373 | } |
376 | 374 | ||
375 | /* Labels are included in the IPCTNL_MSG_CT_NEW event only if the | ||
376 | * IPCT_LABEL bit it set in the event cache. | ||
377 | */ | ||
378 | nf_conntrack_event_cache(IPCT_LABEL, ct); | ||
379 | |||
377 | memcpy(&key->ct.labels, cl->bits, OVS_CT_LABELS_LEN); | 380 | memcpy(&key->ct.labels, cl->bits, OVS_CT_LABELS_LEN); |
378 | 381 | ||
379 | return 0; | 382 | return 0; |