Repository navigation
Commit b0e9a2f
sctp: add support for SCTP_REUSE_PORT sockopt
This feature is actually already supported by sk->sk_reuse which can be
set by socket level opt SO_REUSEADDR. But it's not working exactly as
RFC6458 demands in section 8.1.27, like:
- This option only supports one-to-one style SCTP sockets
- This socket option must not be used after calling bind()
or sctp_bindx().
Besides, SCTP_REUSE_PORT sockopt should be provided for user's programs.
Otherwise, the programs with SCTP_REUSE_PORT from other systems will not
work in linux.
To separate it from the socket level version, this patch adds 'reuse' in
sctp_sock and it works pretty much as sk->sk_reuse, but with some extra
setup limitations that are needed when it is being enabled.
"It should be noted that the behavior of the socket-level socket option
to reuse ports and/or addresses for SCTP sockets is unspecified", so it
leaves SO_REUSEADDR as is for the compatibility.
Note that the name SCTP_REUSE_PORT is somewhat confusing, as its
functionality is nearly identical to SO_REUSEADDR, but with some
extra restrictions. Here it uses 'reuse' in sctp_sock instead of
'reuseport'. As for sk->sk_reuseport support for SCTP, it will be
added in another patch.
Thanks to Neil to make this clear.
v1->v2:
- add sctp_sk->reuse to separate it from the socket level version.
v2->v3:
- improve changelog according to Marcelo's suggestion.
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 23c94d6 commit b0e9a2f
3 files changed
Lines changed: 57 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4170 | 4170 | | |
4171 | 4171 | | |
4172 | 4172 | | |
| 4173 | + | |
| 4174 | + | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
| 4186 | + | |
| 4187 | + | |
| 4188 | + | |
| 4189 | + | |
| 4190 | + | |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
| 4194 | + | |
4173 | 4195 | | |
4174 | 4196 | | |
4175 | 4197 | | |
| |||
4364 | 4386 | | |
4365 | 4387 | | |
4366 | 4388 | | |
| 4389 | + | |
| 4390 | + | |
| 4391 | + | |
4367 | 4392 | | |
4368 | 4393 | | |
4369 | 4394 | | |
| |||
7197 | 7222 | | |
7198 | 7223 | | |
7199 | 7224 | | |
| 7225 | + | |
| 7226 | + | |
| 7227 | + | |
| 7228 | + | |
| 7229 | + | |
| 7230 | + | |
| 7231 | + | |
| 7232 | + | |
| 7233 | + | |
| 7234 | + | |
| 7235 | + | |
| 7236 | + | |
| 7237 | + | |
| 7238 | + | |
| 7239 | + | |
| 7240 | + | |
| 7241 | + | |
| 7242 | + | |
| 7243 | + | |
| 7244 | + | |
7200 | 7245 | | |
7201 | 7246 | | |
7202 | 7247 | | |
| |||
7392 | 7437 | | |
7393 | 7438 | | |
7394 | 7439 | | |
| 7440 | + | |
| 7441 | + | |
| 7442 | + | |
7395 | 7443 | | |
7396 | 7444 | | |
7397 | 7445 | | |
| |||
7429 | 7477 | | |
7430 | 7478 | | |
7431 | 7479 | | |
| 7480 | + | |
7432 | 7481 | | |
7433 | 7482 | | |
7434 | 7483 | | |
| |||
7501 | 7550 | | |
7502 | 7551 | | |
7503 | 7552 | | |
7504 | | - | |
7505 | 7553 | | |
7506 | 7554 | | |
7507 | 7555 | | |
7508 | 7556 | | |
7509 | | - | |
7510 | | - | |
| 7557 | + | |
7511 | 7558 | | |
7512 | 7559 | | |
7513 | 7560 | | |
| |||
7525 | 7572 | | |
7526 | 7573 | | |
7527 | 7574 | | |
7528 | | - | |
| 7575 | + | |
7529 | 7576 | | |
7530 | 7577 | | |
7531 | 7578 | | |
| |||
7549 | 7596 | | |
7550 | 7597 | | |
7551 | 7598 | | |
7552 | | - | |
| 7599 | + | |
7553 | 7600 | | |
7554 | 7601 | | |
7555 | 7602 | | |
7556 | 7603 | | |
7557 | | - | |
| 7604 | + | |
7558 | 7605 | | |
7559 | 7606 | | |
7560 | 7607 | | |
| |||
7685 | 7732 | | |
7686 | 7733 | | |
7687 | 7734 | | |
7688 | | - | |
| 7735 | + | |
7689 | 7736 | | |
7690 | 7737 | | |
7691 | 7738 | | |
| |||
8550 | 8597 | | |
8551 | 8598 | | |
8552 | 8599 | | |
| 8600 | + | |
8553 | 8601 | | |
8554 | 8602 | | |
8555 | 8603 | | |
| |||
0 commit comments