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
aecec5f9
Commit
aecec5f9
authored
Mar 21, 2002
by
Charles-Edouard Ruault
Committed by
David S. Miller
Mar 21, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure outgoing ICMP and TCP resets
use the most uptodate value of ip_default_ttl sysctl.
parent
cd415a87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
net/ipv4/icmp.c
net/ipv4/icmp.c
+4
-0
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_ipv4.c
+2
-0
No files found.
net/ipv4/icmp.c
View file @
aecec5f9
...
...
@@ -139,6 +139,8 @@ struct icmp_err icmp_err_convert[] = {
{
EHOSTUNREACH
,
1
}
/* ICMP_PREC_CUTOFF */
};
extern
int
sysctl_ip_default_ttl
;
/* Control parameters for ECHO replies. */
int
sysctl_icmp_echo_ignore_all
;
int
sysctl_icmp_echo_ignore_broadcasts
;
...
...
@@ -354,6 +356,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
icmp_out_count
(
icmp_param
->
data
.
icmph
.
type
);
inet
->
tos
=
skb
->
nh
.
iph
->
tos
;
inet
->
ttl
=
sysctl_ip_default_ttl
;
daddr
=
ipc
.
addr
=
rt
->
rt_src
;
ipc
.
opt
=
NULL
;
if
(
icmp_param
->
replyopts
.
optlen
)
{
...
...
@@ -498,6 +501,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info)
icmp_param
.
offset
=
skb_in
->
nh
.
raw
-
skb_in
->
data
;
icmp_out_count
(
icmp_param
.
data
.
icmph
.
type
);
inet_sk
(
icmp_socket
->
sk
)
->
tos
=
tos
;
inet_sk
(
icmp_socket
->
sk
)
->
ttl
=
sysctl_ip_default_ttl
;
ipc
.
addr
=
iph
->
saddr
;
ipc
.
opt
=
&
icmp_param
.
replyopts
;
if
(
icmp_param
.
replyopts
.
srr
)
{
...
...
net/ipv4/tcp_ipv4.c
View file @
aecec5f9
...
...
@@ -64,6 +64,7 @@
#include <linux/ipsec.h>
extern
int
sysctl_ip_dynaddr
;
extern
int
sysctl_ip_default_ttl
;
int
sysctl_tcp_tw_reuse
=
0
;
/* Check TCP sequence numbers in ICMP packets. */
...
...
@@ -1201,6 +1202,7 @@ static void tcp_v4_send_reset(struct sk_buff *skb)
arg
.
n_iov
=
1
;
arg
.
csumoffset
=
offsetof
(
struct
tcphdr
,
check
)
/
2
;
tcp_socket
->
sk
->
protinfo
.
af_inet
.
ttl
=
sysctl_ip_default_ttl
;
ip_send_reply
(
tcp_socket
->
sk
,
skb
,
&
arg
,
sizeof
rth
);
TCP_INC_STATS_BH
(
TcpOutSegs
);
...
...
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