Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41095
b: refs/heads/master
c: 753eab7
h: refs/heads/master
i:
  41093: be33072
  41091: 717ba48
  41087: a3d2033
v: v3
  • Loading branch information
Olaf Kirch authored and David S. Miller committed Nov 25, 2006
1 parent 65e0ec7 commit 79b58bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38f7efd52c4f3f0b22c460eadbfe7c42f9ebff82
refs/heads/master: 753eab76a3337863a0d86ce045fa4eb6c3cbeef9
19 changes: 14 additions & 5 deletions trunk/net/ipv4/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,23 +928,32 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
return 1;
#else
struct udp_sock *up = udp_sk(sk);
struct udphdr *uh = skb->h.uh;
struct udphdr *uh;
struct iphdr *iph;
int iphlen, len;

__u8 *udpdata = (__u8 *)uh + sizeof(struct udphdr);
__be32 *udpdata32 = (__be32 *)udpdata;
__u8 *udpdata;
__be32 *udpdata32;
__u16 encap_type = up->encap_type;

/* if we're overly short, let UDP handle it */
if (udpdata > skb->tail)
len = skb->len - sizeof(struct udphdr);
if (len <= 0)
return 1;

/* if this is not encapsulated socket, then just return now */
if (!encap_type)
return 1;

len = skb->tail - udpdata;
/* If this is a paged skb, make sure we pull up
* whatever data we need to look at. */
if (!pskb_may_pull(skb, sizeof(struct udphdr) + min(len, 8)))
return 1;

/* Now we can get the pointers */
uh = skb->h.uh;
udpdata = (__u8 *)uh + sizeof(struct udphdr);
udpdata32 = (__be32 *)udpdata;

switch (encap_type) {
default:
Expand Down

0 comments on commit 79b58bf

Please sign in to comment.