Commit 8e5afcc7 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[IPV6]: Use the cheaper ipv6_addr_any() for ipv6_addr_type() where possible.

parent 822d2c51
...@@ -464,7 +464,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr, ...@@ -464,7 +464,7 @@ int inet6_getname(struct socket *sock, struct sockaddr *uaddr,
if (np->sndflow) if (np->sndflow)
sin->sin6_flowinfo = np->flow_label; sin->sin6_flowinfo = np->flow_label;
} else { } else {
if (ipv6_addr_type(&np->rcv_saddr) == IPV6_ADDR_ANY) if (ipv6_addr_any(&np->rcv_saddr))
ipv6_addr_copy(&sin->sin6_addr, &np->saddr); ipv6_addr_copy(&sin->sin6_addr, &np->saddr);
else else
ipv6_addr_copy(&sin->sin6_addr, &np->rcv_saddr); ipv6_addr_copy(&sin->sin6_addr, &np->rcv_saddr);
......
...@@ -544,7 +544,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh, ...@@ -544,7 +544,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
} }
len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr); len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
send_llinfo = dev->addr_len && ipv6_addr_type(saddr) != IPV6_ADDR_ANY; send_llinfo = dev->addr_len && !ipv6_addr_any(saddr);
if (send_llinfo) if (send_llinfo)
len += NDISC_OPT_SPACE(dev->addr_len); len += NDISC_OPT_SPACE(dev->addr_len);
......
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