Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9ad5c920
Commit
9ad5c920
authored
Oct 07, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/davem/net-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
627771b0
aa59d2c8
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
124 additions
and
88 deletions
+124
-88
drivers/ieee1394/eth1394.c
drivers/ieee1394/eth1394.c
+1
-1
drivers/ieee1394/eth1394.h
drivers/ieee1394/eth1394.h
+7
-0
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_net.c
+1
-1
drivers/media/dvb/dvb-core/dvb_net.c
drivers/media/dvb/dvb-core/dvb_net.c
+1
-1
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bond_alb.c
+1
-1
drivers/net/hamradio/bpqether.c
drivers/net/hamradio/bpqether.c
+1
-1
drivers/net/ioc3-eth.c
drivers/net/ioc3-eth.c
+2
-2
drivers/net/myri_sbus.c
drivers/net/myri_sbus.c
+1
-1
drivers/net/plip.c
drivers/net/plip.c
+1
-1
drivers/net/pppoe.c
drivers/net/pppoe.c
+2
-2
drivers/net/sungem.c
drivers/net/sungem.c
+3
-3
drivers/s390/net/qeth_main.c
drivers/s390/net/qeth_main.c
+1
-1
include/linux/if_ether.h
include/linux/if_ether.h
+10
-2
include/linux/if_tr.h
include/linux/if_tr.h
+9
-0
include/linux/if_vlan.h
include/linux/if_vlan.h
+8
-2
include/linux/netfilter_bridge/ebt_802_3.h
include/linux/netfilter_bridge/ebt_802_3.h
+9
-0
include/linux/skbuff.h
include/linux/skbuff.h
+0
-1
include/net/llc_pdu.h
include/net/llc_pdu.h
+5
-5
net/8021q/vlan_dev.c
net/8021q/vlan_dev.c
+1
-1
net/atm/br2684.c
net/atm/br2684.c
+1
-1
net/bridge/br_input.c
net/bridge/br_input.c
+5
-5
net/bridge/br_netfilter.c
net/bridge/br_netfilter.c
+8
-10
net/bridge/netfilter/ebt_802_3.c
net/bridge/netfilter/ebt_802_3.c
+1
-1
net/bridge/netfilter/ebt_among.c
net/bridge/netfilter/ebt_among.c
+6
-6
net/bridge/netfilter/ebt_arp.c
net/bridge/netfilter/ebt_arp.c
+2
-2
net/bridge/netfilter/ebt_arpreply.c
net/bridge/netfilter/ebt_arpreply.c
+3
-3
net/bridge/netfilter/ebt_dnat.c
net/bridge/netfilter/ebt_dnat.c
+1
-2
net/bridge/netfilter/ebt_ip.c
net/bridge/netfilter/ebt_ip.c
+1
-1
net/bridge/netfilter/ebt_log.c
net/bridge/netfilter/ebt_log.c
+7
-7
net/bridge/netfilter/ebt_redirect.c
net/bridge/netfilter/ebt_redirect.c
+3
-4
net/bridge/netfilter/ebt_snat.c
net/bridge/netfilter/ebt_snat.c
+1
-2
net/bridge/netfilter/ebt_vlan.c
net/bridge/netfilter/ebt_vlan.c
+1
-1
net/bridge/netfilter/ebtables.c
net/bridge/netfilter/ebtables.c
+1
-1
net/core/dv.c
net/core/dv.c
+2
-2
net/core/netpoll.c
net/core/netpoll.c
+1
-1
net/decnet/dn_neigh.c
net/decnet/dn_neigh.c
+2
-2
net/ethernet/eth.c
net/ethernet/eth.c
+2
-2
net/ipv4/netfilter/ipt_mac.c
net/ipv4/netfilter/ipt_mac.c
+1
-1
net/ipv6/netfilter/ip6t_eui64.c
net/ipv6/netfilter/ip6t_eui64.c
+3
-3
net/ipv6/netfilter/ip6t_mac.c
net/ipv6/netfilter/ip6t_mac.c
+1
-1
net/ipv6/route.c
net/ipv6/route.c
+2
-0
net/llc/llc_input.c
net/llc/llc_input.c
+1
-1
net/llc/llc_output.c
net/llc/llc_output.c
+4
-3
No files found.
drivers/ieee1394/eth1394.c
View file @
9ad5c920
...
...
@@ -850,7 +850,7 @@ static inline u16 ether1394_type_trans(struct sk_buff *skb,
skb
->
mac
.
raw
=
skb
->
data
;
skb_pull
(
skb
,
ETH1394_HLEN
);
eth
=
(
struct
eth1394hdr
*
)
skb
->
mac
.
raw
;
eth
=
eth1394_hdr
(
skb
)
;
if
(
*
eth
->
h_dest
&
1
)
{
if
(
memcmp
(
eth
->
h_dest
,
dev
->
broadcast
,
dev
->
addr_len
)
==
0
)
...
...
drivers/ieee1394/eth1394.h
View file @
9ad5c920
...
...
@@ -81,7 +81,14 @@ struct eth1394hdr {
unsigned
short
h_proto
;
/* packet type ID field */
}
__attribute__
((
packed
));
#ifdef __KERNEL__
#include <linux/skbuff.h>
static
inline
struct
eth1394hdr
*
eth1394_hdr
(
const
struct
sk_buff
*
skb
)
{
return
(
struct
eth1394hdr
*
)
skb
->
mac
.
raw
;
}
#endif
typedef
enum
{
ETH1394_GASP
,
ETH1394_WRREQ
}
eth1394_tx_type
;
...
...
drivers/isdn/i4l/isdn_net.c
View file @
9ad5c920
...
...
@@ -1369,7 +1369,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
skb
->
mac
.
raw
=
skb
->
data
;
skb_pull
(
skb
,
ETH_HLEN
);
eth
=
skb
->
mac
.
ethernet
;
eth
=
eth_hdr
(
skb
)
;
if
(
*
eth
->
h_dest
&
1
)
{
if
(
memcmp
(
eth
->
h_dest
,
dev
->
broadcast
,
ETH_ALEN
)
==
0
)
...
...
drivers/media/dvb/dvb-core/dvb_net.c
View file @
9ad5c920
...
...
@@ -142,7 +142,7 @@ static unsigned short dvb_net_eth_type_trans(struct sk_buff *skb,
skb
->
mac
.
raw
=
skb
->
data
;
skb_pull
(
skb
,
dev
->
hard_header_len
);
eth
=
skb
->
mac
.
ethernet
;
eth
=
eth_hdr
(
skb
)
;
if
(
*
eth
->
h_dest
&
1
)
{
if
(
memcmp
(
eth
->
h_dest
,
dev
->
broadcast
,
ETH_ALEN
)
==
0
)
...
...
drivers/net/bonding/bond_alb.c
View file @
9ad5c920
...
...
@@ -1285,7 +1285,7 @@ int bond_alb_xmit(struct sk_buff *skb, struct net_device *bond_dev)
int
res
=
1
;
skb
->
mac
.
raw
=
(
unsigned
char
*
)
skb
->
data
;
eth_data
=
(
struct
ethhdr
*
)
skb
->
data
;
eth_data
=
eth_hdr
(
skb
)
;
/* make sure that the curr_active_slave and the slaves list do
* not change during tx
...
...
drivers/net/hamradio/bpqether.c
View file @
9ad5c920
...
...
@@ -193,7 +193,7 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty
bpq
=
(
struct
bpqdev
*
)
dev
->
priv
;
eth
=
(
struct
ethhdr
*
)
skb
->
mac
.
raw
;
eth
=
eth_hdr
(
skb
)
;
if
(
!
(
bpq
->
acpt_addr
[
0
]
&
0x01
)
&&
memcmp
(
eth
->
h_source
,
bpq
->
acpt_addr
,
ETH_ALEN
))
...
...
drivers/net/ioc3-eth.c
View file @
9ad5c920
...
...
@@ -506,7 +506,7 @@ static struct net_device_stats *ioc3_get_stats(struct net_device *dev)
static
void
ioc3_tcpudp_checksum
(
struct
sk_buff
*
skb
,
uint32_t
hwsum
,
int
len
)
{
struct
ethhdr
*
eh
=
skb
->
mac
.
ethernet
;
struct
ethhdr
*
eh
=
eth_hdr
(
skb
)
;
uint32_t
csum
,
ehsum
;
unsigned
int
proto
;
struct
iphdr
*
ih
;
...
...
@@ -1333,7 +1333,7 @@ static int ioc3_start_xmit(struct sk_buff *skb, struct net_device *dev)
uint32_t
csum
,
ehsum
;
uint16_t
*
eh
;
/* The MAC header. skb->mac
.ethernet
seem the logic approach
/* The MAC header. skb->mac seem the logic approach
to find the MAC header - except it's a NULL pointer ... */
eh
=
(
uint16_t
*
)
skb
->
data
;
...
...
drivers/net/myri_sbus.c
View file @
9ad5c920
...
...
@@ -376,7 +376,7 @@ static unsigned short myri_type_trans(struct sk_buff *skb, struct net_device *de
skb
->
mac
.
raw
=
(((
unsigned
char
*
)
skb
->
data
)
+
MYRI_PAD_LEN
);
skb_pull
(
skb
,
dev
->
hard_header_len
);
eth
=
skb
->
mac
.
ethernet
;
eth
=
eth_hdr
(
skb
)
;
#ifdef DEBUG_HEADER
DHDR
((
"myri_type_trans: "
));
...
...
drivers/net/plip.c
View file @
9ad5c920
...
...
@@ -547,7 +547,7 @@ static unsigned short plip_type_trans(struct sk_buff *skb, struct net_device *de
skb
->
mac
.
raw
=
skb
->
data
;
skb_pull
(
skb
,
dev
->
hard_header_len
);
eth
=
skb
->
mac
.
ethernet
;
eth
=
eth_hdr
(
skb
)
;
if
(
*
eth
->
h_dest
&
1
)
{
...
...
drivers/net/pppoe.c
View file @
9ad5c920
...
...
@@ -391,7 +391,7 @@ static int pppoe_rcv(struct sk_buff *skb,
ph
=
(
struct
pppoe_hdr
*
)
skb
->
nh
.
raw
;
po
=
get_item
((
unsigned
long
)
ph
->
sid
,
skb
->
mac
.
ethernet
->
h_source
);
po
=
get_item
((
unsigned
long
)
ph
->
sid
,
eth_hdr
(
skb
)
->
h_source
);
if
(
!
po
)
goto
drop
;
...
...
@@ -440,7 +440,7 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
if
(
ph
->
code
!=
PADT_CODE
)
goto
abort
;
po
=
get_item
((
unsigned
long
)
ph
->
sid
,
skb
->
mac
.
ethernet
->
h_source
);
po
=
get_item
((
unsigned
long
)
ph
->
sid
,
eth_hdr
(
skb
)
->
h_source
);
if
(
po
)
{
struct
sock
*
sk
=
po
->
sk
;
...
...
drivers/net/sungem.c
View file @
9ad5c920
...
...
@@ -973,7 +973,7 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
if
(
!
spin_trylock
(
&
gp
->
tx_lock
))
{
/* Tell upper layer to requeue */
local_irq_restore
(
flags
);
return
-
1
;
return
NETDEV_TX_LOCKED
;
}
/* This is a hard error, log it. */
...
...
@@ -982,7 +982,7 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
spin_unlock_irqrestore
(
&
gp
->
tx_lock
,
flags
);
printk
(
KERN_ERR
PFX
"%s: BUG! Tx Ring full when queue awake!
\n
"
,
dev
->
name
);
return
1
;
return
NETDEV_TX_BUSY
;
}
entry
=
gp
->
tx_new
;
...
...
@@ -1070,7 +1070,7 @@ static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
dev
->
trans_start
=
jiffies
;
return
0
;
return
NETDEV_TX_OK
;
}
/* Jumbo-grams don't seem to work :-( */
...
...
drivers/s390/net/qeth_main.c
View file @
9ad5c920
...
...
@@ -2148,7 +2148,7 @@ qeth_type_trans(struct sk_buff *skb, struct net_device *dev)
skb
->
mac
.
raw
=
skb
->
data
;
skb_pull
(
skb
,
ETH_ALEN
*
2
+
sizeof
(
short
));
eth
=
skb
->
mac
.
ethernet
;
eth
=
eth_hdr
(
skb
)
;
if
(
*
eth
->
h_dest
&
1
)
{
if
(
memcmp
(
eth
->
h_dest
,
dev
->
broadcast
,
ETH_ALEN
)
==
0
)
...
...
include/linux/if_ether.h
View file @
9ad5c920
...
...
@@ -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 */
include/linux/if_tr.h
View file @
9ad5c920
...
...
@@ -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 */
...
...
include/linux/if_vlan.h
View file @
9ad5c920
...
...
@@ -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
;
};
...
...
include/linux/netfilter_bridge/ebt_802_3.h
View file @
9ad5c920
...
...
@@ -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
;
...
...
include/linux/skbuff.h
View file @
9ad5c920
...
...
@@ -219,7 +219,6 @@ struct sk_buff {
}
nh
;
union
{
struct
ethhdr
*
ethernet
;
unsigned
char
*
raw
;
}
mac
;
...
...
include/net/llc_pdu.h
View file @
9ad5c920
...
...
@@ -253,9 +253,9 @@ static inline void llc_pdu_header_init(struct sk_buff *skb, u8 type,
static
inline
void
llc_pdu_decode_sa
(
struct
sk_buff
*
skb
,
u8
*
sa
)
{
if
(
skb
->
protocol
==
ntohs
(
ETH_P_802_2
))
memcpy
(
sa
,
((
struct
ethhdr
*
)
skb
->
mac
.
raw
)
->
h_source
,
ETH_ALEN
);
memcpy
(
sa
,
eth_hdr
(
skb
)
->
h_source
,
ETH_ALEN
);
else
if
(
skb
->
protocol
==
ntohs
(
ETH_P_TR_802_2
))
memcpy
(
sa
,
((
struct
trh_hdr
*
)
skb
->
mac
.
raw
)
->
saddr
,
ETH_ALEN
);
memcpy
(
sa
,
tr_hdr
(
skb
)
->
saddr
,
ETH_ALEN
);
}
/**
...
...
@@ -268,9 +268,9 @@ static inline void llc_pdu_decode_sa(struct sk_buff *skb, u8 *sa)
static
inline
void
llc_pdu_decode_da
(
struct
sk_buff
*
skb
,
u8
*
da
)
{
if
(
skb
->
protocol
==
ntohs
(
ETH_P_802_2
))
memcpy
(
da
,
((
struct
ethhdr
*
)
skb
->
mac
.
raw
)
->
h_dest
,
ETH_ALEN
);
memcpy
(
da
,
eth_hdr
(
skb
)
->
h_dest
,
ETH_ALEN
);
else
if
(
skb
->
protocol
==
ntohs
(
ETH_P_TR_802_2
))
memcpy
(
da
,
((
struct
trh_hdr
*
)
skb
->
mac
.
raw
)
->
daddr
,
ETH_ALEN
);
memcpy
(
da
,
tr_hdr
(
skb
)
->
daddr
,
ETH_ALEN
);
}
/**
...
...
@@ -347,7 +347,7 @@ static inline void llc_pdu_init_as_test_rsp(struct sk_buff *skb,
struct
llc_pdu_un
*
ev_pdu
=
llc_pdu_un_hdr
(
ev_skb
);
int
dsize
;
dsize
=
ntohs
(
((
struct
ethhdr
*
)
ev_skb
->
mac
.
raw
)
->
h_proto
)
-
3
;
dsize
=
ntohs
(
eth_hdr
(
ev_skb
)
->
h_proto
)
-
3
;
memcpy
(((
u8
*
)
pdu
)
+
3
,
((
u8
*
)
ev_pdu
)
+
3
,
dsize
);
skb_put
(
skb
,
dsize
);
}
...
...
net/8021q/vlan_dev.c
View file @
9ad5c920
...
...
@@ -211,7 +211,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
* 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
)
==
0
)
{
if
(
memcmp
(
eth_hdr
(
skb
)
->
h_dest
,
skb
->
dev
->
dev_addr
,
ETH_ALEN
)
==
0
)
{
/* It is for our (changed) MAC-address! */
skb
->
pkt_type
=
PACKET_HOST
;
}
...
...
net/atm/br2684.c
View file @
9ad5c920
...
...
@@ -294,7 +294,7 @@ static inline unsigned short br_type_trans(struct sk_buff *skb,
{
struct
ethhdr
*
eth
;
unsigned
char
*
rawp
;
eth
=
skb
->
mac
.
ethernet
;
eth
=
eth_hdr
(
skb
)
;
if
(
*
eth
->
h_dest
&
1
)
{
if
(
memcmp
(
eth
->
h_dest
,
dev
->
broadcast
,
ETH_ALEN
)
==
0
)
...
...
net/bridge/br_input.c
View file @
9ad5c920
...
...
@@ -48,7 +48,7 @@ static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb)
/* note: already called with rcu_read_lock (preempt_disabled) */
int
br_handle_frame_finish
(
struct
sk_buff
*
skb
)
{
const
unsigned
char
*
dest
=
skb
->
mac
.
ethernet
->
h_dest
;
const
unsigned
char
*
dest
=
eth_hdr
(
skb
)
->
h_dest
;
struct
net_bridge_port
*
p
=
skb
->
dev
->
br_port
;
struct
net_bridge
*
br
=
p
->
br
;
struct
net_bridge_fdb_entry
*
dst
;
...
...
@@ -100,17 +100,17 @@ int br_handle_frame_finish(struct sk_buff *skb)
int
br_handle_frame
(
struct
net_bridge_port
*
p
,
struct
sk_buff
**
pskb
)
{
struct
sk_buff
*
skb
=
*
pskb
;
const
unsigned
char
*
dest
=
skb
->
mac
.
ethernet
->
h_dest
;
const
unsigned
char
*
dest
=
eth_hdr
(
skb
)
->
h_dest
;
if
(
p
->
state
==
BR_STATE_DISABLED
)
goto
err
;
if
(
skb
->
mac
.
ethernet
->
h_source
[
0
]
&
1
)
if
(
eth_hdr
(
skb
)
->
h_source
[
0
]
&
1
)
goto
err
;
if
(
p
->
state
==
BR_STATE_LEARNING
||
p
->
state
==
BR_STATE_FORWARDING
)
br_fdb_insert
(
p
->
br
,
p
,
skb
->
mac
.
ethernet
->
h_source
,
0
);
br_fdb_insert
(
p
->
br
,
p
,
eth_hdr
(
skb
)
->
h_source
,
0
);
if
(
p
->
br
->
stp_enabled
&&
!
memcmp
(
dest
,
bridge_ula
,
5
)
&&
...
...
@@ -127,7 +127,7 @@ int br_handle_frame(struct net_bridge_port *p, struct sk_buff **pskb)
if
(
br_should_route_hook
(
pskb
))
return
0
;
skb
=
*
pskb
;
dest
=
skb
->
mac
.
ethernet
->
h_dest
;
dest
=
eth_hdr
(
skb
)
->
h_dest
;
}
if
(
!
memcmp
(
p
->
br
->
dev
->
dev_addr
,
dest
,
ETH_ALEN
))
...
...
net/bridge/br_netfilter.c
View file @
9ad5c920
...
...
@@ -255,7 +255,7 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
1
);
return
0
;
}
memcpy
(
skb
->
mac
.
ethernet
->
h_dest
,
dev
->
dev_addr
,
memcpy
(
eth_hdr
(
skb
)
->
h_dest
,
dev
->
dev_addr
,
ETH_ALEN
);
skb
->
pkt_type
=
PACKET_HOST
;
}
...
...
@@ -412,8 +412,7 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff **pskb,
__u32
len
;
struct
sk_buff
*
skb
=
*
pskb
;
struct
nf_bridge_info
*
nf_bridge
;
struct
vlan_ethhdr
*
hdr
=
(
struct
vlan_ethhdr
*
)
((
*
pskb
)
->
mac
.
ethernet
);
struct
vlan_ethhdr
*
hdr
=
vlan_eth_hdr
(
*
pskb
);
if
(
skb
->
protocol
==
__constant_htons
(
ETH_P_IPV6
)
||
IS_VLAN_IPV6
)
{
#ifdef CONFIG_SYSCTL
...
...
@@ -516,7 +515,7 @@ static int br_nf_forward_finish(struct sk_buff *skb)
{
struct
nf_bridge_info
*
nf_bridge
=
skb
->
nf_bridge
;
struct
net_device
*
in
;
struct
vlan_ethhdr
*
hdr
=
(
struct
vlan_ethhdr
*
)(
skb
->
mac
.
ethernet
);
struct
vlan_ethhdr
*
hdr
=
vlan_eth_hdr
(
skb
);
#ifdef CONFIG_NETFILTER_DEBUG
skb
->
nf_debug
^=
(
1
<<
NF_BR_FORWARD
);
...
...
@@ -551,7 +550,7 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff **pskb,
{
struct
sk_buff
*
skb
=
*
pskb
;
struct
nf_bridge_info
*
nf_bridge
;
struct
vlan_ethhdr
*
hdr
=
(
struct
vlan_ethhdr
*
)(
skb
->
mac
.
ethernet
);
struct
vlan_ethhdr
*
hdr
=
vlan_eth_hdr
(
skb
);
int
pf
;
if
(
!
skb
->
nf_bridge
)
...
...
@@ -591,7 +590,7 @@ static unsigned int br_nf_forward_arp(unsigned int hook, struct sk_buff **pskb,
int
(
*
okfn
)(
struct
sk_buff
*
))
{
struct
sk_buff
*
skb
=
*
pskb
;
struct
vlan_ethhdr
*
hdr
=
(
struct
vlan_ethhdr
*
)(
skb
->
mac
.
ethernet
);
struct
vlan_ethhdr
*
hdr
=
vlan_eth_hdr
(
skb
);
struct
net_device
**
d
=
(
struct
net_device
**
)(
skb
->
cb
);
#ifdef CONFIG_SYSCTL
...
...
@@ -669,7 +668,7 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff **pskb,
struct
net_device
*
realindev
,
*
realoutdev
;
struct
sk_buff
*
skb
=
*
pskb
;
struct
nf_bridge_info
*
nf_bridge
;
struct
vlan_ethhdr
*
hdr
=
(
struct
vlan_ethhdr
*
)(
skb
->
mac
.
ethernet
);
struct
vlan_ethhdr
*
hdr
=
vlan_eth_hdr
(
skb
);
int
pf
;
if
(
!
skb
->
nf_bridge
)
...
...
@@ -753,7 +752,7 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb,
{
struct
sk_buff
*
skb
=
*
pskb
;
struct
nf_bridge_info
*
nf_bridge
=
(
*
pskb
)
->
nf_bridge
;
struct
vlan_ethhdr
*
hdr
=
(
struct
vlan_ethhdr
*
)(
skb
->
mac
.
ethernet
);
struct
vlan_ethhdr
*
hdr
=
vlan_eth_hdr
(
skb
);
struct
net_device
*
realoutdev
=
bridge_parent
(
skb
->
dev
);
int
pf
;
...
...
@@ -848,8 +847,7 @@ static unsigned int ip_sabotage_out(unsigned int hook, struct sk_buff **pskb,
#ifdef CONFIG_SYSCTL
if
(
!
skb
->
nf_bridge
)
{
struct
vlan_ethhdr
*
hdr
=
(
struct
vlan_ethhdr
*
)(
skb
->
mac
.
ethernet
);
struct
vlan_ethhdr
*
hdr
=
vlan_eth_hdr
(
skb
);
if
(
skb
->
protocol
==
__constant_htons
(
ETH_P_IP
)
||
IS_VLAN_IP
)
{
...
...
net/bridge/netfilter/ebt_802_3.c
View file @
9ad5c920
...
...
@@ -16,7 +16,7 @@ static int ebt_filter_802_3(const struct sk_buff *skb, const struct net_device *
const
struct
net_device
*
out
,
const
void
*
data
,
unsigned
int
datalen
)
{
struct
ebt_802_3_info
*
info
=
(
struct
ebt_802_3_info
*
)
data
;
struct
ebt_802_3_hdr
*
hdr
=
(
struct
ebt_802_3_hdr
*
)
skb
->
mac
.
ethernet
;
struct
ebt_802_3_hdr
*
hdr
=
ebt_802_3_hdr
(
skb
)
;
uint16_t
type
=
hdr
->
llc
.
ui
.
ctrl
&
IS_UI
?
hdr
->
llc
.
ui
.
type
:
hdr
->
llc
.
ni
.
type
;
if
(
info
->
bitmask
&
EBT_802_3_SAP
)
{
...
...
net/bridge/netfilter/ebt_among.c
View file @
9ad5c920
...
...
@@ -72,14 +72,14 @@ static int ebt_mac_wormhash_check_integrity(const struct ebt_mac_wormhash
static
int
get_ip_dst
(
const
struct
sk_buff
*
skb
,
uint32_t
*
addr
)
{
if
(
skb
->
mac
.
ethernet
->
h_proto
==
__constant_
htons
(
ETH_P_IP
))
{
if
(
eth_hdr
(
skb
)
->
h_proto
==
htons
(
ETH_P_IP
))
{
struct
iphdr
_iph
,
*
ih
;
ih
=
skb_header_pointer
(
skb
,
0
,
sizeof
(
_iph
),
&
_iph
);
if
(
ih
==
NULL
)
return
-
1
;
*
addr
=
ih
->
daddr
;
}
else
if
(
skb
->
mac
.
ethernet
->
h_proto
==
__constant_
htons
(
ETH_P_ARP
))
{
}
else
if
(
eth_hdr
(
skb
)
->
h_proto
==
htons
(
ETH_P_ARP
))
{
struct
arphdr
_arph
,
*
ah
;
uint32_t
buf
,
*
bp
;
...
...
@@ -100,14 +100,14 @@ static int get_ip_dst(const struct sk_buff *skb, uint32_t *addr)
static
int
get_ip_src
(
const
struct
sk_buff
*
skb
,
uint32_t
*
addr
)
{
if
(
skb
->
mac
.
ethernet
->
h_proto
==
__constant_
htons
(
ETH_P_IP
))
{
if
(
eth_hdr
(
skb
)
->
h_proto
==
htons
(
ETH_P_IP
))
{
struct
iphdr
_iph
,
*
ih
;
ih
=
skb_header_pointer
(
skb
,
0
,
sizeof
(
_iph
),
&
_iph
);
if
(
ih
==
NULL
)
return
-
1
;
*
addr
=
ih
->
saddr
;
}
else
if
(
skb
->
mac
.
ethernet
->
h_proto
==
__constant_
htons
(
ETH_P_ARP
))
{
}
else
if
(
eth_hdr
(
skb
)
->
h_proto
==
htons
(
ETH_P_ARP
))
{
struct
arphdr
_arph
,
*
ah
;
uint32_t
buf
,
*
bp
;
...
...
@@ -139,7 +139,7 @@ static int ebt_filter_among(const struct sk_buff *skb,
wh_src
=
ebt_among_wh_src
(
info
);
if
(
wh_src
)
{
smac
=
skb
->
mac
.
ethernet
->
h_source
;
smac
=
eth_hdr
(
skb
)
->
h_source
;
if
(
get_ip_src
(
skb
,
&
sip
))
return
EBT_NOMATCH
;
if
(
!
(
info
->
bitmask
&
EBT_AMONG_SRC_NEG
))
{
...
...
@@ -154,7 +154,7 @@ static int ebt_filter_among(const struct sk_buff *skb,
}
if
(
wh_dst
)
{
dmac
=
skb
->
mac
.
ethernet
->
h_dest
;
dmac
=
eth_hdr
(
skb
)
->
h_dest
;
if
(
get_ip_dst
(
skb
,
&
dip
))
return
EBT_NOMATCH
;
if
(
!
(
info
->
bitmask
&
EBT_AMONG_DST_NEG
))
{
...
...
net/bridge/netfilter/ebt_arp.c
View file @
9ad5c920
...
...
@@ -108,8 +108,8 @@ static int ebt_arp_check(const char *tablename, unsigned int hookmask,
if
(
datalen
!=
EBT_ALIGN
(
sizeof
(
struct
ebt_arp_info
)))
return
-
EINVAL
;
if
((
e
->
ethproto
!=
__constant_
htons
(
ETH_P_ARP
)
&&
e
->
ethproto
!=
__constant_
htons
(
ETH_P_RARP
))
||
if
((
e
->
ethproto
!=
htons
(
ETH_P_ARP
)
&&
e
->
ethproto
!=
htons
(
ETH_P_RARP
))
||
e
->
invflags
&
EBT_IPROTO
)
return
-
EINVAL
;
if
(
info
->
bitmask
&
~
EBT_ARP_MASK
||
info
->
invflags
&
~
EBT_ARP_MASK
)
...
...
net/bridge/netfilter/ebt_arpreply.c
View file @
9ad5c920
...
...
@@ -29,9 +29,9 @@ static int ebt_target_reply(struct sk_buff **pskb, unsigned int hooknr,
if
(
ap
==
NULL
)
return
EBT_DROP
;
if
(
ap
->
ar_op
!=
__constant_
htons
(
ARPOP_REQUEST
)
||
if
(
ap
->
ar_op
!=
htons
(
ARPOP_REQUEST
)
||
ap
->
ar_hln
!=
ETH_ALEN
||
ap
->
ar_pro
!=
__constant_
htons
(
ETH_P_IP
)
||
ap
->
ar_pro
!=
htons
(
ETH_P_IP
)
||
ap
->
ar_pln
!=
4
)
return
EBT_CONTINUE
;
...
...
@@ -65,7 +65,7 @@ static int ebt_target_reply_check(const char *tablename, unsigned int hookmask,
return
-
EINVAL
;
if
(
BASE_CHAIN
&&
info
->
target
==
EBT_RETURN
)
return
-
EINVAL
;
if
(
e
->
ethproto
!=
__constant_
htons
(
ETH_P_ARP
)
||
if
(
e
->
ethproto
!=
htons
(
ETH_P_ARP
)
||
e
->
invflags
&
EBT_IPROTO
)
return
-
EINVAL
;
CLEAR_BASE_CHAIN_BIT
;
...
...
net/bridge/netfilter/ebt_dnat.c
View file @
9ad5c920
...
...
@@ -30,8 +30,7 @@ static int ebt_target_dnat(struct sk_buff **pskb, unsigned int hooknr,
kfree_skb
(
*
pskb
);
*
pskb
=
nskb
;
}
memcpy
(((
**
pskb
).
mac
.
ethernet
)
->
h_dest
,
info
->
mac
,
ETH_ALEN
*
sizeof
(
unsigned
char
));
memcpy
(
eth_hdr
(
*
pskb
)
->
h_dest
,
info
->
mac
,
ETH_ALEN
);
return
info
->
target
;
}
...
...
net/bridge/netfilter/ebt_ip.c
View file @
9ad5c920
...
...
@@ -80,7 +80,7 @@ static int ebt_ip_check(const char *tablename, unsigned int hookmask,
if
(
datalen
!=
EBT_ALIGN
(
sizeof
(
struct
ebt_ip_info
)))
return
-
EINVAL
;
if
(
e
->
ethproto
!=
__constant_
htons
(
ETH_P_IP
)
||
if
(
e
->
ethproto
!=
htons
(
ETH_P_IP
)
||
e
->
invflags
&
EBT_IPROTO
)
return
-
EINVAL
;
if
(
info
->
bitmask
&
~
EBT_IP_MASK
||
info
->
invflags
&
~
EBT_IP_MASK
)
...
...
net/bridge/netfilter/ebt_log.c
View file @
9ad5c920
...
...
@@ -70,13 +70,13 @@ static void ebt_log(const struct sk_buff *skb, const struct net_device *in,
out
?
out
->
name
:
""
);
printk
(
"MAC source = "
);
print_MAC
(
(
skb
->
mac
.
ethernet
)
->
h_source
);
print_MAC
(
eth_hdr
(
skb
)
->
h_source
);
printk
(
"MAC dest = "
);
print_MAC
(
(
skb
->
mac
.
ethernet
)
->
h_dest
);
print_MAC
(
eth_hdr
(
skb
)
->
h_dest
);
printk
(
"proto = 0x%04x"
,
ntohs
(
((
*
skb
).
mac
.
ethernet
)
->
h_proto
));
printk
(
"proto = 0x%04x"
,
ntohs
(
eth_hdr
(
skb
)
->
h_proto
));
if
((
info
->
bitmask
&
EBT_LOG_IP
)
&&
skb
->
mac
.
ethernet
->
h_proto
==
if
((
info
->
bitmask
&
EBT_LOG_IP
)
&&
eth_hdr
(
skb
)
->
h_proto
==
htons
(
ETH_P_IP
)){
struct
iphdr
_iph
,
*
ih
;
...
...
@@ -106,8 +106,8 @@ static void ebt_log(const struct sk_buff *skb, const struct net_device *in,
}
if
((
info
->
bitmask
&
EBT_LOG_ARP
)
&&
((
skb
->
mac
.
ethernet
->
h_proto
==
__constant_
htons
(
ETH_P_ARP
))
||
(
skb
->
mac
.
ethernet
->
h_proto
==
__constant_
htons
(
ETH_P_RARP
))))
{
((
eth_hdr
(
skb
)
->
h_proto
==
htons
(
ETH_P_ARP
))
||
(
eth_hdr
(
skb
)
->
h_proto
==
htons
(
ETH_P_RARP
))))
{
struct
arphdr
_arph
,
*
ah
;
ah
=
skb_header_pointer
(
skb
,
0
,
sizeof
(
_arph
),
&
_arph
);
...
...
@@ -121,7 +121,7 @@ static void ebt_log(const struct sk_buff *skb, const struct net_device *in,
/* If it's for Ethernet and the lengths are OK,
* then log the ARP payload */
if
(
ah
->
ar_hrd
==
__constant_
htons
(
1
)
&&
if
(
ah
->
ar_hrd
==
htons
(
1
)
&&
ah
->
ar_hln
==
ETH_ALEN
&&
ah
->
ar_pln
==
sizeof
(
uint32_t
))
{
struct
arppayload
_arpp
,
*
ap
;
...
...
net/bridge/netfilter/ebt_redirect.c
View file @
9ad5c920
...
...
@@ -32,11 +32,10 @@ static int ebt_target_redirect(struct sk_buff **pskb, unsigned int hooknr,
*
pskb
=
nskb
;
}
if
(
hooknr
!=
NF_BR_BROUTING
)
memcpy
(
(
**
pskb
).
mac
.
ethernet
->
h_dest
,
in
->
br_port
->
br
->
dev
->
dev_addr
,
ETH_ALEN
);
memcpy
(
eth_hdr
(
*
pskb
)
->
h_dest
,
in
->
br_port
->
br
->
dev
->
dev_addr
,
ETH_ALEN
);
else
memcpy
((
**
pskb
).
mac
.
ethernet
->
h_dest
,
in
->
dev_addr
,
ETH_ALEN
);
memcpy
(
eth_hdr
(
*
pskb
)
->
h_dest
,
in
->
dev_addr
,
ETH_ALEN
);
(
*
pskb
)
->
pkt_type
=
PACKET_HOST
;
return
info
->
target
;
}
...
...
net/bridge/netfilter/ebt_snat.c
View file @
9ad5c920
...
...
@@ -30,8 +30,7 @@ static int ebt_target_snat(struct sk_buff **pskb, unsigned int hooknr,
kfree_skb
(
*
pskb
);
*
pskb
=
nskb
;
}
memcpy
(((
**
pskb
).
mac
.
ethernet
)
->
h_source
,
info
->
mac
,
ETH_ALEN
*
sizeof
(
unsigned
char
));
memcpy
(
eth_hdr
(
*
pskb
)
->
h_source
,
info
->
mac
,
ETH_ALEN
);
return
info
->
target
;
}
...
...
net/bridge/netfilter/ebt_vlan.c
View file @
9ad5c920
...
...
@@ -104,7 +104,7 @@ ebt_check_vlan(const char *tablename,
}
/* Is it 802.1Q frame checked? */
if
(
e
->
ethproto
!=
__constant_
htons
(
ETH_P_8021Q
))
{
if
(
e
->
ethproto
!=
htons
(
ETH_P_8021Q
))
{
DEBUG_MSG
(
"passed entry proto %2.4X is not 802.1Q (8100)
\n
"
,
(
unsigned
short
)
ntohs
(
e
->
ethproto
));
...
...
net/bridge/netfilter/ebtables.c
View file @
9ad5c920
...
...
@@ -190,7 +190,7 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
base
=
private
->
entries
;
i
=
0
;
while
(
i
<
nentries
)
{
if
(
ebt_basic_match
(
point
,
(
**
pskb
).
mac
.
ethernet
,
in
,
out
))
if
(
ebt_basic_match
(
point
,
eth_hdr
(
*
pskb
)
,
in
,
out
))
goto
letscontinue
;
if
(
EBT_MATCH_ITERATE
(
point
,
ebt_do_match
,
*
pskb
,
in
,
out
)
!=
0
)
...
...
net/core/dv.c
View file @
9ad5c920
...
...
@@ -450,12 +450,12 @@ int divert_ioctl(unsigned int cmd, struct divert_cf __user *arg)
*/
#define ETH_DIVERT_FRAME(skb) \
memcpy(
skb->mac.ethernet
, skb->dev->dev_addr, ETH_ALEN); \
memcpy(
eth_hdr(skb)
, skb->dev->dev_addr, ETH_ALEN); \
skb->pkt_type=PACKET_HOST
void
divert_frame
(
struct
sk_buff
*
skb
)
{
struct
ethhdr
*
eth
=
skb
->
mac
.
ethernet
;
struct
ethhdr
*
eth
=
eth_hdr
(
skb
)
;
struct
iphdr
*
iph
;
struct
tcphdr
*
tcph
;
struct
udphdr
*
udph
;
...
...
net/core/netpoll.c
View file @
9ad5c920
...
...
@@ -378,7 +378,7 @@ int netpoll_rx(struct sk_buff *skb)
return
1
;
}
proto
=
ntohs
(
skb
->
mac
.
ethernet
->
h_proto
);
proto
=
ntohs
(
eth_hdr
(
skb
)
->
h_proto
);
if
(
proto
!=
ETH_P_IP
)
goto
out
;
if
(
skb
->
pkt_type
==
PACKET_OTHERHOST
)
...
...
net/decnet/dn_neigh.c
View file @
9ad5c920
...
...
@@ -399,7 +399,7 @@ int dn_neigh_router_hello(struct sk_buff *skb)
neigh
->
updated
=
jiffies
;
if
(
neigh
->
dev
->
type
==
ARPHRD_ETHER
)
memcpy
(
neigh
->
ha
,
&
skb
->
mac
.
ethernet
->
h_source
,
ETH_ALEN
);
memcpy
(
neigh
->
ha
,
&
eth_hdr
(
skb
)
->
h_source
,
ETH_ALEN
);
dn
->
blksize
=
dn_ntohs
(
msg
->
blksize
);
dn
->
priority
=
msg
->
priority
;
...
...
@@ -455,7 +455,7 @@ int dn_neigh_endnode_hello(struct sk_buff *skb)
neigh
->
updated
=
jiffies
;
if
(
neigh
->
dev
->
type
==
ARPHRD_ETHER
)
memcpy
(
neigh
->
ha
,
&
skb
->
mac
.
ethernet
->
h_source
,
ETH_ALEN
);
memcpy
(
neigh
->
ha
,
&
eth_hdr
(
skb
)
->
h_source
,
ETH_ALEN
);
dn
->
flags
&=
~
(
DN_NDFLAG_R1
|
DN_NDFLAG_R2
);
dn
->
blksize
=
dn_ntohs
(
msg
->
blksize
);
dn
->
priority
=
0
;
...
...
net/ethernet/eth.c
View file @
9ad5c920
...
...
@@ -163,7 +163,7 @@ unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev)
skb
->
mac
.
raw
=
skb
->
data
;
skb_pull
(
skb
,
ETH_HLEN
);
eth
=
skb
->
mac
.
ethernet
;
eth
=
eth_hdr
(
skb
)
;
skb
->
input_dev
=
dev
;
if
(
*
eth
->
h_dest
&
1
)
...
...
@@ -210,7 +210,7 @@ unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev)
int
eth_header_parse
(
struct
sk_buff
*
skb
,
unsigned
char
*
haddr
)
{
struct
ethhdr
*
eth
=
skb
->
mac
.
ethernet
;
struct
ethhdr
*
eth
=
eth_hdr
(
skb
)
;
memcpy
(
haddr
,
eth
->
h_source
,
ETH_ALEN
);
return
ETH_ALEN
;
}
...
...
net/ipv4/netfilter/ipt_mac.c
View file @
9ad5c920
...
...
@@ -33,7 +33,7 @@ match(const struct sk_buff *skb,
return
(
skb
->
mac
.
raw
>=
skb
->
head
&&
(
skb
->
mac
.
raw
+
ETH_HLEN
)
<=
skb
->
data
/* If so, compare... */
&&
((
memcmp
(
skb
->
mac
.
ethernet
->
h_source
,
info
->
srcaddr
,
ETH_ALEN
)
&&
((
memcmp
(
eth_hdr
(
skb
)
->
h_source
,
info
->
srcaddr
,
ETH_ALEN
)
==
0
)
^
info
->
invert
));
}
...
...
net/ipv6/netfilter/ip6t_eui64.c
View file @
9ad5c920
...
...
@@ -41,10 +41,10 @@ match(const struct sk_buff *skb,
memset
(
eui64
,
0
,
sizeof
(
eui64
));
if
(
skb
->
mac
.
ethernet
->
h_proto
==
ntohs
(
ETH_P_IPV6
))
{
if
(
eth_hdr
(
skb
)
->
h_proto
==
ntohs
(
ETH_P_IPV6
))
{
if
(
skb
->
nh
.
ipv6h
->
version
==
0x6
)
{
memcpy
(
eui64
,
skb
->
mac
.
ethernet
->
h_source
,
3
);
memcpy
(
eui64
+
5
,
skb
->
mac
.
ethernet
->
h_source
+
3
,
3
);
memcpy
(
eui64
,
eth_hdr
(
skb
)
->
h_source
,
3
);
memcpy
(
eui64
+
5
,
eth_hdr
(
skb
)
->
h_source
+
3
,
3
);
eui64
[
3
]
=
0xff
;
eui64
[
4
]
=
0xfe
;
eui64
[
0
]
|=
0x02
;
...
...
net/ipv6/netfilter/ip6t_mac.c
View file @
9ad5c920
...
...
@@ -35,7 +35,7 @@ match(const struct sk_buff *skb,
return
(
skb
->
mac
.
raw
>=
skb
->
head
&&
(
skb
->
mac
.
raw
+
ETH_HLEN
)
<=
skb
->
data
/* If so, compare... */
&&
((
memcmp
(
skb
->
mac
.
ethernet
->
h_source
,
info
->
srcaddr
,
ETH_ALEN
)
&&
((
memcmp
(
eth_hdr
(
skb
)
->
h_source
,
info
->
srcaddr
,
ETH_ALEN
)
==
0
)
^
info
->
invert
));
}
...
...
net/ipv6/route.c
View file @
9ad5c920
...
...
@@ -1357,6 +1357,8 @@ int ip6_pkt_discard(struct sk_buff *skb)
int
ip6_pkt_discard_out
(
struct
sk_buff
**
pskb
)
{
(
*
pskb
)
->
dev
=
(
*
pskb
)
->
dst
->
dev
;
BUG_ON
(
!
(
*
pskb
)
->
dev
);
return
ip6_pkt_discard
(
*
pskb
);
}
...
...
net/llc/llc_input.c
View file @
9ad5c920
...
...
@@ -111,7 +111,7 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
skb
->
h
.
raw
+=
llc_len
;
skb_pull
(
skb
,
llc_len
);
if
(
skb
->
protocol
==
htons
(
ETH_P_802_2
))
{
u16
pdulen
=
((
struct
ethhdr
*
)
skb
->
mac
.
raw
)
->
h_proto
,
u16
pdulen
=
eth_hdr
(
skb
)
->
h_proto
,
data_size
=
ntohs
(
pdulen
)
-
llc_len
;
skb_trim
(
skb
,
data_size
);
...
...
net/llc/llc_output.c
View file @
9ad5c920
...
...
@@ -40,7 +40,8 @@ int llc_mac_hdr_init(struct sk_buff *skb, unsigned char *sa, unsigned char *da)
struct
net_device
*
dev
=
skb
->
dev
;
struct
trh_hdr
*
trh
;
trh
=
(
struct
trh_hdr
*
)
skb_push
(
skb
,
sizeof
(
*
trh
));
skb
->
mac
.
raw
=
skb_push
(
skb
,
sizeof
(
*
trh
));
trh
=
tr_hdr
(
skb
);
trh
->
ac
=
AC
;
trh
->
fc
=
LLC_FRAME
;
if
(
sa
)
...
...
@@ -50,8 +51,8 @@ int llc_mac_hdr_init(struct sk_buff *skb, unsigned char *sa, unsigned char *da)
if
(
da
)
{
memcpy
(
trh
->
daddr
,
da
,
dev
->
addr_len
);
tr_source_route
(
skb
,
trh
,
dev
);
skb
->
mac
.
raw
=
skb
->
data
;
}
skb
->
mac
.
raw
=
skb
->
data
;
break
;
}
#endif
...
...
@@ -61,7 +62,7 @@ int llc_mac_hdr_init(struct sk_buff *skb, unsigned char *sa, unsigned char *da)
struct
ethhdr
*
eth
;
skb
->
mac
.
raw
=
skb_push
(
skb
,
sizeof
(
*
eth
));
eth
=
(
struct
ethhdr
*
)
skb
->
mac
.
raw
;
eth
=
eth_hdr
(
skb
)
;
eth
->
h_proto
=
htons
(
len
);
memcpy
(
eth
->
h_dest
,
da
,
ETH_ALEN
);
memcpy
(
eth
->
h_source
,
sa
,
ETH_ALEN
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment