summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-07 00:45:31 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-07 00:45:31 -0700
commit9ad5c92053d1dd52ee9e1e46067af92b0e6e22c2 (patch)
tree55fa33b7bb7d0354bfc97a7b4adf9e01f17a452a /include/linux
parent627771b0ab02e931263e7281e3028fd4bb08c607 (diff)
parentaa59d2c8a6dc8c90e305b72687559e6829e43388 (diff)
Merge bk://kernel.bkbits.net/davem/net-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/if_ether.h12
-rw-r--r--include/linux/if_tr.h9
-rw-r--r--include/linux/if_vlan.h10
-rw-r--r--include/linux/netfilter_bridge/ebt_802_3.h9
-rw-r--r--include/linux/skbuff.h1
5 files changed, 36 insertions, 5 deletions
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index d62b4dfd8305..4037aaab7aa9 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -96,11 +96,19 @@
* This is an Ethernet frame header.
*/
-struct ethhdr
-{
+struct ethhdr {
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
unsigned short h_proto; /* packet type ID field */
} __attribute__((packed));
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+
+static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
+{
+ return (struct ethhdr *)skb->mac.raw;
+}
+#endif
+
#endif /* _LINUX_IF_ETHER_H */
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h
index f7c97eeb95c8..4fd451f81ccb 100644
--- a/include/linux/if_tr.h
+++ b/include/linux/if_tr.h
@@ -48,6 +48,15 @@ struct trh_hdr {
__u16 rseg[8]; /* routing registers */
};
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+
+static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb)
+{
+ return (struct trh_hdr *)skb->mac.raw;
+}
+#endif
+
/* This is an Token-Ring LLC structure */
struct trllc {
__u8 dsap; /* destination SAP */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 529c401a9a86..29b6e104657e 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -18,7 +18,6 @@
/* externally defined structs */
struct vlan_group;
struct net_device;
-struct sk_buff;
struct packet_type;
struct vlan_collection;
struct vlan_dev_info;
@@ -48,6 +47,13 @@ struct vlan_ethhdr {
unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */
};
+#include <linux/skbuff.h>
+
+static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb)
+{
+ return (struct vlan_ethhdr *)skb->mac.raw;
+}
+
struct vlan_hdr {
unsigned short h_vlan_TCI; /* Encapsulates priority and VLAN ID */
unsigned short h_vlan_encapsulated_proto; /* packet type ID field (or len) */
@@ -180,7 +186,7 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
* This allows the VLAN to have a different MAC than the underlying
* device, and still route correctly.
*/
- if (!memcmp(skb->mac.ethernet->h_dest, skb->dev->dev_addr, ETH_ALEN))
+ if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN))
skb->pkt_type = PACKET_HOST;
break;
};
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h
index b3d6c3219075..b9f712c14a0a 100644
--- a/include/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/linux/netfilter_bridge/ebt_802_3.h
@@ -49,6 +49,15 @@ struct ebt_802_3_hdr {
} llc;
};
+#ifdef __KERNEL__
+#include <linux/skbuff.h>
+
+static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
+{
+ return (struct ebt_802_3_hdr *)skb->mac.raw;
+}
+#endif
+
struct ebt_802_3_info
{
uint8_t sap;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index b6c6ef59ab16..71fc2bdc0cd6 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -219,7 +219,6 @@ struct sk_buff {
} nh;
union {
- struct ethhdr *ethernet;
unsigned char *raw;
} mac;