mirror of
https://github.com/openvswitch/ovs
synced 2025-10-27 15:18:06 +00:00
datapath: fix size of struct ovs_gso_cb
struct ovs_gso_cb is stored in skb->cd. avoid going beyond size of skb->cb. Signed-off-by: Pravin B Shelar <pshelar@ovn.org> Acked-by: Jesse Gross <jesse@kernel.org>
This commit is contained in:
@@ -171,6 +171,7 @@ static struct sk_buff *tnl_skb_gso_segment(struct sk_buff *skb,
|
||||
__be16 proto = skb->protocol;
|
||||
char cb[sizeof(skb->cb)];
|
||||
|
||||
BUILD_BUG_ON(sizeof(struct ovs_gso_cb) > FIELD_SIZEOF(struct sk_buff, cb));
|
||||
OVS_GSO_CB(skb)->ipv6 = (sa_family == AF_INET6);
|
||||
/* setup whole inner packet to get protocol. */
|
||||
__skb_pull(skb, mac_offset);
|
||||
|
||||
@@ -14,6 +14,7 @@ struct ovs_gso_cb {
|
||||
#ifndef USE_UPSTREAM_TUNNEL_GSO
|
||||
gso_fix_segment_t fix_segment;
|
||||
#endif
|
||||
bool ipv6;
|
||||
#ifndef HAVE_INNER_PROTOCOL
|
||||
__be16 inner_protocol;
|
||||
#endif
|
||||
@@ -21,7 +22,6 @@ struct ovs_gso_cb {
|
||||
/* Keep original tunnel info during userspace action execution. */
|
||||
struct metadata_dst *fill_md_dst;
|
||||
#endif
|
||||
bool ipv6;
|
||||
};
|
||||
#define OVS_GSO_CB(skb) ((struct ovs_gso_cb *)(skb)->cb)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user