Commit 4cdf85ef authored by Yao Jing's avatar Yao Jing Committed by David S. Miller

ipv6: ah6: use swap() to make code cleaner

Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarYao Jing <yao.jing2@zte.com.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent df6160de
...@@ -175,7 +175,6 @@ static void ipv6_rearrange_destopt(struct ipv6hdr *iph, struct ipv6_opt_hdr *des ...@@ -175,7 +175,6 @@ static void ipv6_rearrange_destopt(struct ipv6hdr *iph, struct ipv6_opt_hdr *des
* See 11.3.2 of RFC 3775 for details. * See 11.3.2 of RFC 3775 for details.
*/ */
if (opt[off] == IPV6_TLV_HAO) { if (opt[off] == IPV6_TLV_HAO) {
struct in6_addr final_addr;
struct ipv6_destopt_hao *hao; struct ipv6_destopt_hao *hao;
hao = (struct ipv6_destopt_hao *)&opt[off]; hao = (struct ipv6_destopt_hao *)&opt[off];
...@@ -184,9 +183,7 @@ static void ipv6_rearrange_destopt(struct ipv6hdr *iph, struct ipv6_opt_hdr *des ...@@ -184,9 +183,7 @@ static void ipv6_rearrange_destopt(struct ipv6hdr *iph, struct ipv6_opt_hdr *des
hao->length); hao->length);
goto bad; goto bad;
} }
final_addr = hao->addr; swap(hao->addr, iph->saddr);
hao->addr = iph->saddr;
iph->saddr = final_addr;
} }
break; break;
} }
......
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