netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] X.25: Fix address field length calculation
@ 2013-10-15 14:29 Kelleter, Günther
  2013-10-15 17:29 ` Joe Perches
  2013-10-17 20:04 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Kelleter, Günther @ 2013-10-15 14:29 UTC (permalink / raw)
  To: andrew.hendry@gmail.com
  Cc: davem@davemloft.net, linux-x25@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org

Addresses are BCD encoded, not ASCII. x25_addr_ntoa got it right.

Signed-off-by: Guenther Kelleter <gkelleter@datus.com>
---
Wrong length calculation leads to rejection of CALL ACCEPT packets.

 net/x25/af_x25.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 45a3ab5..2daf224 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -98,7 +98,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
-- 
1.8.3.4.71.g0878476

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-17 20:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-15 14:29 [PATCH] X.25: Fix address field length calculation Kelleter, Günther
2013-10-15 17:29 ` Joe Perches
2013-10-16  6:58   ` Kelleter, Günther
2013-10-16  8:56   ` David Laight
2013-10-17 11:02     ` Andrew Hendry
2013-10-17 12:09       ` Kelleter, Günther
2013-10-17 20:04 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).