Commit 6297b91c authored by Zhang Shengju's avatar Zhang Shengju Committed by David S. Miller

vxlan: use reset to set header pointers

Since offset is zero, it's not necessary to use set function. Reset
function is straightforward, and will remove the unnecessary add operation
in set function.
Signed-off-by: default avatarZhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 94f7153e
...@@ -1460,7 +1460,7 @@ static struct sk_buff *vxlan_na_create(struct sk_buff *request, ...@@ -1460,7 +1460,7 @@ static struct sk_buff *vxlan_na_create(struct sk_buff *request,
reply->dev = dev; reply->dev = dev;
skb_reserve(reply, LL_RESERVED_SPACE(request->dev)); skb_reserve(reply, LL_RESERVED_SPACE(request->dev));
skb_push(reply, sizeof(struct ethhdr)); skb_push(reply, sizeof(struct ethhdr));
skb_set_mac_header(reply, 0); skb_reset_mac_header(reply);
ns = (struct nd_msg *)skb_transport_header(request); ns = (struct nd_msg *)skb_transport_header(request);
...@@ -1480,7 +1480,7 @@ static struct sk_buff *vxlan_na_create(struct sk_buff *request, ...@@ -1480,7 +1480,7 @@ static struct sk_buff *vxlan_na_create(struct sk_buff *request,
reply->protocol = htons(ETH_P_IPV6); reply->protocol = htons(ETH_P_IPV6);
skb_pull(reply, sizeof(struct ethhdr)); skb_pull(reply, sizeof(struct ethhdr));
skb_set_network_header(reply, 0); skb_reset_network_header(reply);
skb_put(reply, sizeof(struct ipv6hdr)); skb_put(reply, sizeof(struct ipv6hdr));
/* IPv6 header */ /* IPv6 header */
...@@ -1495,7 +1495,7 @@ static struct sk_buff *vxlan_na_create(struct sk_buff *request, ...@@ -1495,7 +1495,7 @@ static struct sk_buff *vxlan_na_create(struct sk_buff *request,
pip6->saddr = *(struct in6_addr *)n->primary_key; pip6->saddr = *(struct in6_addr *)n->primary_key;
skb_pull(reply, sizeof(struct ipv6hdr)); skb_pull(reply, sizeof(struct ipv6hdr));
skb_set_transport_header(reply, 0); skb_reset_transport_header(reply);
na = (struct nd_msg *)skb_put(reply, sizeof(*na) + na_olen); na = (struct nd_msg *)skb_put(reply, sizeof(*na) + na_olen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment