--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
-@@ -1216,6 +1216,7 @@ enum netdev_priv_flags {
+@@ -1228,6 +1228,7 @@ enum netdev_priv_flags {
IFF_LIVE_ADDR_CHANGE = 1<<20,
IFF_MACVLAN = 1<<21,
IFF_XMIT_DST_RELEASE_PERM = 1<<22,
};
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
+@@ -1253,6 +1254,7 @@ enum netdev_priv_flags {
+ #define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE
+ #define IFF_MACVLAN IFF_MACVLAN
+ #define IFF_XMIT_DST_RELEASE_PERM IFF_XMIT_DST_RELEASE_PERM
++#define IFF_NO_IP_ALIGN IFF_NO_IP_ALIGN
+
+ /**
+ * struct net_device - The DEVICE structure.
+@@ -1523,6 +1525,11 @@ struct net_device {
+ const struct ethtool_ops *ethtool_ops;
+ const struct forwarding_accel_ops *fwd_ops;
+
++#ifdef CONFIG_ETHERNET_PACKET_MANGLE
++ void (*eth_mangle_rx)(struct net_device *dev, struct sk_buff *skb);
++ struct sk_buff *(*eth_mangle_tx)(struct net_device *dev, struct sk_buff *skb);
++#endif
++
+ const struct header_ops *header_ops;
+
+ unsigned int flags;
+@@ -1587,6 +1594,10 @@ struct net_device {
+ void *ax25_ptr;
+ struct wireless_dev *ieee80211_ptr;
+
++#ifdef CONFIG_ETHERNET_PACKET_MANGLE
++ void *phy_ptr; /* PHY device specific data */
++#endif
++
+ /*
+ * Cache lines mostly used on receive path (including eth_type_trans())
+ */
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
-@@ -2044,6 +2044,10 @@ static inline int pskb_trim(struct sk_bu
+@@ -2055,6 +2055,10 @@ static inline int pskb_trim(struct sk_bu
return (len < skb->len) ? __pskb_trim(skb, len) : 0;
}
/**
* pskb_trim_unique - remove end from a paged unique (not cloned) buffer
* @skb: buffer to alter
-@@ -2170,16 +2174,6 @@ static inline struct sk_buff *dev_alloc_
+@@ -2181,16 +2185,6 @@ static inline struct sk_buff *dev_alloc_
}
help
--- a/net/core/dev.c
+++ b/net/core/dev.c
-@@ -2607,10 +2607,20 @@ static int xmit_one(struct sk_buff *skb,
+@@ -2629,10 +2629,20 @@ static int xmit_one(struct sk_buff *skb,
if (!list_empty(&ptype_all))
dev_queue_xmit_nit(skb, dev);
#include <net/protocol.h>
#include <net/dst.h>
-@@ -451,6 +452,22 @@ struct sk_buff *__netdev_alloc_skb(struc
+@@ -471,6 +472,22 @@ struct sk_buff *__netdev_alloc_skb(struc
}
EXPORT_SYMBOL(__netdev_alloc_skb);
{
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
-@@ -188,6 +188,12 @@ __be16 eth_type_trans(struct sk_buff *sk
+@@ -200,6 +200,12 @@ __be16 eth_type_trans(struct sk_buff *sk
const struct ethhdr *eth;
skb->dev = dev;