Преглед изворни кода

net/x25: fix called/calling length calculation in x25_parse_address_block

The length of the called and calling address was not calculated
correctly (BCD encoding).

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Martin Schiller пре 6 година
родитељ
комит
d449ba3d58
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      net/x25/af_x25.c

+ 1 - 1
net/x25/af_x25.c

@@ -100,7 +100,7 @@ int x25_parse_address_block(struct sk_buff *skb,
 	}
 
 	len = *skb->data;
-	needed = 1 + (len >> 4) + (len & 0x0f);
+	needed = 1 + ((len >> 4) + (len & 0x0f) + 1) / 2;
 
 	if (!pskb_may_pull(skb, needed)) {
 		/* packet is too short to hold the addresses it claims