4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published by
6 * the Free Software Foundation.
9 #include <linux/kernel.h>
10 #include <linux/init.h>
11 #include <linux/module.h>
12 #include <linux/netlink.h>
13 #include <linux/netfilter.h>
14 #include <linux/netfilter/nf_tables.h>
15 #include <net/netfilter/nf_tables.h>
17 static void nf_do_netdev_egress(struct sk_buff *skb, struct net_device *dev)
19 if (skb_mac_header_was_set(skb))
20 skb_push(skb, skb->mac_len);
26 void nf_fwd_netdev_egress(const struct nft_pktinfo *pkt, int oif)
28 struct net_device *dev;
30 dev = dev_get_by_index_rcu(nft_net(pkt), oif);
36 nf_do_netdev_egress(pkt->skb, dev);
38 EXPORT_SYMBOL_GPL(nf_fwd_netdev_egress);
40 void nf_dup_netdev_egress(const struct nft_pktinfo *pkt, int oif)
42 struct net_device *dev;
45 dev = dev_get_by_index_rcu(nft_net(pkt), oif);
49 skb = skb_clone(pkt->skb, GFP_ATOMIC);
51 nf_do_netdev_egress(skb, dev);
53 EXPORT_SYMBOL_GPL(nf_dup_netdev_egress);
55 MODULE_LICENSE("GPL");