Skip to content

Commit

Permalink
l2tp: fix l2tp_udp_recv_core()
Browse files Browse the repository at this point in the history
pskb_may_pull() can change skb->data, so we have to load ptr/optr at the
right place.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 8, 2011
1 parent ea1649d commit e50e705
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/l2tp/l2tp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,6 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb,
goto error;
}

/* Point to L2TP header */
optr = ptr = skb->data;

/* Trace packet contents, if enabled */
if (tunnel->debug & L2TP_MSG_DATA) {
length = min(32u, skb->len);
Expand All @@ -769,12 +766,15 @@ static int l2tp_udp_recv_core(struct l2tp_tunnel *tunnel, struct sk_buff *skb,

offset = 0;
do {
printk(" %02X", ptr[offset]);
printk(" %02X", skb->data[offset]);
} while (++offset < length);

printk("\n");
}

/* Point to L2TP header */
optr = ptr = skb->data;

/* Get L2TP header flags */
hdrflags = ntohs(*(__be16 *) ptr);

Expand Down

0 comments on commit e50e705

Please sign in to comment.