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
53d30f64
Commit
53d30f64
authored
Jun 14, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TCP]: Use proper time_*() comparisons on jiffies.
parent
d1c4a48c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_ipv4.c
+1
-1
net/ipv4/tcp_minisocks.c
net/ipv4/tcp_minisocks.c
+2
-2
net/ipv4/tcp_timer.c
net/ipv4/tcp_timer.c
+3
-3
No files found.
net/ipv4/tcp_ipv4.c
View file @
53d30f64
...
@@ -1363,7 +1363,7 @@ static inline void syn_flood_warning(struct sk_buff *skb)
...
@@ -1363,7 +1363,7 @@ static inline void syn_flood_warning(struct sk_buff *skb)
{
{
static
unsigned
long
warntime
;
static
unsigned
long
warntime
;
if
(
jiffies
-
warntime
>
HZ
*
60
)
{
if
(
time_after
(
jiffies
,
(
warntime
+
HZ
*
60
))
)
{
warntime
=
jiffies
;
warntime
=
jiffies
;
printk
(
KERN_INFO
printk
(
KERN_INFO
"possible SYN flooding on port %d. Sending cookies.
\n
"
,
"possible SYN flooding on port %d. Sending cookies.
\n
"
,
...
...
net/ipv4/tcp_minisocks.c
View file @
53d30f64
...
@@ -563,7 +563,7 @@ void tcp_tw_schedule(struct tcp_tw_bucket *tw, int timeo)
...
@@ -563,7 +563,7 @@ void tcp_tw_schedule(struct tcp_tw_bucket *tw, int timeo)
tcp_twcal_timer
.
expires
=
tcp_twcal_jiffie
+
(
slot
<<
TCP_TW_RECYCLE_TICK
);
tcp_twcal_timer
.
expires
=
tcp_twcal_jiffie
+
(
slot
<<
TCP_TW_RECYCLE_TICK
);
add_timer
(
&
tcp_twcal_timer
);
add_timer
(
&
tcp_twcal_timer
);
}
else
{
}
else
{
if
(
(
long
)(
tcp_twcal_timer
.
expires
-
jiffies
)
>
(
slot
<<
TCP_TW_RECYCLE_TICK
))
if
(
time_after
(
tcp_twcal_timer
.
expires
,
jiffies
+
(
slot
<<
TCP_TW_RECYCLE_TICK
)
))
mod_timer
(
&
tcp_twcal_timer
,
jiffies
+
(
slot
<<
TCP_TW_RECYCLE_TICK
));
mod_timer
(
&
tcp_twcal_timer
,
jiffies
+
(
slot
<<
TCP_TW_RECYCLE_TICK
));
slot
=
(
tcp_twcal_hand
+
slot
)
&
(
TCP_TW_RECYCLE_SLOTS
-
1
);
slot
=
(
tcp_twcal_hand
+
slot
)
&
(
TCP_TW_RECYCLE_SLOTS
-
1
);
}
}
...
@@ -596,7 +596,7 @@ void tcp_twcal_tick(unsigned long dummy)
...
@@ -596,7 +596,7 @@ void tcp_twcal_tick(unsigned long dummy)
j
=
tcp_twcal_jiffie
;
j
=
tcp_twcal_jiffie
;
for
(
n
=
0
;
n
<
TCP_TW_RECYCLE_SLOTS
;
n
++
)
{
for
(
n
=
0
;
n
<
TCP_TW_RECYCLE_SLOTS
;
n
++
)
{
if
(
(
long
)(
j
-
now
)
<=
0
)
{
if
(
time_before_eq
(
j
,
now
)
)
{
struct
tcp_tw_bucket
*
tw
;
struct
tcp_tw_bucket
*
tw
;
while
((
tw
=
tcp_twcal_row
[
slot
])
!=
NULL
)
{
while
((
tw
=
tcp_twcal_row
[
slot
])
!=
NULL
)
{
...
...
net/ipv4/tcp_timer.c
View file @
53d30f64
...
@@ -227,7 +227,7 @@ static void tcp_delack_timer(unsigned long data)
...
@@ -227,7 +227,7 @@ static void tcp_delack_timer(unsigned long data)
if
(
sk
->
sk_state
==
TCP_CLOSE
||
!
(
tp
->
ack
.
pending
&
TCP_ACK_TIMER
))
if
(
sk
->
sk_state
==
TCP_CLOSE
||
!
(
tp
->
ack
.
pending
&
TCP_ACK_TIMER
))
goto
out
;
goto
out
;
if
(
(
long
)(
tp
->
ack
.
timeout
-
jiffies
)
>
0
)
{
if
(
time_after
(
tp
->
ack
.
timeout
,
jiffies
)
)
{
if
(
!
mod_timer
(
&
tp
->
delack_timer
,
tp
->
ack
.
timeout
))
if
(
!
mod_timer
(
&
tp
->
delack_timer
,
tp
->
ack
.
timeout
))
sock_hold
(
sk
);
sock_hold
(
sk
);
goto
out
;
goto
out
;
...
@@ -436,7 +436,7 @@ static void tcp_write_timer(unsigned long data)
...
@@ -436,7 +436,7 @@ static void tcp_write_timer(unsigned long data)
if
(
sk
->
sk_state
==
TCP_CLOSE
||
!
tp
->
pending
)
if
(
sk
->
sk_state
==
TCP_CLOSE
||
!
tp
->
pending
)
goto
out
;
goto
out
;
if
(
(
long
)(
tp
->
timeout
-
jiffies
)
>
0
)
{
if
(
time_after
(
tp
->
timeout
,
jiffies
)
)
{
if
(
!
mod_timer
(
&
tp
->
retransmit_timer
,
tp
->
timeout
))
if
(
!
mod_timer
(
&
tp
->
retransmit_timer
,
tp
->
timeout
))
sock_hold
(
sk
);
sock_hold
(
sk
);
goto
out
;
goto
out
;
...
@@ -516,7 +516,7 @@ static void tcp_synack_timer(struct sock *sk)
...
@@ -516,7 +516,7 @@ static void tcp_synack_timer(struct sock *sk)
do
{
do
{
reqp
=&
lopt
->
syn_table
[
i
];
reqp
=&
lopt
->
syn_table
[
i
];
while
((
req
=
*
reqp
)
!=
NULL
)
{
while
((
req
=
*
reqp
)
!=
NULL
)
{
if
(
(
long
)(
now
-
req
->
expires
)
>=
0
)
{
if
(
time_after_eq
(
now
,
req
->
expires
)
)
{
if
((
req
->
retrans
<
thresh
||
if
((
req
->
retrans
<
thresh
||
(
req
->
acked
&&
req
->
retrans
<
max_retries
))
(
req
->
acked
&&
req
->
retrans
<
max_retries
))
&&
!
req
->
class
->
rtx_syn_ack
(
sk
,
req
,
NULL
))
{
&&
!
req
->
class
->
rtx_syn_ack
(
sk
,
req
,
NULL
))
{
...
...
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