diff options
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 19 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_helper_h323.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_standalone.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_nat_snmp_basic.c | 4 | ||||
-rw-r--r-- | net/ipv4/raw.c | 1 |
6 files changed, 20 insertions, 12 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 184c78ca79e6..212734ca238f 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -429,7 +429,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | |||
429 | } | 429 | } |
430 | 430 | ||
431 | /* Remove any debris in the socket control block */ | 431 | /* Remove any debris in the socket control block */ |
432 | memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); | 432 | memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); |
433 | 433 | ||
434 | return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL, | 434 | return NF_HOOK(PF_INET, NF_IP_PRE_ROUTING, skb, dev, NULL, |
435 | ip_rcv_finish); | 435 | ip_rcv_finish); |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 9ccacf57f08b..85893eef6b16 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1578,6 +1578,7 @@ int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait) | |||
1578 | cache = ipmr_cache_find(rt->rt_src, rt->rt_dst); | 1578 | cache = ipmr_cache_find(rt->rt_src, rt->rt_dst); |
1579 | 1579 | ||
1580 | if (cache==NULL) { | 1580 | if (cache==NULL) { |
1581 | struct sk_buff *skb2; | ||
1581 | struct net_device *dev; | 1582 | struct net_device *dev; |
1582 | int vif; | 1583 | int vif; |
1583 | 1584 | ||
@@ -1591,12 +1592,18 @@ int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait) | |||
1591 | read_unlock(&mrt_lock); | 1592 | read_unlock(&mrt_lock); |
1592 | return -ENODEV; | 1593 | return -ENODEV; |
1593 | } | 1594 | } |
1594 | skb->nh.raw = skb_push(skb, sizeof(struct iphdr)); | 1595 | skb2 = skb_clone(skb, GFP_ATOMIC); |
1595 | skb->nh.iph->ihl = sizeof(struct iphdr)>>2; | 1596 | if (!skb2) { |
1596 | skb->nh.iph->saddr = rt->rt_src; | 1597 | read_unlock(&mrt_lock); |
1597 | skb->nh.iph->daddr = rt->rt_dst; | 1598 | return -ENOMEM; |
1598 | skb->nh.iph->version = 0; | 1599 | } |
1599 | err = ipmr_cache_unresolved(vif, skb); | 1600 | |
1601 | skb2->nh.raw = skb_push(skb2, sizeof(struct iphdr)); | ||
1602 | skb2->nh.iph->ihl = sizeof(struct iphdr)>>2; | ||
1603 | skb2->nh.iph->saddr = rt->rt_src; | ||
1604 | skb2->nh.iph->daddr = rt->rt_dst; | ||
1605 | skb2->nh.iph->version = 0; | ||
1606 | err = ipmr_cache_unresolved(vif, skb2); | ||
1600 | read_unlock(&mrt_lock); | 1607 | read_unlock(&mrt_lock); |
1601 | return err; | 1608 | return err; |
1602 | } | 1609 | } |
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_h323.c b/net/ipv4/netfilter/ip_conntrack_helper_h323.c index af35235672d5..9a39e2969712 100644 --- a/net/ipv4/netfilter/ip_conntrack_helper_h323.c +++ b/net/ipv4/netfilter/ip_conntrack_helper_h323.c | |||
@@ -1200,7 +1200,7 @@ static struct ip_conntrack_expect *find_expect(struct ip_conntrack *ct, | |||
1200 | tuple.dst.protonum = IPPROTO_TCP; | 1200 | tuple.dst.protonum = IPPROTO_TCP; |
1201 | 1201 | ||
1202 | exp = __ip_conntrack_expect_find(&tuple); | 1202 | exp = __ip_conntrack_expect_find(&tuple); |
1203 | if (exp->master == ct) | 1203 | if (exp && exp->master == ct) |
1204 | return exp; | 1204 | return exp; |
1205 | return NULL; | 1205 | return NULL; |
1206 | } | 1206 | } |
diff --git a/net/ipv4/netfilter/ip_conntrack_standalone.c b/net/ipv4/netfilter/ip_conntrack_standalone.c index 7bd3c22003a2..7a9fa04a467a 100644 --- a/net/ipv4/netfilter/ip_conntrack_standalone.c +++ b/net/ipv4/netfilter/ip_conntrack_standalone.c | |||
@@ -534,6 +534,8 @@ static struct nf_hook_ops ip_conntrack_ops[] = { | |||
534 | 534 | ||
535 | /* Sysctl support */ | 535 | /* Sysctl support */ |
536 | 536 | ||
537 | int ip_conntrack_checksum = 1; | ||
538 | |||
537 | #ifdef CONFIG_SYSCTL | 539 | #ifdef CONFIG_SYSCTL |
538 | 540 | ||
539 | /* From ip_conntrack_core.c */ | 541 | /* From ip_conntrack_core.c */ |
@@ -568,8 +570,6 @@ extern unsigned int ip_ct_generic_timeout; | |||
568 | static int log_invalid_proto_min = 0; | 570 | static int log_invalid_proto_min = 0; |
569 | static int log_invalid_proto_max = 255; | 571 | static int log_invalid_proto_max = 255; |
570 | 572 | ||
571 | int ip_conntrack_checksum = 1; | ||
572 | |||
573 | static struct ctl_table_header *ip_ct_sysctl_header; | 573 | static struct ctl_table_header *ip_ct_sysctl_header; |
574 | 574 | ||
575 | static ctl_table ip_ct_sysctl_table[] = { | 575 | static ctl_table ip_ct_sysctl_table[] = { |
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c index 0b1b416759cc..18b7fbdccb61 100644 --- a/net/ipv4/netfilter/ip_nat_snmp_basic.c +++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c | |||
@@ -1255,9 +1255,9 @@ static int help(struct sk_buff **pskb, | |||
1255 | struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl); | 1255 | struct udphdr *udph = (struct udphdr *)((u_int32_t *)iph + iph->ihl); |
1256 | 1256 | ||
1257 | /* SNMP replies and originating SNMP traps get mangled */ | 1257 | /* SNMP replies and originating SNMP traps get mangled */ |
1258 | if (udph->source == ntohs(SNMP_PORT) && dir != IP_CT_DIR_REPLY) | 1258 | if (udph->source == htons(SNMP_PORT) && dir != IP_CT_DIR_REPLY) |
1259 | return NF_ACCEPT; | 1259 | return NF_ACCEPT; |
1260 | if (udph->dest == ntohs(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL) | 1260 | if (udph->dest == htons(SNMP_TRAP_PORT) && dir != IP_CT_DIR_ORIGINAL) |
1261 | return NF_ACCEPT; | 1261 | return NF_ACCEPT; |
1262 | 1262 | ||
1263 | /* No NAT? */ | 1263 | /* No NAT? */ |
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index bd221ec3f81e..62b2762a2420 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -609,6 +609,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
609 | if (sin) { | 609 | if (sin) { |
610 | sin->sin_family = AF_INET; | 610 | sin->sin_family = AF_INET; |
611 | sin->sin_addr.s_addr = skb->nh.iph->saddr; | 611 | sin->sin_addr.s_addr = skb->nh.iph->saddr; |
612 | sin->sin_port = 0; | ||
612 | memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); | 613 | memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); |
613 | } | 614 | } |
614 | if (inet->cmsg_flags) | 615 | if (inet->cmsg_flags) |