Переглянути джерело

[TCP]: Use TCPOLEN_TSTAMP_ALIGNED macro instead of magic number.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
YOSHIFUJI Hideaki 18 роки тому
батько
коміт
4244f8a9f8
2 змінених файлів з 2 додано та 2 видалено
  1. 1 1
      net/ipv4/tcp_ipv4.c
  2. 1 1
      net/ipv6/tcp_ipv6.c

+ 1 - 1
net/ipv4/tcp_ipv4.c

@@ -578,7 +578,7 @@ static void tcp_v4_send_ack(struct sk_buff *skb, u32 seq, u32 ack,
 	struct tcphdr *th = skb->h.th;
 	struct {
 		struct tcphdr th;
-		u32 tsopt[3];
+		u32 tsopt[TCPOLEN_TSTAMP_ALIGNED >> 2];
 	} rep;
 	struct ip_reply_arg arg;
 

+ 1 - 1
net/ipv6/tcp_ipv6.c

@@ -653,7 +653,7 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
 	int tot_len = sizeof(struct tcphdr);
 
 	if (ts)
-		tot_len += 3*4;
+		tot_len += TCPOLEN_TSTAMP_ALIGNED;
 
 	buff = alloc_skb(MAX_HEADER + sizeof(struct ipv6hdr) + tot_len,
 			 GFP_ATOMIC);