mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[NET]: Store skb->timestamp as offset to a base timestamp
Reduces skb size by 8 bytes on 64-bit. Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
25ed891019
commit
a61bbcf28a
39 changed files with 172 additions and 88 deletions
|
|
@ -236,8 +236,8 @@ int sctp_rcv(struct sk_buff *skb)
|
|||
}
|
||||
|
||||
/* SCTP seems to always need a timestamp right now (FIXME) */
|
||||
if (skb->stamp.tv_sec == 0) {
|
||||
do_gettimeofday(&skb->stamp);
|
||||
if (skb->tstamp.off_sec == 0) {
|
||||
__net_timestamp(skb);
|
||||
sock_enable_timestamp(sk);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1362,6 +1362,7 @@ struct sctp_association *sctp_unpack_cookie(
|
|||
char *key;
|
||||
sctp_scope_t scope;
|
||||
struct sk_buff *skb = chunk->skb;
|
||||
struct timeval tv;
|
||||
|
||||
headersize = sizeof(sctp_chunkhdr_t) + SCTP_SECRET_SIZE;
|
||||
bodysize = ntohs(chunk->chunk_hdr->length) - headersize;
|
||||
|
|
@ -1434,7 +1435,8 @@ no_hmac:
|
|||
* an association, there is no need to check cookie's expiration
|
||||
* for init collision case of lost COOKIE ACK.
|
||||
*/
|
||||
if (!asoc && tv_lt(bear_cookie->expiration, skb->stamp)) {
|
||||
skb_get_timestamp(skb, &tv);
|
||||
if (!asoc && tv_lt(bear_cookie->expiration, tv)) {
|
||||
__u16 len;
|
||||
/*
|
||||
* Section 3.3.10.3 Stale Cookie Error (3)
|
||||
|
|
@ -1447,10 +1449,9 @@ no_hmac:
|
|||
len = ntohs(chunk->chunk_hdr->length);
|
||||
*errp = sctp_make_op_error_space(asoc, chunk, len);
|
||||
if (*errp) {
|
||||
suseconds_t usecs = (skb->stamp.tv_sec -
|
||||
suseconds_t usecs = (tv.tv_sec -
|
||||
bear_cookie->expiration.tv_sec) * 1000000L +
|
||||
skb->stamp.tv_usec -
|
||||
bear_cookie->expiration.tv_usec;
|
||||
tv.tv_usec - bear_cookie->expiration.tv_usec;
|
||||
|
||||
usecs = htonl(usecs);
|
||||
sctp_init_cause(*errp, SCTP_ERROR_STALE_COOKIE,
|
||||
|
|
|
|||
Loading…
Reference in a new issue