OSDN Git Service

net: add helpers checking if socket can be bound to nonlocal address
authorVincent Bernat <vincent@bernat.im>
Tue, 31 Jul 2018 19:18:11 +0000 (21:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Aug 2018 16:50:04 +0000 (09:50 -0700)
commit83ba4645152d1177c161750e1064e3a8e7cee19b
tree7209c851dda98efb2aa1e7a42ff738d3fe560c38
parentd39db3b4d60c9bc4282b36753a7255d2a5ef0384
net: add helpers checking if socket can be bound to nonlocal address

The construction "net->ipv4.sysctl_ip_nonlocal_bind || inet->freebind
|| inet->transparent" is present three times and its IPv6 counterpart
is also present three times. We introduce two small helpers to
characterize these tests uniformly.

Signed-off-by: Vincent Bernat <vincent@bernat.im>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_sock.h
include/net/ipv6.h
net/ipv4/af_inet.c
net/ipv4/ping.c
net/ipv6/af_inet6.c
net/ipv6/datagram.c