linux-stable/include
Xin Long 8afb9f5344 sctp: fix the issue that flags are ignored when using kernel_connect
commit 644fbdeacf upstream.

Now sctp uses inet_dgram_connect as its proto_ops .connect, and the flags
param can't be passed into its proto .connect where this flags is really
needed.

sctp works around it by getting flags from socket file in __sctp_connect.
It works for connecting from userspace, as inherently the user sock has
socket file and it passes f_flags as the flags param into the proto_ops
.connect.

However, the sock created by sock_create_kern doesn't have a socket file,
and it passes the flags (like O_NONBLOCK) by using the flags param in
kernel_connect, which calls proto_ops .connect later.

So to fix it, this patch defines a new proto_ops .connect for sctp,
sctp_inet_connect, which calls __sctp_connect() directly with this
flags param. After this, the sctp's proto .connect can be removed.

Note that sctp_inet_connect doesn't need to do some checks that are not
needed for sctp, which makes thing better than with inet_dgram_connect.

Suggested-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-11-06 12:43:39 +01:00
..
acpi ACPICA: Reference Counts: increase max to 0x4000 for large servers 2019-03-19 13:13:21 +01:00
asm-generic asm-generic: fix -Wtype-limits compiler warnings 2019-08-25 10:50:18 +02:00
clocksource
crypto crypto: vmac - separate tfm and request context 2018-08-17 21:01:10 +02:00
drm drm/crc: Only report a single overflow when a CRC fd is opened 2019-07-31 07:28:56 +02:00
dt-bindings dt-bindings: clock: mediatek: add binding for fixed-factor clock axisel_d4 2018-04-24 09:36:34 +02:00
keys keys: Fix dependency loop between construction record and auth key 2019-03-23 14:35:14 +01:00
kvm KVM: arm/arm64: Sync ICH_VMCR_EL2 back when about to block 2019-08-25 10:50:18 +02:00
linux cfg80211: Use const more consistently in for_each_element macros 2019-10-11 18:18:49 +02:00
math-emu
media media: cec: make cec_get_edid_spa_location() an inline function 2019-05-16 19:42:26 +02:00
memory
misc
net sctp: fix the issue that flags are ignored when using kernel_connect 2019-11-06 12:43:39 +01:00
pcmcia
ras
rdma IB/core: Add an unbound WQ type to the new CQ API 2019-10-05 12:47:32 +02:00
scsi scsi: core: save/restore command resid for error handling 2019-10-29 09:17:31 +01:00
soc memory: tegra: Apply interrupts mask per SoC 2018-08-03 07:50:38 +02:00
sound ASoC: Define a set of DAPM pre/post-up events 2019-10-11 18:18:30 +02:00
target
trace sched, trace: Fix prev_state output in sched_switch tracepoint 2019-02-20 10:20:55 +01:00
uapi netfilter: xt_nfacct: Fix alignment mismatch in xt_nfacct_match_info 2019-09-21 07:15:32 +02:00
video udlfb: set optimal write delay 2018-09-09 19:56:01 +02:00
xen xen/events: fix binding user event channels to cpus 2019-07-31 07:28:39 +02:00