diff options
author | Yifeng Sun <pkusunyifeng@gmail.com> | 2019-01-31 15:10:00 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2019-02-04 13:37:48 -0800 |
commit | 7c5793e62a024c16a2151a13be91a86b49c10779 (patch) | |
tree | 78fdffc0f6222330e29b5637628b0ab900f37062 | |
parent | fcfd14ce3ae272cc24a786408e12d04e53cf6cdb (diff) | |
download | openvswitch-7c5793e62a024c16a2151a13be91a86b49c10779.tar.gz |
dpif-netlink: Fix a bug that causes duplicate key error in datapath
Kmod tests 122 and 123 failed and kernel reports a "Duplicate key of
type 6" error. Further debugging reveals that nl_attr_find__() should
start looking for OVS_KEY_ATTR_ETHERTYPE from offset returned by
a previous called nl_msg_start_nested(). This patch fixes it.
Tests 122 and 123 were skipped by kernel 4.15 and older versions.
Kernel 4.16 and later kernels start showing this failure.
Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r-- | lib/dpif-netlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index dfa9d9199..e23a35da4 100644 --- a/lib/dpif-netlink.c +++ b/lib/dpif-netlink.c @@ -3925,7 +3925,7 @@ put_exclude_packet_type(struct ofpbuf *buf, uint16_t type, ovs_be16 pt = pt_ns_type_be(nl_attr_get_be32(packet_type)); const struct nlattr *nla; - nla = nl_attr_find(buf, NLA_HDRLEN, OVS_KEY_ATTR_ETHERTYPE); + nla = nl_attr_find(buf, ofs + NLA_HDRLEN, OVS_KEY_ATTR_ETHERTYPE); if (nla) { ovs_be16 *ethertype; |