Skip to content

Commit

Permalink
net: pktgen: use reset to set mac header
Browse files Browse the repository at this point in the history
Since offset is zero, it's not necessary to use set function.

Signed-off-by: Zhang Shengju <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Zhang Shengju authored and davem330 committed Mar 1, 2016
1 parent 241deec commit c145aeb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2856,7 +2856,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device *odev,
*vlan_encapsulated_proto = htons(ETH_P_IP);
}

skb_set_mac_header(skb, 0);
skb_reset_mac_header(skb);
skb_set_network_header(skb, skb->len);
iph = (struct iphdr *) skb_put(skb, sizeof(struct iphdr));

Expand Down Expand Up @@ -2983,7 +2983,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device *odev,
*vlan_encapsulated_proto = htons(ETH_P_IPV6);
}

skb_set_mac_header(skb, 0);
skb_reset_mac_header(skb);
skb_set_network_header(skb, skb->len);
iph = (struct ipv6hdr *) skb_put(skb, sizeof(struct ipv6hdr));

Expand Down

0 comments on commit c145aeb

Please sign in to comment.