Skip to content

Commit

Permalink
net/x25: fix called/calling length calculation in x25_parse_address_b…
Browse files Browse the repository at this point in the history
…lock

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

Signed-off-by: Martin Schiller <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
sch-m authored and davem330 committed Nov 29, 2018
1 parent 9023096 commit d449ba3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/x25/af_x25.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d449ba3

Please sign in to comment.