mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[LLC]: Use skb_reset_mac_header in llc_mac_hdr_init
skb_push updates and returns skb->data, so we can just call skb_reset_mac_header after the call to skb_push. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0a1b0ad9ae
commit
f64955eb11
1 changed files with 4 additions and 2 deletions
|
@ -41,7 +41,8 @@ int llc_mac_hdr_init(struct sk_buff *skb,
|
||||||
struct net_device *dev = skb->dev;
|
struct net_device *dev = skb->dev;
|
||||||
struct trh_hdr *trh;
|
struct trh_hdr *trh;
|
||||||
|
|
||||||
skb->mac.raw = skb_push(skb, sizeof(*trh));
|
skb_push(skb, sizeof(*trh));
|
||||||
|
skb_reset_mac_header(skb);
|
||||||
trh = tr_hdr(skb);
|
trh = tr_hdr(skb);
|
||||||
trh->ac = AC;
|
trh->ac = AC;
|
||||||
trh->fc = LLC_FRAME;
|
trh->fc = LLC_FRAME;
|
||||||
|
@ -62,7 +63,8 @@ int llc_mac_hdr_init(struct sk_buff *skb,
|
||||||
unsigned short len = skb->len;
|
unsigned short len = skb->len;
|
||||||
struct ethhdr *eth;
|
struct ethhdr *eth;
|
||||||
|
|
||||||
skb->mac.raw = skb_push(skb, sizeof(*eth));
|
skb_push(skb, sizeof(*eth));
|
||||||
|
skb_reset_mac_header(skb);
|
||||||
eth = eth_hdr(skb);
|
eth = eth_hdr(skb);
|
||||||
eth->h_proto = htons(len);
|
eth->h_proto = htons(len);
|
||||||
memcpy(eth->h_dest, da, ETH_ALEN);
|
memcpy(eth->h_dest, da, ETH_ALEN);
|
||||||
|
|
Loading…
Reference in a new issue