Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1c9fe7b authored by Ian McDonald's avatar Ian McDonald Committed by David S. Miller
Browse files

[DCCP]: Fix elapsed time option as per section 13.2 of spec v11



The elapsed time can be two bytes or four bytes only.

Signed-off-by: default avatarIan McDonald <iam4@cs.waikato.ac.nz>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d179cd12
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -293,10 +293,7 @@ static void dccp_insert_option_ndp(struct sock *sk, struct sk_buff *skb)

static inline int dccp_elapsed_time_len(const u32 elapsed_time)
{
	return elapsed_time == 0 ? 0 :
	       elapsed_time <= 0xFF ? 1 :
	       elapsed_time <= 0xFFFF ? 2 :
	       elapsed_time <= 0xFFFFFF ? 3 : 4;
	return elapsed_time == 0 ? 0 : elapsed_time <= 0xFFFF ? 2 : 4;
}

void dccp_insert_option_elapsed_time(struct sock *sk,