aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/dccp/probe.c2
-rw-r--r--net/ipv4/netfilter/ip_conntrack_helper_h323.c4
-rw-r--r--net/ipv4/tcp_probe.c2
-rw-r--r--net/ipv4/udp.c19
-rw-r--r--net/xfrm/xfrm_user.c1
5 files changed, 21 insertions, 7 deletions
diff --git a/net/dccp/probe.c b/net/dccp/probe.c
index 146496fce2e2..fded1493c1dc 100644
--- a/net/dccp/probe.c
+++ b/net/dccp/probe.c
@@ -160,6 +160,8 @@ static __init int dccpprobe_init(void)
160 init_waitqueue_head(&dccpw.wait); 160 init_waitqueue_head(&dccpw.wait);
161 spin_lock_init(&dccpw.lock); 161 spin_lock_init(&dccpw.lock);
162 dccpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &dccpw.lock); 162 dccpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &dccpw.lock);
163 if (IS_ERR(dccpw.fifo))
164 return PTR_ERR(dccpw.fifo);
163 165
164 if (!proc_net_fops_create(procname, S_IRUSR, &dccpprobe_fops)) 166 if (!proc_net_fops_create(procname, S_IRUSR, &dccpprobe_fops))
165 goto err0; 167 goto err0;
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_h323.c b/net/ipv4/netfilter/ip_conntrack_helper_h323.c
index 7b7441202bfd..6cb9070cd0bc 100644
--- a/net/ipv4/netfilter/ip_conntrack_helper_h323.c
+++ b/net/ipv4/netfilter/ip_conntrack_helper_h323.c
@@ -1417,7 +1417,7 @@ static int process_rcf(struct sk_buff **pskb, struct ip_conntrack *ct,
1417 DEBUGP 1417 DEBUGP
1418 ("ip_ct_ras: set RAS connection timeout to %u seconds\n", 1418 ("ip_ct_ras: set RAS connection timeout to %u seconds\n",
1419 info->timeout); 1419 info->timeout);
1420 ip_ct_refresh_acct(ct, ctinfo, NULL, info->timeout * HZ); 1420 ip_ct_refresh(ct, *pskb, info->timeout * HZ);
1421 1421
1422 /* Set expect timeout */ 1422 /* Set expect timeout */
1423 read_lock_bh(&ip_conntrack_lock); 1423 read_lock_bh(&ip_conntrack_lock);
@@ -1465,7 +1465,7 @@ static int process_urq(struct sk_buff **pskb, struct ip_conntrack *ct,
1465 info->sig_port[!dir] = 0; 1465 info->sig_port[!dir] = 0;
1466 1466
1467 /* Give it 30 seconds for UCF or URJ */ 1467 /* Give it 30 seconds for UCF or URJ */
1468 ip_ct_refresh_acct(ct, ctinfo, NULL, 30 * HZ); 1468 ip_ct_refresh(ct, *pskb, 30 * HZ);
1469 1469
1470 return 0; 1470 return 0;
1471} 1471}
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 4be336f17883..f230eeecf092 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -156,6 +156,8 @@ static __init int tcpprobe_init(void)
156 init_waitqueue_head(&tcpw.wait); 156 init_waitqueue_head(&tcpw.wait);
157 spin_lock_init(&tcpw.lock); 157 spin_lock_init(&tcpw.lock);
158 tcpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &tcpw.lock); 158 tcpw.fifo = kfifo_alloc(bufsize, GFP_KERNEL, &tcpw.lock);
159 if (IS_ERR(tcpw.fifo))
160 return PTR_ERR(tcpw.fifo);
159 161
160 if (!proc_net_fops_create(procname, S_IRUSR, &tcpprobe_fops)) 162 if (!proc_net_fops_create(procname, S_IRUSR, &tcpprobe_fops))
161 goto err0; 163 goto err0;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 865d75214a9a..9e1bd374875e 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -928,23 +928,32 @@ static int udp_encap_rcv(struct sock * sk, struct sk_buff *skb)
928 return 1; 928 return 1;
929#else 929#else
930 struct udp_sock *up = udp_sk(sk); 930 struct udp_sock *up = udp_sk(sk);
931 struct udphdr *uh = skb->h.uh; 931 struct udphdr *uh;
932 struct iphdr *iph; 932 struct iphdr *iph;
933 int iphlen, len; 933 int iphlen, len;
934 934
935 __u8 *udpdata = (__u8 *)uh + sizeof(struct udphdr); 935 __u8 *udpdata;
936 __be32 *udpdata32 = (__be32 *)udpdata; 936 __be32 *udpdata32;
937 __u16 encap_type = up->encap_type; 937 __u16 encap_type = up->encap_type;
938 938
939 /* if we're overly short, let UDP handle it */ 939 /* if we're overly short, let UDP handle it */
940 if (udpdata > skb->tail) 940 len = skb->len - sizeof(struct udphdr);
941 if (len <= 0)
941 return 1; 942 return 1;
942 943
943 /* if this is not encapsulated socket, then just return now */ 944 /* if this is not encapsulated socket, then just return now */
944 if (!encap_type) 945 if (!encap_type)
945 return 1; 946 return 1;
946 947
947 len = skb->tail - udpdata; 948 /* If this is a paged skb, make sure we pull up
949 * whatever data we need to look at. */
950 if (!pskb_may_pull(skb, sizeof(struct udphdr) + min(len, 8)))
951 return 1;
952
953 /* Now we can get the pointers */
954 uh = skb->h.uh;
955 udpdata = (__u8 *)uh + sizeof(struct udphdr);
956 udpdata32 = (__be32 *)udpdata;
948 957
949 switch (encap_type) { 958 switch (encap_type) {
950 default: 959 default:
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index c4cde57d9216..2ee14f8a1908 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -495,6 +495,7 @@ static struct xfrm_state *xfrm_user_state_lookup(struct xfrm_usersa_id *p,
495 goto out; 495 goto out;
496 } 496 }
497 497
498 err = -ESRCH;
498 x = xfrm_state_lookup_byaddr(&p->daddr, saddr, p->proto, 499 x = xfrm_state_lookup_byaddr(&p->daddr, saddr, p->proto,
499 p->family); 500 p->family);
500 } 501 }