Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
4044a3f8
Commit
4044a3f8
authored
Oct 07, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[UDP/TCP]: Fix binding conflict tests wrt. SO_BINDTODEVICE.
parent
0a58cf1a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
+13
-4
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_ipv4.c
+3
-1
net/ipv4/udp.c
net/ipv4/udp.c
+3
-1
net/ipv6/tcp_ipv6.c
net/ipv6/tcp_ipv6.c
+4
-1
net/ipv6/udp.c
net/ipv6/udp.c
+3
-1
No files found.
net/ipv4/tcp_ipv4.c
View file @
4044a3f8
...
@@ -188,7 +188,9 @@ static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb)
...
@@ -188,7 +188,9 @@ static inline int tcp_bind_conflict(struct sock *sk, struct tcp_bind_bucket *tb)
sk_for_each_bound
(
sk2
,
node
,
&
tb
->
owners
)
{
sk_for_each_bound
(
sk2
,
node
,
&
tb
->
owners
)
{
if
(
sk
!=
sk2
&&
if
(
sk
!=
sk2
&&
!
ipv6_only_sock
(
sk2
)
&&
!
ipv6_only_sock
(
sk2
)
&&
sk
->
sk_bound_dev_if
==
sk2
->
sk_bound_dev_if
)
{
(
!
sk
->
sk_bound_dev_if
||
!
sk2
->
sk_bound_dev_if
||
sk
->
sk_bound_dev_if
==
sk2
->
sk_bound_dev_if
))
{
if
(
!
reuse
||
!
sk2
->
sk_reuse
||
if
(
!
reuse
||
!
sk2
->
sk_reuse
||
sk2
->
sk_state
==
TCP_LISTEN
)
{
sk2
->
sk_state
==
TCP_LISTEN
)
{
struct
inet_opt
*
inet2
=
inet_sk
(
sk2
);
struct
inet_opt
*
inet2
=
inet_sk
(
sk2
);
...
...
net/ipv4/udp.c
View file @
4044a3f8
...
@@ -176,7 +176,9 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum)
...
@@ -176,7 +176,9 @@ static int udp_v4_get_port(struct sock *sk, unsigned short snum)
if
(
inet2
->
num
==
snum
&&
if
(
inet2
->
num
==
snum
&&
sk2
!=
sk
&&
sk2
!=
sk
&&
!
ipv6_only_sock
(
sk2
)
&&
!
ipv6_only_sock
(
sk2
)
&&
sk2
->
sk_bound_dev_if
==
sk
->
sk_bound_dev_if
&&
(
!
sk2
->
bound_dev_if
||
!
sk
->
bound_dev_if
||
sk2
->
sk_bound_dev_if
==
sk
->
sk_bound_dev_if
)
&&
(
!
inet2
->
rcv_saddr
||
(
!
inet2
->
rcv_saddr
||
!
inet
->
rcv_saddr
||
!
inet
->
rcv_saddr
||
inet2
->
rcv_saddr
==
inet
->
rcv_saddr
)
&&
inet2
->
rcv_saddr
==
inet
->
rcv_saddr
)
&&
...
...
net/ipv6/tcp_ipv6.c
View file @
4044a3f8
...
@@ -101,7 +101,10 @@ static inline int tcp_v6_bind_conflict(struct sock *sk,
...
@@ -101,7 +101,10 @@ static inline int tcp_v6_bind_conflict(struct sock *sk,
/* We must walk the whole port owner list in this case. -DaveM */
/* We must walk the whole port owner list in this case. -DaveM */
sk_for_each_bound
(
sk2
,
node
,
&
tb
->
owners
)
{
sk_for_each_bound
(
sk2
,
node
,
&
tb
->
owners
)
{
if
(
sk
!=
sk2
&&
sk
->
sk_bound_dev_if
==
sk2
->
sk_bound_dev_if
&&
if
(
sk
!=
sk2
&&
(
!
sk
->
sk_bound_dev_if
||
!
sk2
->
sk_bound_dev_if
||
sk
->
sk_bound_dev_if
==
sk2
->
sk_bound_dev_if
)
&&
(
!
sk
->
sk_reuse
||
!
sk2
->
sk_reuse
||
(
!
sk
->
sk_reuse
||
!
sk2
->
sk_reuse
||
sk2
->
sk_state
==
TCP_LISTEN
)
&&
sk2
->
sk_state
==
TCP_LISTEN
)
&&
ipv6_rcv_saddr_equal
(
sk
,
sk2
))
ipv6_rcv_saddr_equal
(
sk
,
sk2
))
...
...
net/ipv6/udp.c
View file @
4044a3f8
...
@@ -112,7 +112,9 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum)
...
@@ -112,7 +112,9 @@ static int udp_v6_get_port(struct sock *sk, unsigned short snum)
&
udp_hash
[
snum
&
(
UDP_HTABLE_SIZE
-
1
)])
{
&
udp_hash
[
snum
&
(
UDP_HTABLE_SIZE
-
1
)])
{
if
(
inet_sk
(
sk2
)
->
num
==
snum
&&
if
(
inet_sk
(
sk2
)
->
num
==
snum
&&
sk2
!=
sk
&&
sk2
!=
sk
&&
sk2
->
sk_bound_dev_if
==
sk
->
sk_bound_dev_if
&&
(
!
sk2
->
sk_bound_dev_if
||
!
sk
->
sk_bound_dev_if
||
sk2
->
sk_bound_dev_if
==
sk
->
sk_bound_dev_if
)
&&
(
!
sk2
->
sk_reuse
||
!
sk
->
sk_reuse
)
&&
(
!
sk2
->
sk_reuse
||
!
sk
->
sk_reuse
)
&&
ipv6_rcv_saddr_equal
(
sk
,
sk2
))
ipv6_rcv_saddr_equal
(
sk
,
sk2
))
goto
fail
;
goto
fail
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment