kernel_optimize_test/include/net
Andrey Ignatov 3679d585bb net: Introduce __inet_bind() and __inet6_bind
Refactor `bind()` code to make it ready to be called from BPF helper
function `bpf_bind()` (will be added soon). Implementation of
`inet_bind()` and `inet6_bind()` is separated into `__inet_bind()` and
`__inet6_bind()` correspondingly. These function can be used from both
`sk_prot->bind` and `bpf_bind()` contexts.

New functions have two additional arguments.

`force_bind_address_no_port` forces binding to IP only w/o checking
`inet_sock.bind_address_no_port` field. It'll allow to bind local end of
a connection to desired IP in `bpf_bind()` w/o changing
`bind_address_no_port` field of a socket. It's useful since `bpf_bind()`
can return an error and we'd need to restore original value of
`bind_address_no_port` in that case if we changed this before calling to
the helper.

`with_lock` specifies whether to lock socket when working with `struct
sk` or not. The argument is set to `true` for `sk_prot->bind`, i.e. old
behavior is preserved. But it will be set to `false` for `bpf_bind()`
use-case. The reason is all call-sites, where `bpf_bind()` will be
called, already hold that socket lock.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-03-31 02:15:43 +02:00
..
9p
bluetooth net: annotate ->poll() instances 2017-11-27 16:20:04 -05:00
caif caif: reduce stack size with KASAN 2018-01-19 14:02:12 -05:00
iucv net: annotate ->poll() instances 2017-11-27 16:20:04 -05:00
netfilter netfilter: nf_flow_offload: fix use-after-free and a resource leak 2018-02-07 11:55:52 +01:00
netns net: Replace ip_ra_lock with per-net mutex 2018-03-22 15:12:56 -04:00
nfc
phonet
sctp sctp: use proc_remove_subtree() 2018-03-17 20:11:22 -04:00
tc_act net/sched: act_csum: don't use spinlock in the fast path 2018-01-23 19:51:46 -05:00
6lowpan.h
act_api.h net sched actions: add new tc_action_ops callback 2018-03-09 11:25:11 -05:00
addrconf.h net/ipv6: Change address check to always take a device argument 2018-03-16 11:28:38 -04:00
af_ieee802154.h
af_rxrpc.h
af_unix.h
af_vsock.h
ah.h
arp.h ipv4: Make neigh lookup keys for loopback/point-to-point devices be INADDR_ANY 2018-01-15 14:53:43 -05:00
atmclip.h
ax25.h net: Make ax25_ptr depend on CONFIG_AX25 2018-02-14 11:55:33 -05:00
ax88796.h
bond_3ad.h
bond_alb.h
bond_options.h
bonding.h
busy_poll.h
calipso.h
cfg80211-wext.h
cfg80211.h mac80211: support A-MSDU in fast-rx 2018-02-27 13:30:53 +01:00
cfg802154.h
checksum.h
cipso_ipv4.h
cls_cgroup.h
codel_impl.h
codel_qdisc.h
codel.h
compat.h
datalink.h
dcbevent.h
dcbnl.h
devlink.h devlink: Remove top_hierarchy arg for DEVLINK disabled path 2018-03-23 12:14:18 -04:00
dn_dev.h
dn_fib.h
dn_neigh.h
dn_nsp.h
dn_route.h decnet: Move dn_next into decnet route structure. 2017-11-30 09:54:25 -05:00
dn.h
dsa.h dsa: Pass the port to get_sset_count() 2018-03-04 13:34:18 -05:00
dsfield.h
dst_cache.h net: core: dst_cache_set_ip6: Rename 'addr' parameter to 'saddr' for consistency 2018-03-05 12:52:45 -05:00
dst_metadata.h
dst_ops.h
dst.h net: core: dst: Add kernel-doc for 'net' parameter 2018-03-05 12:52:45 -05:00
erspan.h net: erspan: fix metadata extraction 2018-02-06 11:32:48 -05:00
esp.h
ethoc.h inet: whitespace cleanup 2018-02-28 11:43:28 -05:00
fib_notifier.h
fib_rules.h net/ipv6: Pass skb to route lookup 2018-03-04 13:04:22 -05:00
firewire.h
flow_dissector.h tipc: improve link resiliency when rps is activated 2017-11-11 15:36:05 +09:00
flow.h net: Remove unused get_hash_from_flow functions 2018-03-04 13:04:23 -05:00
fou.h
fq_impl.h
fq.h
garp.h
gen_stats.h net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mq 2017-12-08 13:32:26 -05:00
genetlink.h genetlink: fix genlmsg_nlhdr() 2017-11-16 10:49:00 +09:00
geneve.h
gre.h net: GRE: Add is_gretap_dev, is_ip6gretap_dev 2018-02-27 14:46:26 -05:00
gro_cells.h
gtp.h
gue.h fou: fix some member types in guehdr 2017-12-11 14:10:06 -05:00
hwbm.h
icmp.h
ieee80211_radiotap.h mac80211: support reporting A-MPDU EOF bit value/known 2018-02-22 21:13:02 +01:00
ieee802154_netdev.h
if_inet6.h
ife.h
ila.h
inet_common.h net: Introduce __inet_bind() and __inet6_bind 2018-03-31 02:15:43 +02:00
inet_connection_sock.h inet: whitespace cleanup 2018-02-28 11:43:28 -05:00
inet_ecn.h
inet_frag.h
inet_hashtables.h inet: Add a 2nd listener hashtable (port+addr) 2017-12-03 10:18:28 -05:00
inet_sock.h net: sock: replace sk_state_load with inet_sk_state_load and remove sk_state_store 2017-12-20 14:00:25 -05:00
inet_timewait_sock.h tcp/dccp: avoid one atomic operation for timewait hashdance 2017-12-13 14:33:10 -05:00
inet6_connection_sock.h
inet6_hashtables.h
inetpeer.h
ip_fib.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
ip_tunnels.h net: do not create fallback tunnels for non-default namespaces 2018-03-09 11:23:11 -05:00
ip_vs.h netfilter: ipvs: Remove useless ipvsh param of frag_safe_skb_hp 2018-01-08 18:01:02 +01:00
ip.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
ip6_checksum.h
ip6_fib.h net/ipv6: Pass skb to route lookup 2018-03-04 13:04:22 -05:00
ip6_route.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
ip6_tunnel.h ip6_gre: add erspan v2 support 2017-12-15 12:34:00 -05:00
ipcomp.h
ipconfig.h
ipv6.h net: Introduce __inet_bind() and __inet6_bind 2018-03-31 02:15:43 +02:00
ipx.h
iw_handler.h
kcm.h
l3mdev.h
lapb.h
lib80211.h
llc_c_ac.h
llc_c_ev.h
llc_c_st.h
llc_conn.h
llc_if.h
llc_pdu.h
llc_s_ac.h
llc_s_ev.h
llc_s_st.h
llc_sap.h
llc.h
lwtunnel.h net: Move ipv4 set_lwt_redirect helper to lwtunnel 2018-02-14 14:43:32 -05:00
mac80211.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
mac802154.h
mip6.h
mld.h
mpls_iptunnel.h
mpls.h
mrp.h
ncsi.h
ndisc.h
neighbour.h
net_namespace.h net: add uevent socket member 2018-03-22 11:16:42 -04:00
net_ratelimit.h
netevent.h net/ipv6: Add support for path selection using hash of 5-tuple 2018-03-04 13:04:23 -05:00
netlabel.h
netlink.h
netprio_cgroup.h
netrom.h
nexthop.h
nl802154.h
nsh.h
p8022.h
ping.h
pkt_cls.h net: sch: prio: Add offload ability for grafting a child 2018-02-28 12:06:01 -05:00
pkt_sched.h net: remove prototype of qdisc_lookup_class() 2018-01-16 14:56:54 -05:00
pptp.h
protocol.h
psample.h
psnap.h
raw.h
rawv6.h
red.h net_sched: red: Avoid illegal values 2017-12-05 14:37:13 -05:00
regulatory.h regulatory: add NUL to request alpha2 2018-02-22 20:57:48 +01:00
request_sock.h
rose.h
route.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
rtnetlink.h rtnetlink: remove __rtnl_register 2017-12-04 11:32:53 -05:00
sch_generic.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-03-23 11:31:58 -04:00
scm.h
secure_seq.h
seg6_hmac.h
seg6.h
slhc_vj.h
smc.h
snmp.h
sock_reuseport.h
sock.h bpf: sockmap redirect ingress support 2018-03-30 00:09:43 +02:00
Space.h net/mac89x0: Convert to platform_driver 2018-03-01 21:21:36 -05:00
stp.h
strparser.h
switchdev.h net: bridge: Add/del switchdev object on host join/leave 2017-11-10 13:41:40 +09:00
tcp_states.h tcp: remove the hardcode in the definition of TCPF Macro 2018-02-21 15:06:05 -05:00
tcp.h tcp_bbr: better deal with suboptimal GSO (II) 2018-03-01 21:44:28 -05:00
timewait_sock.h
tipc.h tipc: improve link resiliency when rps is activated 2017-11-11 15:36:05 +09:00
tls.h tls: Add support for encryption using async offload accelerator 2018-01-31 10:26:30 -05:00
transp_v6.h
tso.h
tun_proto.h
udp_tunnel.h
udp.h net: annotate ->poll() instances 2017-11-27 16:20:04 -05:00
udplite.h udplite: fix partial checksum initialization 2018-02-16 15:57:42 -05:00
vsock_addr.h
vxlan.h vxlan: Fix trailing semicolon 2018-01-17 16:07:24 -05:00
wext.h lift handling of SIOCIW... out of dev_ioctl() 2018-01-24 19:13:45 -05:00
wimax.h
x25.h
x25device.h
xdp.h xdp/qede: setup xdp_rxq_info and intro xdp_rxq_info_is_reg 2018-01-05 15:21:21 -08:00
xfrm.h inet: whitespace cleanup 2018-02-28 11:43:28 -05:00