diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-06-25 12:17:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-25 19:33:04 -0400 |
commit | 52db882f3fc2903014e638ee91e690085fe37fdb (patch) | |
tree | da6cd52645dca68bf16d40387421cc93fd094ea4 /net/sctp/associola.c | |
parent | d36f82b2435690d8742235d7bdc5bb5e878077e3 (diff) |
net: sctp: migrate cookie life from timeval to ktime
Currently, SCTP code defines its own timeval functions (since timeval
is rarely used inside the kernel by others), namely tv_lt() and
TIMEVAL_ADD() macros, that operate on SCTP cookie expiration.
We might as well remove all those, and operate directly on ktime
structures for a couple of reasons: ktime is available on all archs;
complexity of ktime calculations depending on the arch is less than
(reduces to a simple arithmetic operations on archs with
BITS_PER_LONG == 64 or CONFIG_KTIME_SCALAR) or equal to timeval
functions (other archs); code becomes more readable; macros can be
thrown out.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/associola.c')
-rw-r--r-- | net/sctp/associola.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c index bf6e6bd553c0..9a383a8774e8 100644 --- a/net/sctp/associola.c +++ b/net/sctp/associola.c | |||
@@ -102,13 +102,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a | |||
102 | sctp_bind_addr_init(&asoc->base.bind_addr, ep->base.bind_addr.port); | 102 | sctp_bind_addr_init(&asoc->base.bind_addr, ep->base.bind_addr.port); |
103 | 103 | ||
104 | asoc->state = SCTP_STATE_CLOSED; | 104 | asoc->state = SCTP_STATE_CLOSED; |
105 | 105 | asoc->cookie_life = ms_to_ktime(sp->assocparams.sasoc_cookie_life); | |
106 | /* Set these values from the socket values, a conversion between | ||
107 | * millsecons to seconds/microseconds must also be done. | ||
108 | */ | ||
109 | asoc->cookie_life.tv_sec = sp->assocparams.sasoc_cookie_life / 1000; | ||
110 | asoc->cookie_life.tv_usec = (sp->assocparams.sasoc_cookie_life % 1000) | ||
111 | * 1000; | ||
112 | asoc->frag_point = 0; | 106 | asoc->frag_point = 0; |
113 | asoc->user_frag = sp->user_frag; | 107 | asoc->user_frag = sp->user_frag; |
114 | 108 | ||