提交 50e6fb5c 编写于 作者: X Xin Long 提交者: Jakub Kicinski

ipvlan: use skb_ip_totlen in ipvlan_get_L3_hdr

ipvlan devices calls netif_inherit_tso_max() to get the tso_max_size/segs
from the lower device, so when lower device supports BIG TCP, the ipvlan
devices support it too. We also should consider its iph tot_len accessing.
Signed-off-by: NXin Long <lucien.xin@gmail.com>
Reviewed-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 7eb072be
...@@ -157,7 +157,7 @@ void *ipvlan_get_L3_hdr(struct ipvl_port *port, struct sk_buff *skb, int *type) ...@@ -157,7 +157,7 @@ void *ipvlan_get_L3_hdr(struct ipvl_port *port, struct sk_buff *skb, int *type)
return NULL; return NULL;
ip4h = ip_hdr(skb); ip4h = ip_hdr(skb);
pktlen = ntohs(ip4h->tot_len); pktlen = skb_ip_totlen(skb);
if (ip4h->ihl < 5 || ip4h->version != 4) if (ip4h->ihl < 5 || ip4h->version != 4)
return NULL; return NULL;
if (skb->len < pktlen || pktlen < (ip4h->ihl * 4)) if (skb->len < pktlen || pktlen < (ip4h->ihl * 4))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册