mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
netfilter: flowtable: ensure sufficient headroom in xmit path
commitef4f741e86upstream. Check for headroom and call skb_expand_head() like in the IP output path to ensure there is sufficient headroom for the mac header when forwarding this packet as suggested by sashiko. Fixes:b5964aac51("netfilter: flowtable: consolidate xmit path") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
99ec511f25
commit
1eb0dc458b
@@ -343,8 +343,17 @@ struct nf_flow_xmit {
|
||||
static unsigned int nf_flow_queue_xmit(struct net *net, struct sk_buff *skb,
|
||||
struct nf_flow_xmit *xmit)
|
||||
{
|
||||
skb->dev = xmit->outdev;
|
||||
dev_hard_header(skb, skb->dev, ntohs(skb->protocol),
|
||||
struct net_device *dev = xmit->outdev;
|
||||
unsigned int hh_len = LL_RESERVED_SPACE(dev);
|
||||
|
||||
if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {
|
||||
skb = skb_expand_head(skb, hh_len);
|
||||
if (!skb)
|
||||
return NF_STOLEN;
|
||||
}
|
||||
|
||||
skb->dev = dev;
|
||||
dev_hard_header(skb, dev, ntohs(skb->protocol),
|
||||
xmit->dest, xmit->source, skb->len);
|
||||
dev_queue_xmit(skb);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user