diff options
author | James Morris <jmorris@namei.org> | 2007-03-04 19:12:44 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:23:32 -0400 |
commit | 9d729f72dca9406025bcfa9c1f660d71d9ef0ff5 (patch) | |
tree | 69a3ca50c6e266853676a545a113f13f254ae535 /net/ipv4 | |
parent | 39df232f1a9ba48d41c68ee7d4046756e709cf91 (diff) |
[NET]: Convert xtime.tv_sec to get_seconds()
Where appropriate, convert references to xtime.tv_sec to the
get_seconds() helper function.
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/route.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 6 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 10 | ||||
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 8 |
4 files changed, 13 insertions, 13 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 37e0d4d5cf94..0b3d7bf40f4e 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2683,7 +2683,7 @@ static int rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | |||
2683 | id = rt->peer->ip_id_count; | 2683 | id = rt->peer->ip_id_count; |
2684 | if (rt->peer->tcp_ts_stamp) { | 2684 | if (rt->peer->tcp_ts_stamp) { |
2685 | ts = rt->peer->tcp_ts; | 2685 | ts = rt->peer->tcp_ts; |
2686 | tsage = xtime.tv_sec - rt->peer->tcp_ts_stamp; | 2686 | tsage = get_seconds() - rt->peer->tcp_ts_stamp; |
2687 | } | 2687 | } |
2688 | } | 2688 | } |
2689 | 2689 | ||
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d894bbcc1d24..d0a3630f41a7 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2933,7 +2933,7 @@ static int tcp_fast_parse_options(struct sk_buff *skb, struct tcphdr *th, | |||
2933 | static inline void tcp_store_ts_recent(struct tcp_sock *tp) | 2933 | static inline void tcp_store_ts_recent(struct tcp_sock *tp) |
2934 | { | 2934 | { |
2935 | tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval; | 2935 | tp->rx_opt.ts_recent = tp->rx_opt.rcv_tsval; |
2936 | tp->rx_opt.ts_recent_stamp = xtime.tv_sec; | 2936 | tp->rx_opt.ts_recent_stamp = get_seconds(); |
2937 | } | 2937 | } |
2938 | 2938 | ||
2939 | static inline void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) | 2939 | static inline void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) |
@@ -2947,7 +2947,7 @@ static inline void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) | |||
2947 | */ | 2947 | */ |
2948 | 2948 | ||
2949 | if((s32)(tp->rx_opt.rcv_tsval - tp->rx_opt.ts_recent) >= 0 || | 2949 | if((s32)(tp->rx_opt.rcv_tsval - tp->rx_opt.ts_recent) >= 0 || |
2950 | xtime.tv_sec >= tp->rx_opt.ts_recent_stamp + TCP_PAWS_24DAYS) | 2950 | get_seconds() >= tp->rx_opt.ts_recent_stamp + TCP_PAWS_24DAYS) |
2951 | tcp_store_ts_recent(tp); | 2951 | tcp_store_ts_recent(tp); |
2952 | } | 2952 | } |
2953 | } | 2953 | } |
@@ -2999,7 +2999,7 @@ static inline int tcp_paws_discard(const struct sock *sk, const struct sk_buff * | |||
2999 | { | 2999 | { |
3000 | const struct tcp_sock *tp = tcp_sk(sk); | 3000 | const struct tcp_sock *tp = tcp_sk(sk); |
3001 | return ((s32)(tp->rx_opt.ts_recent - tp->rx_opt.rcv_tsval) > TCP_PAWS_WINDOW && | 3001 | return ((s32)(tp->rx_opt.ts_recent - tp->rx_opt.rcv_tsval) > TCP_PAWS_WINDOW && |
3002 | xtime.tv_sec < tp->rx_opt.ts_recent_stamp + TCP_PAWS_24DAYS && | 3002 | get_seconds() < tp->rx_opt.ts_recent_stamp + TCP_PAWS_24DAYS && |
3003 | !tcp_disordered_ack(sk, skb)); | 3003 | !tcp_disordered_ack(sk, skb)); |
3004 | } | 3004 | } |
3005 | 3005 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index f6793b4cc669..addac1110f94 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -149,7 +149,7 @@ int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp) | |||
149 | */ | 149 | */ |
150 | if (tcptw->tw_ts_recent_stamp && | 150 | if (tcptw->tw_ts_recent_stamp && |
151 | (twp == NULL || (sysctl_tcp_tw_reuse && | 151 | (twp == NULL || (sysctl_tcp_tw_reuse && |
152 | xtime.tv_sec - tcptw->tw_ts_recent_stamp > 1))) { | 152 | get_seconds() - tcptw->tw_ts_recent_stamp > 1))) { |
153 | tp->write_seq = tcptw->tw_snd_nxt + 65535 + 2; | 153 | tp->write_seq = tcptw->tw_snd_nxt + 65535 + 2; |
154 | if (tp->write_seq == 0) | 154 | if (tp->write_seq == 0) |
155 | tp->write_seq = 1; | 155 | tp->write_seq = 1; |
@@ -224,7 +224,7 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | |||
224 | * when trying new connection. | 224 | * when trying new connection. |
225 | */ | 225 | */ |
226 | if (peer != NULL && | 226 | if (peer != NULL && |
227 | peer->tcp_ts_stamp + TCP_PAWS_MSL >= xtime.tv_sec) { | 227 | peer->tcp_ts_stamp + TCP_PAWS_MSL >= get_seconds()) { |
228 | tp->rx_opt.ts_recent_stamp = peer->tcp_ts_stamp; | 228 | tp->rx_opt.ts_recent_stamp = peer->tcp_ts_stamp; |
229 | tp->rx_opt.ts_recent = peer->tcp_ts; | 229 | tp->rx_opt.ts_recent = peer->tcp_ts; |
230 | } | 230 | } |
@@ -1351,7 +1351,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb) | |||
1351 | (dst = inet_csk_route_req(sk, req)) != NULL && | 1351 | (dst = inet_csk_route_req(sk, req)) != NULL && |
1352 | (peer = rt_get_peer((struct rtable *)dst)) != NULL && | 1352 | (peer = rt_get_peer((struct rtable *)dst)) != NULL && |
1353 | peer->v4daddr == saddr) { | 1353 | peer->v4daddr == saddr) { |
1354 | if (xtime.tv_sec < peer->tcp_ts_stamp + TCP_PAWS_MSL && | 1354 | if (get_seconds() < peer->tcp_ts_stamp + TCP_PAWS_MSL && |
1355 | (s32)(peer->tcp_ts - req->ts_recent) > | 1355 | (s32)(peer->tcp_ts - req->ts_recent) > |
1356 | TCP_PAWS_WINDOW) { | 1356 | TCP_PAWS_WINDOW) { |
1357 | NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED); | 1357 | NET_INC_STATS_BH(LINUX_MIB_PAWSPASSIVEREJECTED); |
@@ -1770,7 +1770,7 @@ int tcp_v4_remember_stamp(struct sock *sk) | |||
1770 | 1770 | ||
1771 | if (peer) { | 1771 | if (peer) { |
1772 | if ((s32)(peer->tcp_ts - tp->rx_opt.ts_recent) <= 0 || | 1772 | if ((s32)(peer->tcp_ts - tp->rx_opt.ts_recent) <= 0 || |
1773 | (peer->tcp_ts_stamp + TCP_PAWS_MSL < xtime.tv_sec && | 1773 | (peer->tcp_ts_stamp + TCP_PAWS_MSL < get_seconds() && |
1774 | peer->tcp_ts_stamp <= tp->rx_opt.ts_recent_stamp)) { | 1774 | peer->tcp_ts_stamp <= tp->rx_opt.ts_recent_stamp)) { |
1775 | peer->tcp_ts_stamp = tp->rx_opt.ts_recent_stamp; | 1775 | peer->tcp_ts_stamp = tp->rx_opt.ts_recent_stamp; |
1776 | peer->tcp_ts = tp->rx_opt.ts_recent; | 1776 | peer->tcp_ts = tp->rx_opt.ts_recent; |
@@ -1791,7 +1791,7 @@ int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw) | |||
1791 | const struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); | 1791 | const struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); |
1792 | 1792 | ||
1793 | if ((s32)(peer->tcp_ts - tcptw->tw_ts_recent) <= 0 || | 1793 | if ((s32)(peer->tcp_ts - tcptw->tw_ts_recent) <= 0 || |
1794 | (peer->tcp_ts_stamp + TCP_PAWS_MSL < xtime.tv_sec && | 1794 | (peer->tcp_ts_stamp + TCP_PAWS_MSL < get_seconds() && |
1795 | peer->tcp_ts_stamp <= tcptw->tw_ts_recent_stamp)) { | 1795 | peer->tcp_ts_stamp <= tcptw->tw_ts_recent_stamp)) { |
1796 | peer->tcp_ts_stamp = tcptw->tw_ts_recent_stamp; | 1796 | peer->tcp_ts_stamp = tcptw->tw_ts_recent_stamp; |
1797 | peer->tcp_ts = tcptw->tw_ts_recent; | 1797 | peer->tcp_ts = tcptw->tw_ts_recent; |
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 706932726a11..ac4ce48a6599 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -149,7 +149,7 @@ kill_with_rst: | |||
149 | tw->tw_substate = TCP_TIME_WAIT; | 149 | tw->tw_substate = TCP_TIME_WAIT; |
150 | tcptw->tw_rcv_nxt = TCP_SKB_CB(skb)->end_seq; | 150 | tcptw->tw_rcv_nxt = TCP_SKB_CB(skb)->end_seq; |
151 | if (tmp_opt.saw_tstamp) { | 151 | if (tmp_opt.saw_tstamp) { |
152 | tcptw->tw_ts_recent_stamp = xtime.tv_sec; | 152 | tcptw->tw_ts_recent_stamp = get_seconds(); |
153 | tcptw->tw_ts_recent = tmp_opt.rcv_tsval; | 153 | tcptw->tw_ts_recent = tmp_opt.rcv_tsval; |
154 | } | 154 | } |
155 | 155 | ||
@@ -208,7 +208,7 @@ kill: | |||
208 | 208 | ||
209 | if (tmp_opt.saw_tstamp) { | 209 | if (tmp_opt.saw_tstamp) { |
210 | tcptw->tw_ts_recent = tmp_opt.rcv_tsval; | 210 | tcptw->tw_ts_recent = tmp_opt.rcv_tsval; |
211 | tcptw->tw_ts_recent_stamp = xtime.tv_sec; | 211 | tcptw->tw_ts_recent_stamp = get_seconds(); |
212 | } | 212 | } |
213 | 213 | ||
214 | inet_twsk_put(tw); | 214 | inet_twsk_put(tw); |
@@ -458,7 +458,7 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, | |||
458 | 458 | ||
459 | if (newtp->rx_opt.tstamp_ok) { | 459 | if (newtp->rx_opt.tstamp_ok) { |
460 | newtp->rx_opt.ts_recent = req->ts_recent; | 460 | newtp->rx_opt.ts_recent = req->ts_recent; |
461 | newtp->rx_opt.ts_recent_stamp = xtime.tv_sec; | 461 | newtp->rx_opt.ts_recent_stamp = get_seconds(); |
462 | newtp->tcp_header_len = sizeof(struct tcphdr) + TCPOLEN_TSTAMP_ALIGNED; | 462 | newtp->tcp_header_len = sizeof(struct tcphdr) + TCPOLEN_TSTAMP_ALIGNED; |
463 | } else { | 463 | } else { |
464 | newtp->rx_opt.ts_recent_stamp = 0; | 464 | newtp->rx_opt.ts_recent_stamp = 0; |
@@ -504,7 +504,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb, | |||
504 | * it can be estimated (approximately) | 504 | * it can be estimated (approximately) |
505 | * from another data. | 505 | * from another data. |
506 | */ | 506 | */ |
507 | tmp_opt.ts_recent_stamp = xtime.tv_sec - ((TCP_TIMEOUT_INIT/HZ)<<req->retrans); | 507 | tmp_opt.ts_recent_stamp = get_seconds() - ((TCP_TIMEOUT_INIT/HZ)<<req->retrans); |
508 | paws_reject = tcp_paws_check(&tmp_opt, th->rst); | 508 | paws_reject = tcp_paws_check(&tmp_opt, th->rst); |
509 | } | 509 | } |
510 | } | 510 | } |