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:42 -0700 |
commit | 7d04a345e72f1a382edf0f45bbc1cb930ac556ea (patch) | |
tree | eaa0b3e3a24e2b1befa1285e96ebeb128f87f0c5 | |
parent | 89ff509cb16e3df69c42ba72d08d822c570bd183 (diff) | |
download | openvswitch-7d04a345e72f1a382edf0f45bbc1cb930ac556ea.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 75146f371..3b50ca6e2 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -4718,6 +4718,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)) { |