diff options
author | David S. Miller <davem@davemloft.net> | 2013-06-05 18:56:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-05 19:37:30 -0400 |
commit | 6bc19fb82d4c05a9eee19d6d2aab2ce26e499ec2 (patch) | |
tree | 8b049ef383307f5dae91b5c9cf78dbfb9b74a4d1 /net/ipv6 | |
parent | 11a164a04382d735230b01f4cc46ad78a7c4abf6 (diff) | |
parent | 4d3797d7e1861ac1af150a6189315786c5e1c820 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Merge 'net' bug fixes into 'net-next' as we have patches
that will build on top of them.
This merge commit includes a change from Emil Goode
(emilgoode@gmail.com) that fixes a warning that would
have been introduced by this merge. Specifically it
fixes the pingv6_ops method ipv6_chk_addr() to add a
"const" to the "struct net_device *dev" argument and
likewise update the dummy_ipv6_chk_addr() declaration.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/addrconf.c | 6 | ||||
-rw-r--r-- | net/ipv6/netfilter.c | 7 | ||||
-rw-r--r-- | net/ipv6/ping.c | 2 | ||||
-rw-r--r-- | net/ipv6/proc.c | 2 | ||||
-rw-r--r-- | net/ipv6/udp_offload.c | 20 |
5 files changed, 25 insertions, 12 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 7b34f06af344..21010fddb203 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -1486,7 +1486,7 @@ static int ipv6_count_addresses(struct inet6_dev *idev) | |||
1486 | } | 1486 | } |
1487 | 1487 | ||
1488 | int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, | 1488 | int ipv6_chk_addr(struct net *net, const struct in6_addr *addr, |
1489 | struct net_device *dev, int strict) | 1489 | const struct net_device *dev, int strict) |
1490 | { | 1490 | { |
1491 | struct inet6_ifaddr *ifp; | 1491 | struct inet6_ifaddr *ifp; |
1492 | unsigned int hash = inet6_addr_hash(addr); | 1492 | unsigned int hash = inet6_addr_hash(addr); |
@@ -2660,8 +2660,10 @@ static void init_loopback(struct net_device *dev) | |||
2660 | sp_rt = addrconf_dst_alloc(idev, &sp_ifa->addr, 0); | 2660 | sp_rt = addrconf_dst_alloc(idev, &sp_ifa->addr, 0); |
2661 | 2661 | ||
2662 | /* Failure cases are ignored */ | 2662 | /* Failure cases are ignored */ |
2663 | if (!IS_ERR(sp_rt)) | 2663 | if (!IS_ERR(sp_rt)) { |
2664 | sp_ifa->rt = sp_rt; | ||
2664 | ip6_ins_rt(sp_rt); | 2665 | ip6_ins_rt(sp_rt); |
2666 | } | ||
2665 | } | 2667 | } |
2666 | read_unlock_bh(&idev->lock); | 2668 | read_unlock_bh(&idev->lock); |
2667 | } | 2669 | } |
diff --git a/net/ipv6/netfilter.c b/net/ipv6/netfilter.c index 72836f40b730..95f3f1da0d7f 100644 --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/netfilter.h> | 10 | #include <linux/netfilter.h> |
11 | #include <linux/netfilter_ipv6.h> | 11 | #include <linux/netfilter_ipv6.h> |
12 | #include <linux/export.h> | 12 | #include <linux/export.h> |
13 | #include <net/addrconf.h> | ||
13 | #include <net/dst.h> | 14 | #include <net/dst.h> |
14 | #include <net/ipv6.h> | 15 | #include <net/ipv6.h> |
15 | #include <net/ip6_route.h> | 16 | #include <net/ip6_route.h> |
@@ -186,6 +187,10 @@ static __sum16 nf_ip6_checksum_partial(struct sk_buff *skb, unsigned int hook, | |||
186 | return csum; | 187 | return csum; |
187 | }; | 188 | }; |
188 | 189 | ||
190 | static const struct nf_ipv6_ops ipv6ops = { | ||
191 | .chk_addr = ipv6_chk_addr, | ||
192 | }; | ||
193 | |||
189 | static const struct nf_afinfo nf_ip6_afinfo = { | 194 | static const struct nf_afinfo nf_ip6_afinfo = { |
190 | .family = AF_INET6, | 195 | .family = AF_INET6, |
191 | .checksum = nf_ip6_checksum, | 196 | .checksum = nf_ip6_checksum, |
@@ -198,6 +203,7 @@ static const struct nf_afinfo nf_ip6_afinfo = { | |||
198 | 203 | ||
199 | int __init ipv6_netfilter_init(void) | 204 | int __init ipv6_netfilter_init(void) |
200 | { | 205 | { |
206 | RCU_INIT_POINTER(nf_ipv6_ops, &ipv6ops); | ||
201 | return nf_register_afinfo(&nf_ip6_afinfo); | 207 | return nf_register_afinfo(&nf_ip6_afinfo); |
202 | } | 208 | } |
203 | 209 | ||
@@ -206,5 +212,6 @@ int __init ipv6_netfilter_init(void) | |||
206 | */ | 212 | */ |
207 | void ipv6_netfilter_fini(void) | 213 | void ipv6_netfilter_fini(void) |
208 | { | 214 | { |
215 | RCU_INIT_POINTER(nf_ipv6_ops, NULL); | ||
209 | nf_unregister_afinfo(&nf_ip6_afinfo); | 216 | nf_unregister_afinfo(&nf_ip6_afinfo); |
210 | } | 217 | } |
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c index 62ac5f2e0aaf..a43110385918 100644 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c | |||
@@ -73,7 +73,7 @@ int dummy_icmpv6_err_convert(u8 type, u8 code, int *err) | |||
73 | void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, | 73 | void dummy_ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, |
74 | __be16 port, u32 info, u8 *payload) {} | 74 | __be16 port, u32 info, u8 *payload) {} |
75 | int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr, | 75 | int dummy_ipv6_chk_addr(struct net *net, const struct in6_addr *addr, |
76 | struct net_device *dev, int strict) | 76 | const struct net_device *dev, int strict) |
77 | { | 77 | { |
78 | return 0; | 78 | return 0; |
79 | } | 79 | } |
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c index f3c1ff4357ff..51c3285b5d9b 100644 --- a/net/ipv6/proc.c +++ b/net/ipv6/proc.c | |||
@@ -90,7 +90,7 @@ static const struct snmp_mib snmp6_ipstats_list[] = { | |||
90 | SNMP_MIB_ITEM("Ip6OutMcastOctets", IPSTATS_MIB_OUTMCASTOCTETS), | 90 | SNMP_MIB_ITEM("Ip6OutMcastOctets", IPSTATS_MIB_OUTMCASTOCTETS), |
91 | SNMP_MIB_ITEM("Ip6InBcastOctets", IPSTATS_MIB_INBCASTOCTETS), | 91 | SNMP_MIB_ITEM("Ip6InBcastOctets", IPSTATS_MIB_INBCASTOCTETS), |
92 | SNMP_MIB_ITEM("Ip6OutBcastOctets", IPSTATS_MIB_OUTBCASTOCTETS), | 92 | SNMP_MIB_ITEM("Ip6OutBcastOctets", IPSTATS_MIB_OUTBCASTOCTETS), |
93 | SNMP_MIB_ITEM("InCsumErrors", IPSTATS_MIB_CSUMERRORS), | 93 | /* IPSTATS_MIB_CSUMERRORS is not relevant in IPv6 (no checksum) */ |
94 | SNMP_MIB_SENTINEL | 94 | SNMP_MIB_SENTINEL |
95 | }; | 95 | }; |
96 | 96 | ||
diff --git a/net/ipv6/udp_offload.c b/net/ipv6/udp_offload.c index 76d401a93c7a..5d1b8d7ac993 100644 --- a/net/ipv6/udp_offload.c +++ b/net/ipv6/udp_offload.c | |||
@@ -46,11 +46,12 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
46 | unsigned int mss; | 46 | unsigned int mss; |
47 | unsigned int unfrag_ip6hlen, unfrag_len; | 47 | unsigned int unfrag_ip6hlen, unfrag_len; |
48 | struct frag_hdr *fptr; | 48 | struct frag_hdr *fptr; |
49 | u8 *mac_start, *prevhdr; | 49 | u8 *packet_start, *prevhdr; |
50 | u8 nexthdr; | 50 | u8 nexthdr; |
51 | u8 frag_hdr_sz = sizeof(struct frag_hdr); | 51 | u8 frag_hdr_sz = sizeof(struct frag_hdr); |
52 | int offset; | 52 | int offset; |
53 | __wsum csum; | 53 | __wsum csum; |
54 | int tnl_hlen; | ||
54 | 55 | ||
55 | mss = skb_shinfo(skb)->gso_size; | 56 | mss = skb_shinfo(skb)->gso_size; |
56 | if (unlikely(skb->len <= mss)) | 57 | if (unlikely(skb->len <= mss)) |
@@ -84,9 +85,11 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
84 | skb->ip_summed = CHECKSUM_NONE; | 85 | skb->ip_summed = CHECKSUM_NONE; |
85 | 86 | ||
86 | /* Check if there is enough headroom to insert fragment header. */ | 87 | /* Check if there is enough headroom to insert fragment header. */ |
87 | if ((skb_mac_header(skb) < skb->head + frag_hdr_sz) && | 88 | tnl_hlen = skb_tnl_header_len(skb); |
88 | pskb_expand_head(skb, frag_hdr_sz, 0, GFP_ATOMIC)) | 89 | if (skb_headroom(skb) < (tnl_hlen + frag_hdr_sz)) { |
89 | goto out; | 90 | if (gso_pskb_expand_head(skb, tnl_hlen + frag_hdr_sz)) |
91 | goto out; | ||
92 | } | ||
90 | 93 | ||
91 | /* Find the unfragmentable header and shift it left by frag_hdr_sz | 94 | /* Find the unfragmentable header and shift it left by frag_hdr_sz |
92 | * bytes to insert fragment header. | 95 | * bytes to insert fragment header. |
@@ -94,11 +97,12 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, | |||
94 | unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr); | 97 | unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr); |
95 | nexthdr = *prevhdr; | 98 | nexthdr = *prevhdr; |
96 | *prevhdr = NEXTHDR_FRAGMENT; | 99 | *prevhdr = NEXTHDR_FRAGMENT; |
97 | unfrag_len = skb_network_header(skb) - skb_mac_header(skb) + | 100 | unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) + |
98 | unfrag_ip6hlen; | 101 | unfrag_ip6hlen + tnl_hlen; |
99 | mac_start = skb_mac_header(skb); | 102 | packet_start = (u8 *) skb->head + SKB_GSO_CB(skb)->mac_offset; |
100 | memmove(mac_start-frag_hdr_sz, mac_start, unfrag_len); | 103 | memmove(packet_start-frag_hdr_sz, packet_start, unfrag_len); |
101 | 104 | ||
105 | SKB_GSO_CB(skb)->mac_offset -= frag_hdr_sz; | ||
102 | skb->mac_header -= frag_hdr_sz; | 106 | skb->mac_header -= frag_hdr_sz; |
103 | skb->network_header -= frag_hdr_sz; | 107 | skb->network_header -= frag_hdr_sz; |
104 | 108 | ||