Commit 74b6551b authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by David S. Miller

ipv6: exthdrs: use swap macro in ipv6_dest_hao

make use of the swap macro and remove unnecessary variable tmp_addr.
This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a830405e
...@@ -187,7 +187,6 @@ static bool ipv6_dest_hao(struct sk_buff *skb, int optoff) ...@@ -187,7 +187,6 @@ static bool ipv6_dest_hao(struct sk_buff *skb, int optoff)
struct ipv6_destopt_hao *hao; struct ipv6_destopt_hao *hao;
struct inet6_skb_parm *opt = IP6CB(skb); struct inet6_skb_parm *opt = IP6CB(skb);
struct ipv6hdr *ipv6h = ipv6_hdr(skb); struct ipv6hdr *ipv6h = ipv6_hdr(skb);
struct in6_addr tmp_addr;
int ret; int ret;
if (opt->dsthao) { if (opt->dsthao) {
...@@ -229,9 +228,7 @@ static bool ipv6_dest_hao(struct sk_buff *skb, int optoff) ...@@ -229,9 +228,7 @@ static bool ipv6_dest_hao(struct sk_buff *skb, int optoff)
if (skb->ip_summed == CHECKSUM_COMPLETE) if (skb->ip_summed == CHECKSUM_COMPLETE)
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
tmp_addr = ipv6h->saddr; swap(ipv6h->saddr, hao->addr);
ipv6h->saddr = hao->addr;
hao->addr = tmp_addr;
if (skb->tstamp == 0) if (skb->tstamp == 0)
__net_timestamp(skb); __net_timestamp(skb);
......
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