Commit 8912bbc
Paolo Abeni
net: Return errno in sk->sk_prot->get_port().
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2166482
Tested: vs bz reproducer
Conflicts: different context in inet_csk_get_port and udp_lib_get_port,\
as rhel-9 lacks the upstream commit 08eaef9 ("tcp: Clean up \
some functions.") and upstream commit 919dfa0 ("udp: Clean up \
some functions.")
Upstream commit:
commit 7a7160e
Author: Kuniyuki Iwashima <kuniyu@amazon.com>
Date: Fri Nov 18 10:25:06 2022 -0800
net: Return errno in sk->sk_prot->get_port().
We assume the correct errno is -EADDRINUSE when sk->sk_prot->get_port()
fails, so some ->get_port() functions return just 1 on failure and the
callers return -EADDRINUSE instead.
However, mptcp_get_port() can return -EINVAL. Let's not ignore the error.
Note the only exception is inet_autobind(), all of whose callers return
-EAGAIN instead.
Fixes: cec37a6 ("mptcp: Handle MP_CAPABLE options for outgoing connections")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>1 parent cceb43f commit 8912bbc
File tree
5 files changed
+10
-9
lines changed- net
- ipv4
- ipv6
5 files changed
+10
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
| 528 | + | |
| 529 | + | |
529 | 530 | | |
530 | | - | |
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| |||
1054 | 1054 | | |
1055 | 1055 | | |
1056 | 1056 | | |
1057 | | - | |
| 1057 | + | |
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
| |||
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | | - | |
| 1077 | + | |
| 1078 | + | |
1078 | 1079 | | |
1079 | 1080 | | |
1080 | 1081 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | 237 | | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
| 415 | + | |
415 | 416 | | |
416 | 417 | | |
417 | | - | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| |||
0 commit comments