linux/include/net/sctp
Xin Long 644fbdeacf sctp: fix the issue that flags are ignored when using kernel_connect
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>
2018-05-22 13:37:26 -04:00
..
auth.h sctp: add sockopt SCTP_AUTH_DEACTIVATE_KEY 2018-03-14 13:48:27 -04:00
checksum.h sctp: force the params with right types for sctp csum apis 2017-11-28 11:00:13 -05:00
command.h sctp: add SCTP_AUTH_NO_AUTH type for AUTHENTICATION_EVENT 2018-03-14 13:48:27 -04:00
constants.h sctp: implement assign_number for sctp_stream_interleave 2017-12-11 11:23:04 -05:00
sctp.h sctp: fix the issue that flags are ignored when using kernel_connect 2018-05-22 13:37:26 -04:00
sm.h sctp: add refcnt support for sh_key 2018-03-14 13:48:27 -04:00
stream_interleave.h sctp: implement handle_ftsn for sctp_stream_interleave 2017-12-15 13:52:22 -05:00
stream_sched.h sctp: remove extern from stream sched 2017-11-28 11:00:13 -05:00
structs.h selinux/stable-4.17 PR 20180403 2018-04-06 15:39:26 -07:00
tsnmap.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
ulpevent.h sctp: implement abort_pd for sctp_stream_interleave 2017-12-11 11:23:05 -05:00
ulpqueue.h sctp: add support for the process of unordered idata 2017-12-11 11:23:05 -05:00