diff options
author | Jarno Rajahalme <jarno@ovn.org> | 2017-03-09 14:09:08 -0800 |
---|---|---|
committer | Jarno Rajahalme <jarno@ovn.org> | 2017-03-09 14:09:08 -0800 |
commit | e7237700d0870eead0435d77340fb1ee0ff9d40f (patch) | |
tree | edf2618833d8db096087cfa6ba1680f7e26260f2 /lib | |
parent | 2e0b0a4ace8e77e804118e5875c0d81b3e63bd08 (diff) | |
download | openvswitch-e7237700d0870eead0435d77340fb1ee0ff9d40f.tar.gz |
lib: Indicate if netlink message had labels.
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.
Fixes: 6830a0c0e6bf ("netlink-conntrack: New module.")
Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
Acked-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ct-dpif.h | 1 | ||||
-rw-r--r-- | lib/netlink-conntrack.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/ct-dpif.h b/lib/ct-dpif.h index 5da3c2c8e..e8e159a75 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 aab5b1ffd..8b82db2af 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]))); } |