mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/vxlan.c drivers/vhost/net.c include/linux/if_vlan.h net/core/dev.c The net/core/dev.c conflict was the overlap of one commit marking an existing function static whilst another was adding a new function. In the include/linux/if_vlan.h case, the type used for a local variable was changed in 'net', whereas the function got rewritten to fix a stacked vlan bug in 'net-next'. In drivers/vhost/net.c, Al Viro's iov_iter conversions in 'net-next' overlapped with an endainness fix for VHOST 1.0 in 'net'. In drivers/net/vxlan.c, vxlan_find_vni() added a 'flags' parameter in 'net-next' whereas in 'net' there was a bug fix to pass in the correct network namespace pointer in calls to this function. Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
commit
6e03f896b5
280 changed files with 2574 additions and 1653 deletions
|
|
@ -417,7 +417,7 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
|||
if (code == ICMPV6_HDR_FIELD)
|
||||
teli = ip6_tnl_parse_tlv_enc_lim(skb, skb->data);
|
||||
|
||||
if (teli && teli == info - 2) {
|
||||
if (teli && teli == be32_to_cpu(info) - 2) {
|
||||
tel = (struct ipv6_tlv_tnl_enc_lim *) &skb->data[teli];
|
||||
if (tel->encap_limit == 0) {
|
||||
net_warn_ratelimited("%s: Too small encapsulation limit or routing loop in tunnel!\n",
|
||||
|
|
@ -429,7 +429,7 @@ static void ip6gre_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
|
|||
}
|
||||
break;
|
||||
case ICMPV6_PKT_TOOBIG:
|
||||
mtu = info - offset;
|
||||
mtu = be32_to_cpu(info) - offset;
|
||||
if (mtu < IPV6_MIN_MTU)
|
||||
mtu = IPV6_MIN_MTU;
|
||||
t->dev->mtu = mtu;
|
||||
|
|
|
|||
|
|
@ -537,20 +537,6 @@ static void ip6_copy_metadata(struct sk_buff *to, struct sk_buff *from)
|
|||
skb_copy_secmark(to, from);
|
||||
}
|
||||
|
||||
static void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
|
||||
{
|
||||
static u32 ip6_idents_hashrnd __read_mostly;
|
||||
u32 hash, id;
|
||||
|
||||
net_get_random_once(&ip6_idents_hashrnd, sizeof(ip6_idents_hashrnd));
|
||||
|
||||
hash = __ipv6_addr_jhash(&rt->rt6i_dst.addr, ip6_idents_hashrnd);
|
||||
hash = __ipv6_addr_jhash(&rt->rt6i_src.addr, hash);
|
||||
|
||||
id = ip_idents_reserve(hash, 1);
|
||||
fhdr->identification = htonl(id);
|
||||
}
|
||||
|
||||
int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
|
||||
{
|
||||
struct sk_buff *frag;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,24 @@
|
|||
#include <net/addrconf.h>
|
||||
#include <net/secure_seq.h>
|
||||
|
||||
u32 __ipv6_select_ident(u32 hashrnd, struct in6_addr *dst, struct in6_addr *src)
|
||||
{
|
||||
u32 hash, id;
|
||||
|
||||
hash = __ipv6_addr_jhash(dst, hashrnd);
|
||||
hash = __ipv6_addr_jhash(src, hash);
|
||||
|
||||
/* Treat id of 0 as unset and if we get 0 back from ip_idents_reserve,
|
||||
* set the hight order instead thus minimizing possible future
|
||||
* collisions.
|
||||
*/
|
||||
id = ip_idents_reserve(hash, 1);
|
||||
if (unlikely(!id))
|
||||
id = 1 << 31;
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
/* This function exists only for tap drivers that must support broken
|
||||
* clients requesting UFO without specifying an IPv6 fragment ID.
|
||||
*
|
||||
|
|
@ -22,7 +40,7 @@ void ipv6_proxy_select_ident(struct sk_buff *skb)
|
|||
static u32 ip6_proxy_idents_hashrnd __read_mostly;
|
||||
struct in6_addr buf[2];
|
||||
struct in6_addr *addrs;
|
||||
u32 hash, id;
|
||||
u32 id;
|
||||
|
||||
addrs = skb_header_pointer(skb,
|
||||
skb_network_offset(skb) +
|
||||
|
|
@ -34,14 +52,25 @@ void ipv6_proxy_select_ident(struct sk_buff *skb)
|
|||
net_get_random_once(&ip6_proxy_idents_hashrnd,
|
||||
sizeof(ip6_proxy_idents_hashrnd));
|
||||
|
||||
hash = __ipv6_addr_jhash(&addrs[1], ip6_proxy_idents_hashrnd);
|
||||
hash = __ipv6_addr_jhash(&addrs[0], hash);
|
||||
|
||||
id = ip_idents_reserve(hash, 1);
|
||||
skb_shinfo(skb)->ip6_frag_id = htonl(id);
|
||||
id = __ipv6_select_ident(ip6_proxy_idents_hashrnd,
|
||||
&addrs[1], &addrs[0]);
|
||||
skb_shinfo(skb)->ip6_frag_id = id;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ipv6_proxy_select_ident);
|
||||
|
||||
void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
|
||||
{
|
||||
static u32 ip6_idents_hashrnd __read_mostly;
|
||||
u32 id;
|
||||
|
||||
net_get_random_once(&ip6_idents_hashrnd, sizeof(ip6_idents_hashrnd));
|
||||
|
||||
id = __ipv6_select_ident(ip6_idents_hashrnd, &rt->rt6i_dst.addr,
|
||||
&rt->rt6i_src.addr);
|
||||
fhdr->identification = htonl(id);
|
||||
}
|
||||
EXPORT_SYMBOL(ipv6_select_ident);
|
||||
|
||||
int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
|
||||
{
|
||||
u16 offset = sizeof(struct ipv6hdr);
|
||||
|
|
|
|||
|
|
@ -1506,12 +1506,12 @@ static bool ipip6_netlink_encap_parms(struct nlattr *data[],
|
|||
|
||||
if (data[IFLA_IPTUN_ENCAP_SPORT]) {
|
||||
ret = true;
|
||||
ipencap->sport = nla_get_u16(data[IFLA_IPTUN_ENCAP_SPORT]);
|
||||
ipencap->sport = nla_get_be16(data[IFLA_IPTUN_ENCAP_SPORT]);
|
||||
}
|
||||
|
||||
if (data[IFLA_IPTUN_ENCAP_DPORT]) {
|
||||
ret = true;
|
||||
ipencap->dport = nla_get_u16(data[IFLA_IPTUN_ENCAP_DPORT]);
|
||||
ipencap->dport = nla_get_be16(data[IFLA_IPTUN_ENCAP_DPORT]);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
@ -1707,9 +1707,9 @@ static int ipip6_fill_info(struct sk_buff *skb, const struct net_device *dev)
|
|||
|
||||
if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE,
|
||||
tunnel->encap.type) ||
|
||||
nla_put_u16(skb, IFLA_IPTUN_ENCAP_SPORT,
|
||||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT,
|
||||
tunnel->encap.sport) ||
|
||||
nla_put_u16(skb, IFLA_IPTUN_ENCAP_DPORT,
|
||||
nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT,
|
||||
tunnel->encap.dport) ||
|
||||
nla_put_u16(skb, IFLA_IPTUN_ENCAP_FLAGS,
|
||||
tunnel->encap.flags))
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
|
|||
|
||||
skb_shinfo(skb)->gso_segs = DIV_ROUND_UP(skb->len, mss);
|
||||
|
||||
/* Set the IPv6 fragment id if not set yet */
|
||||
if (!skb_shinfo(skb)->ip6_frag_id)
|
||||
ipv6_proxy_select_ident(skb);
|
||||
|
||||
segs = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -108,7 +112,11 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb,
|
|||
fptr = (struct frag_hdr *)(skb_network_header(skb) + unfrag_ip6hlen);
|
||||
fptr->nexthdr = nexthdr;
|
||||
fptr->reserved = 0;
|
||||
fptr->identification = skb_shinfo(skb)->ip6_frag_id;
|
||||
if (skb_shinfo(skb)->ip6_frag_id)
|
||||
fptr->identification = skb_shinfo(skb)->ip6_frag_id;
|
||||
else
|
||||
ipv6_select_ident(fptr,
|
||||
(struct rt6_info *)skb_dst(skb));
|
||||
|
||||
/* Fragment the skb. ipv6 header and the remaining fields of the
|
||||
* fragment header are updated in ipv6_gso_segment()
|
||||
|
|
|
|||
Loading…
Reference in a new issue