Based on a request raised on the sctp devel list, there is a need to augment the sctp_peeloff operation while specifying the O_CLOEXEC and O_NONBLOCK flags (simmilar to the socket syscall). Since modifying the SCTP_SOCKOPT_PEELOFF socket option would break user space ABI for existing programs, this patch creates a new socket option SCTP_SOCKOPT_PEELOFF_FLAGS, which accepts a third flags parameter to allow atomic assignment of the socket descriptor flags. Tested successfully by myself and the requestor
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -121,6 +121,7 @@ typedef __s32 sctp_assoc_t; · 120 unmodified lines | ||
| 121 | 121 | #define SCTP_RESET_STREAMS 119 |
| 122 | 122 | #define SCTP_RESET_ASSOC 120 |
| 123 | 123 | #define SCTP_ADD_STREAMS 121 |
| 124 | +#define SCTP_SOCKOPT_PEELOFF_FLAGS 122 | |
| 124 | 125 | |
| 125 | 126 | /* PR-SCTP policies */ |
| 126 | 127 | #define SCTP_PR_SCTP_NONE 0x0000 |
| @@ -978,6 +979,11 @@ typedef struct { · 851 unmodified lines | ||
| 978 | 979 | int sd; |
| 979 | 980 | } sctp_peeloff_arg_t; |
| 980 | 981 | |
| 982 | +typedef struct { | |
| 983 | + sctp_peeloff_arg_t p_arg; | |
| 984 | + unsigned flags; | |
| 985 | +} sctp_peeloff_flags_arg_t; | |
| 986 | + | |
| 981 | 987 | /* |
| 982 | 988 | * Peer Address Thresholds socket option |
| 983 | 989 | */ |