projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
datapath: Use ipv4_dst_hoplimit() instead of direct access.
[openvswitch]
/
datapath
/
datapath.c
diff --git
a/datapath/datapath.c
b/datapath/datapath.c
index 69b524c548f8612717b7e0b83b185a1e3bfb242b..8a55001254e8e9488553a634068cc4763e3a615c 100644
(file)
--- a/
datapath/datapath.c
+++ b/
datapath/datapath.c
@@
-359,7
+359,6
@@
static void copy_and_csum_skb(struct sk_buff *skb, void *to)
get_skb_csum_pointers(skb, &csum_start, &csum_offset);
csum_start -= skb_headroom(skb);
get_skb_csum_pointers(skb, &csum_start, &csum_offset);
csum_start -= skb_headroom(skb);
- BUG_ON(csum_start >= skb_headlen(skb));
skb_copy_bits(skb, 0, to, csum_start);
skb_copy_bits(skb, 0, to, csum_start);
@@
-492,6
+491,9
@@
static int queue_control_packets(struct datapath *dp, struct sk_buff *skb,
if (unlikely(err))
goto err_kfree_skbs;
if (unlikely(err))
goto err_kfree_skbs;
+ if (nla_attr_size(skb->len) > USHRT_MAX)
+ goto err_kfree_skbs;
+
len = sizeof(struct odp_header);
len += nla_total_size(skb->len);
len += nla_total_size(FLOW_BUFSIZE);
len = sizeof(struct odp_header);
len += nla_total_size(skb->len);
len += nla_total_size(FLOW_BUFSIZE);
@@
-709,13
+711,13
@@
static int odp_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
else
packet->protocol = htons(ETH_P_802_2);
else
packet->protocol = htons(ETH_P_802_2);
+ /* Initialize OVS_CB (it came from Netlink so might not be zeroed). */
+ memset(OVS_CB(packet), 0, sizeof(struct ovs_skb_cb));
+
err = flow_extract(packet, -1, &key, &is_frag);
if (err)
goto exit;
err = flow_extract(packet, -1, &key, &is_frag);
if (err)
goto exit;
- /* Initialize OVS_CB (it came from Netlink so might not be zeroed). */
- memset(OVS_CB(packet), 0, sizeof(struct ovs_skb_cb));
-
rcu_read_lock();
dp = get_dp(odp_header->dp_ifindex);
err = -ENODEV;
rcu_read_lock();
dp = get_dp(odp_header->dp_ifindex);
err = -ENODEV;
@@
-1302,7
+1304,7
@@
static int odp_dp_cmd_validate(struct nlattr *a[ODP_DP_ATTR_MAX + 1])
return -EINVAL;
}
return -EINVAL;
}
- return
VERIFY
_NUL_STRING(a[ODP_DP_ATTR_NAME], IFNAMSIZ - 1);
+ return
CHECK
_NUL_STRING(a[ODP_DP_ATTR_NAME], IFNAMSIZ - 1);
}
/* Called with genl_mutex and optionally with RTNL lock also. */
}
/* Called with genl_mutex and optionally with RTNL lock also. */
@@
-1672,7
+1674,7
@@
static struct sk_buff *odp_vport_cmd_build_info(struct vport *vport, u32 pid,
static int odp_vport_cmd_validate(struct nlattr *a[ODP_VPORT_ATTR_MAX + 1])
{
static int odp_vport_cmd_validate(struct nlattr *a[ODP_VPORT_ATTR_MAX + 1])
{
- return
VERIFY
_NUL_STRING(a[ODP_VPORT_ATTR_NAME], IFNAMSIZ - 1);
+ return
CHECK
_NUL_STRING(a[ODP_VPORT_ATTR_NAME], IFNAMSIZ - 1);
}
/* Called with RTNL lock or RCU read lock. */
}
/* Called with RTNL lock or RCU read lock. */