diff options
author | Ben Pfaff <blp@ovn.org> | 2018-09-06 15:42:06 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-09-12 14:28:30 -0700 |
commit | 2c9103b402fd6a576684a280818fd9c5a2c05b37 (patch) | |
tree | d60f3c1e8a92be442c37deb35a2b738cef011297 | |
parent | 1b48a61d9238f66896ee8eba3a7d86a1695a1efb (diff) | |
download | openvswitch-2c9103b402fd6a576684a280818fd9c5a2c05b37.tar.gz |
odp-util: Don't attempt to write IPv6 flow label bits that don't exist.
The ipv6_label field member of struct ovs_key_ipv6 is 32 bits in size,
but an IPv6 label is only 20 bits, so the upper 12 bits are not writable
and must be 0 in the mask. The code wasn't careful about this so it could
try to write them anyway. This commit fixes the problem.
Reported-by: nm_r@directbox.com
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-September/047357.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
-rw-r--r-- | lib/odp-util.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/odp-util.c b/lib/odp-util.c index e601c83fe..4ced1dde5 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -5271,6 +5271,7 @@ commit_set_ipv6_action(const struct flow *flow, struct flow *base_flow, get_ipv6_key(&wc->masks, &mask, true); mask.ipv6_proto = 0; /* Not writeable. */ mask.ipv6_frag = 0; /* Not writable. */ + mask.ipv6_label &= htonl(IPV6_LABEL_MASK); /* Not writable. */ if (commit(OVS_KEY_ATTR_IPV6, use_masked, &key, &base, &mask, sizeof key, odp_actions)) { |