diff mbox

[ovs-dev] lib: Indicate if netlink message had labels.

Message ID 1489022270-116348-1-git-send-email-jarno@ovn.org
State Accepted
Headers show

Commit Message

Jarno Rajahalme March 9, 2017, 1:17 a.m. UTC
Conntrack update events include labels only if they have changed.
Record the presence of labels in the netlink message to OVS internal
representation, so that the user may keep the old labels when an
update does not modify them.

Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
---
 lib/ct-dpif.h           | 1 +
 lib/netlink-conntrack.c | 1 +
 2 files changed, 2 insertions(+)

Comments

Joe Stringer March 9, 2017, 10:10 p.m. UTC | #1
On 8 March 2017 at 17:17, Jarno Rajahalme <jarno@ovn.org> wrote:
> Conntrack update events include labels only if they have changed.
> Record the presence of labels in the netlink message to OVS internal
> representation, so that the user may keep the old labels when an
> update does not modify them.
>
> Signed-off-by: Jarno Rajahalme <jarno@ovn.org>

It looks like this is a bug that is being fixed, would you mind adding
the "Fixes: ..." tag?

Acked-by: Joe Stringer <joe@ovn.org>
Jarno Rajahalme March 9, 2017, 10:13 p.m. UTC | #2
> On Mar 9, 2017, at 2:10 PM, Joe Stringer <joe@ovn.org> wrote:
> 
> On 8 March 2017 at 17:17, Jarno Rajahalme <jarno@ovn.org> wrote:
>> Conntrack update events include labels only if they have changed.
>> Record the presence of labels in the netlink message to OVS internal
>> representation, so that the user may keep the old labels when an
>> update does not modify them.
>> 
>> Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
> 
> It looks like this is a bug that is being fixed, would you mind adding
> the "Fixes: ..." tag?
> 
> Acked-by: Joe Stringer <joe@ovn.org>

Pushed to master with the Fixes: tag, thanks for the quick review!

  Jarno
Joe Stringer March 9, 2017, 10:28 p.m. UTC | #3
On 9 March 2017 at 14:13, Jarno Rajahalme <jarno@ovn.org> wrote:
>
>> On Mar 9, 2017, at 2:10 PM, Joe Stringer <joe@ovn.org> wrote:
>>
>> On 8 March 2017 at 17:17, Jarno Rajahalme <jarno@ovn.org> wrote:
>>> Conntrack update events include labels only if they have changed.
>>> Record the presence of labels in the netlink message to OVS internal
>>> representation, so that the user may keep the old labels when an
>>> update does not modify them.
>>>
>>> Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
>>
>> It looks like this is a bug that is being fixed, would you mind adding
>> the "Fixes: ..." tag?
>>
>> Acked-by: Joe Stringer <joe@ovn.org>
>
> Pushed to master with the Fixes: tag, thanks for the quick review!

By the way, Fixes tag is useful for figuring out which other branches
it also affects - could you check whether it's appropriate to backport
and which branches?
diff mbox

Patch

diff --git a/lib/ct-dpif.h b/lib/ct-dpif.h
index 5da3c2c..e8e159a 100644
--- a/lib/ct-dpif.h
+++ b/lib/ct-dpif.h
@@ -163,6 +163,7 @@  struct ct_dpif_entry {
     struct ct_dpif_protoinfo protoinfo;
 
     ovs_u128 labels;
+    bool have_labels;
     uint32_t status;
     /* Timeout for this entry in seconds */
     uint32_t timeout;
diff --git a/lib/netlink-conntrack.c b/lib/netlink-conntrack.c
index aab5b1f..8b82db2 100644
--- a/lib/netlink-conntrack.c
+++ b/lib/netlink-conntrack.c
@@ -780,6 +780,7 @@  nl_ct_attrs_to_ct_dpif_entry(struct ct_dpif_entry *entry,
         entry->mark = ntohl(nl_attr_get_be32(attrs[CTA_MARK]));
     }
     if (attrs[CTA_LABELS]) {
+        entry->have_labels = true;
         memcpy(&entry->labels, nl_attr_get(attrs[CTA_LABELS]),
                MIN(sizeof entry->labels, nl_attr_get_size(attrs[CTA_LABELS])));
     }