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
Kirill Smelkov
linux
Commits
1009695b
Commit
1009695b
authored
Mar 19, 2002
by
Alexey Kuznetsov
Committed by
David S. Miller
Mar 19, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UDP fixes:
- respect multicast interface when connecting
parent
a0faeab7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
net/ipv4/udp.c
net/ipv4/udp.c
+12
-2
net/ipv6/udp.c
net/ipv6/udp.c
+5
-0
No files found.
net/ipv4/udp.c
View file @
1009695b
...
@@ -725,6 +725,8 @@ int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
...
@@ -725,6 +725,8 @@ int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
struct
inet_opt
*
inet
=
inet_sk
(
sk
);
struct
inet_opt
*
inet
=
inet_sk
(
sk
);
struct
sockaddr_in
*
usin
=
(
struct
sockaddr_in
*
)
uaddr
;
struct
sockaddr_in
*
usin
=
(
struct
sockaddr_in
*
)
uaddr
;
struct
rtable
*
rt
;
struct
rtable
*
rt
;
u32
saddr
;
int
oif
;
int
err
;
int
err
;
...
@@ -736,8 +738,16 @@ int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
...
@@ -736,8 +738,16 @@ int udp_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
sk_dst_reset
(
sk
);
sk_dst_reset
(
sk
);
err
=
ip_route_connect
(
&
rt
,
usin
->
sin_addr
.
s_addr
,
inet
->
saddr
,
oif
=
sk
->
bound_dev_if
;
RT_CONN_FLAGS
(
sk
),
sk
->
bound_dev_if
);
saddr
=
inet
->
saddr
;
if
(
MULTICAST
(
usin
->
sin_addr
.
s_addr
))
{
if
(
!
oif
)
oif
=
inet
->
mc_index
;
if
(
!
saddr
)
saddr
=
inet
->
mc_addr
;
}
err
=
ip_route_connect
(
&
rt
,
usin
->
sin_addr
.
s_addr
,
saddr
,
RT_CONN_FLAGS
(
sk
),
oif
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
if
((
rt
->
rt_flags
&
RTCF_BROADCAST
)
&&
!
sk
->
broadcast
)
{
if
((
rt
->
rt_flags
&
RTCF_BROADCAST
)
&&
!
sk
->
broadcast
)
{
...
...
net/ipv6/udp.c
View file @
1009695b
...
@@ -293,6 +293,8 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
...
@@ -293,6 +293,8 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
sk
->
bound_dev_if
=
usin
->
sin6_scope_id
;
sk
->
bound_dev_if
=
usin
->
sin6_scope_id
;
if
(
!
sk
->
bound_dev_if
&&
(
addr_type
&
IPV6_ADDR_MULTICAST
))
fl
.
oif
=
np
->
mcast_oif
;
}
}
/* Connect to link-local address requires an interface */
/* Connect to link-local address requires an interface */
...
@@ -317,6 +319,9 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
...
@@ -317,6 +319,9 @@ int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
fl
.
uli_u
.
ports
.
dport
=
inet
->
dport
;
fl
.
uli_u
.
ports
.
dport
=
inet
->
dport
;
fl
.
uli_u
.
ports
.
sport
=
inet
->
sport
;
fl
.
uli_u
.
ports
.
sport
=
inet
->
sport
;
if
(
!
fl
.
oif
&&
(
addr_type
&
IPV6_ADDR_MULTICAST
))
fl
.
oif
=
np
->
mcast_oif
;
if
(
flowlabel
)
{
if
(
flowlabel
)
{
if
(
flowlabel
->
opt
&&
flowlabel
->
opt
->
srcrt
)
{
if
(
flowlabel
->
opt
&&
flowlabel
->
opt
->
srcrt
)
{
struct
rt0_hdr
*
rt0
=
(
struct
rt0_hdr
*
)
flowlabel
->
opt
->
srcrt
;
struct
rt0_hdr
*
rt0
=
(
struct
rt0_hdr
*
)
flowlabel
->
opt
->
srcrt
;
...
...
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