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
6f42fbf8
Commit
6f42fbf8
authored
Jul 11, 2003
by
Ville Nuorvala
Committed by
David S. Miller
Jul 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6] fix a dst leakage and clean-up in tcp_v6_connect()
parent
b50d7524
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
net/ipv6/tcp_ipv6.c
net/ipv6/tcp_ipv6.c
+11
-11
No files found.
net/ipv6/tcp_ipv6.c
View file @
6f42fbf8
...
@@ -544,7 +544,6 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
...
@@ -544,7 +544,6 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
struct
ipv6_pinfo
*
np
=
inet6_sk
(
sk
);
struct
ipv6_pinfo
*
np
=
inet6_sk
(
sk
);
struct
tcp_opt
*
tp
=
tcp_sk
(
sk
);
struct
tcp_opt
*
tp
=
tcp_sk
(
sk
);
struct
in6_addr
*
saddr
=
NULL
;
struct
in6_addr
*
saddr
=
NULL
;
struct
in6_addr
saddr_buf
;
struct
flowi
fl
;
struct
flowi
fl
;
struct
dst_entry
*
dst
;
struct
dst_entry
*
dst
;
int
addr_type
;
int
addr_type
;
...
@@ -671,23 +670,24 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
...
@@ -671,23 +670,24 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
goto
failure
;
goto
failure
;
}
}
ip6_dst_store
(
sk
,
dst
,
NULL
);
sk
->
sk_route_caps
=
dst
->
dev
->
features
&
~
(
NETIF_F_IP_CSUM
|
NETIF_F_TSO
);
if
(
saddr
==
NULL
)
{
if
(
saddr
==
NULL
)
{
err
=
ipv6_get_saddr
(
dst
,
&
np
->
daddr
,
&
saddr_buf
);
err
=
ipv6_get_saddr
(
dst
,
&
np
->
daddr
,
&
fl
.
fl6_src
);
if
(
err
)
if
(
err
)
{
dst_release
(
dst
);
goto
failure
;
goto
failure
;
}
saddr
=
&
saddr_buf
;
saddr
=
&
fl
.
fl6_src
;
ipv6_addr_copy
(
&
np
->
rcv_saddr
,
saddr
);
}
}
/* set the source address */
/* set the source address */
ipv6_addr_copy
(
&
np
->
rcv_saddr
,
saddr
);
ipv6_addr_copy
(
&
np
->
saddr
,
saddr
);
ipv6_addr_copy
(
&
np
->
saddr
,
saddr
);
inet
->
rcv_saddr
=
LOOPBACK4_IPV6
;
inet
->
rcv_saddr
=
LOOPBACK4_IPV6
;
ip6_dst_store
(
sk
,
dst
,
NULL
);
sk
->
sk_route_caps
=
dst
->
dev
->
features
&
~
(
NETIF_F_IP_CSUM
|
NETIF_F_TSO
);
tp
->
ext_header_len
=
0
;
tp
->
ext_header_len
=
0
;
if
(
np
->
opt
)
if
(
np
->
opt
)
tp
->
ext_header_len
=
np
->
opt
->
opt_flen
+
np
->
opt
->
opt_nflen
;
tp
->
ext_header_len
=
np
->
opt
->
opt_flen
+
np
->
opt
->
opt_nflen
;
...
@@ -714,8 +714,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
...
@@ -714,8 +714,8 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,
late_failure:
late_failure:
tcp_set_state
(
sk
,
TCP_CLOSE
);
tcp_set_state
(
sk
,
TCP_CLOSE
);
failure:
__sk_dst_reset
(
sk
);
__sk_dst_reset
(
sk
);
failure:
inet
->
dport
=
0
;
inet
->
dport
=
0
;
sk
->
sk_route_caps
=
0
;
sk
->
sk_route_caps
=
0
;
return
err
;
return
err
;
...
...
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