DCCP: Fix to check missing sequence number for ICMP
PATCH v2 3/4 DCCP: Fix to check missing sequence number for ICMP
If we want check the sequence number, the length of dccp packet must not less than __dccp_basic_hdr_len(dh). If the length of dccp packet is less than this value, check for sequence number will get unpredictable result.
This patch fix the problem.
Signed-off-by Wei Yongjun <[email protected]>
--- net/dccp/ipv4.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/dccp/ipv4.c +1 -1
@@ -207,7 +207,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)int err;struct net *net =dev_net (skb->dev); -if (skb->len < (iph->ihl <<2 ) +8 ) { +if (skb->len < (iph->ihl <<2 ) +__dccp_basic_hdr_len (dh)) {ICMP_INC_STATS_BH (net,ICMP_MIB_INERRORS );return ; }