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
Bring in the 'net' tree so that we can get some ipv4/ipv6 bug fixes that some net-next work will build upon. Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
commit
f1e7b73acc
393 changed files with 3572 additions and 1814 deletions
|
|
@ -269,7 +269,11 @@ static void ah_input_done(struct crypto_async_request *base, int err)
|
|||
skb->network_header += ah_hlen;
|
||||
memcpy(skb_network_header(skb), work_iph, ihl);
|
||||
__skb_pull(skb, ah_hlen + ihl);
|
||||
skb_set_transport_header(skb, -ihl);
|
||||
|
||||
if (x->props.mode == XFRM_MODE_TUNNEL)
|
||||
skb_reset_transport_header(skb);
|
||||
else
|
||||
skb_set_transport_header(skb, -ihl);
|
||||
out:
|
||||
kfree(AH_SKB_CB(skb)->tmp);
|
||||
xfrm_input_resume(skb, err);
|
||||
|
|
@ -381,7 +385,10 @@ static int ah_input(struct xfrm_state *x, struct sk_buff *skb)
|
|||
skb->network_header += ah_hlen;
|
||||
memcpy(skb_network_header(skb), work_iph, ihl);
|
||||
__skb_pull(skb, ah_hlen + ihl);
|
||||
skb_set_transport_header(skb, -ihl);
|
||||
if (x->props.mode == XFRM_MODE_TUNNEL)
|
||||
skb_reset_transport_header(skb);
|
||||
else
|
||||
skb_set_transport_header(skb, -ihl);
|
||||
|
||||
err = nexthdr;
|
||||
|
||||
|
|
@ -413,9 +420,12 @@ static void ah4_err(struct sk_buff *skb, u32 info)
|
|||
if (!x)
|
||||
return;
|
||||
|
||||
if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH)
|
||||
if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) {
|
||||
atomic_inc(&flow_cache_genid);
|
||||
rt_genid_bump(net);
|
||||
|
||||
ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_AH, 0);
|
||||
else
|
||||
} else
|
||||
ipv4_redirect(skb, net, 0, 0, IPPROTO_AH, 0);
|
||||
xfrm_state_put(x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,3 +85,28 @@ out:
|
|||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(ip4_datagram_connect);
|
||||
|
||||
void ip4_datagram_release_cb(struct sock *sk)
|
||||
{
|
||||
const struct inet_sock *inet = inet_sk(sk);
|
||||
const struct ip_options_rcu *inet_opt;
|
||||
__be32 daddr = inet->inet_daddr;
|
||||
struct flowi4 fl4;
|
||||
struct rtable *rt;
|
||||
|
||||
if (! __sk_dst_get(sk) || __sk_dst_check(sk, 0))
|
||||
return;
|
||||
|
||||
rcu_read_lock();
|
||||
inet_opt = rcu_dereference(inet->inet_opt);
|
||||
if (inet_opt && inet_opt->opt.srr)
|
||||
daddr = inet_opt->opt.faddr;
|
||||
rt = ip_route_output_ports(sock_net(sk), &fl4, sk, daddr,
|
||||
inet->inet_saddr, inet->inet_dport,
|
||||
inet->inet_sport, sk->sk_protocol,
|
||||
RT_CONN_FLAGS(sk), sk->sk_bound_dev_if);
|
||||
if (!IS_ERR(rt))
|
||||
__sk_dst_set(sk, &rt->dst);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ip4_datagram_release_cb);
|
||||
|
|
|
|||
|
|
@ -346,7 +346,10 @@ static int esp_input_done2(struct sk_buff *skb, int err)
|
|||
|
||||
pskb_trim(skb, skb->len - alen - padlen - 2);
|
||||
__skb_pull(skb, hlen);
|
||||
skb_set_transport_header(skb, -ihl);
|
||||
if (x->props.mode == XFRM_MODE_TUNNEL)
|
||||
skb_reset_transport_header(skb);
|
||||
else
|
||||
skb_set_transport_header(skb, -ihl);
|
||||
|
||||
err = nexthdr[1];
|
||||
|
||||
|
|
@ -499,9 +502,12 @@ static void esp4_err(struct sk_buff *skb, u32 info)
|
|||
if (!x)
|
||||
return;
|
||||
|
||||
if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH)
|
||||
if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) {
|
||||
atomic_inc(&flow_cache_genid);
|
||||
rt_genid_bump(net);
|
||||
|
||||
ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_ESP, 0);
|
||||
else
|
||||
} else
|
||||
ipv4_redirect(skb, net, 0, 0, IPPROTO_ESP, 0);
|
||||
xfrm_state_put(x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -965,8 +965,12 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
|
|||
ptr--;
|
||||
}
|
||||
if (tunnel->parms.o_flags&GRE_CSUM) {
|
||||
int offset = skb_transport_offset(skb);
|
||||
|
||||
*ptr = 0;
|
||||
*(__sum16 *)ptr = ip_compute_csum((void *)(iph+1), skb->len - sizeof(struct iphdr));
|
||||
*(__sum16 *)ptr = csum_fold(skb_checksum(skb, offset,
|
||||
skb->len - offset,
|
||||
0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,9 +47,12 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info)
|
|||
if (!x)
|
||||
return;
|
||||
|
||||
if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH)
|
||||
if (icmp_hdr(skb)->type == ICMP_DEST_UNREACH) {
|
||||
atomic_inc(&flow_cache_genid);
|
||||
rt_genid_bump(net);
|
||||
|
||||
ipv4_update_pmtu(skb, net, info, 0, 0, IPPROTO_COMP, 0);
|
||||
else
|
||||
} else
|
||||
ipv4_redirect(skb, net, 0, 0, IPPROTO_COMP, 0);
|
||||
xfrm_state_put(x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -738,6 +738,7 @@ struct proto ping_prot = {
|
|||
.recvmsg = ping_recvmsg,
|
||||
.bind = ping_bind,
|
||||
.backlog_rcv = ping_queue_rcv_skb,
|
||||
.release_cb = ip4_datagram_release_cb,
|
||||
.hash = ping_v4_hash,
|
||||
.unhash = ping_v4_unhash,
|
||||
.get_port = ping_v4_get_port,
|
||||
|
|
|
|||
|
|
@ -894,6 +894,7 @@ struct proto raw_prot = {
|
|||
.recvmsg = raw_recvmsg,
|
||||
.bind = raw_bind,
|
||||
.backlog_rcv = raw_rcv_skb,
|
||||
.release_cb = ip4_datagram_release_cb,
|
||||
.hash = raw_hash_sk,
|
||||
.unhash = raw_unhash_sk,
|
||||
.obj_size = sizeof(struct raw_sock),
|
||||
|
|
|
|||
|
|
@ -912,6 +912,9 @@ static void __ip_rt_update_pmtu(struct rtable *rt, struct flowi4 *fl4, u32 mtu)
|
|||
struct dst_entry *dst = &rt->dst;
|
||||
struct fib_result res;
|
||||
|
||||
if (dst_metric_locked(dst, RTAX_MTU))
|
||||
return;
|
||||
|
||||
if (dst->dev->mtu < mtu)
|
||||
return;
|
||||
|
||||
|
|
@ -962,7 +965,7 @@ void ipv4_update_pmtu(struct sk_buff *skb, struct net *net, u32 mtu,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(ipv4_update_pmtu);
|
||||
|
||||
void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
|
||||
static void __ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
|
||||
{
|
||||
const struct iphdr *iph = (const struct iphdr *) skb->data;
|
||||
struct flowi4 fl4;
|
||||
|
|
@ -975,6 +978,53 @@ void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
|
|||
ip_rt_put(rt);
|
||||
}
|
||||
}
|
||||
|
||||
void ipv4_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, u32 mtu)
|
||||
{
|
||||
const struct iphdr *iph = (const struct iphdr *) skb->data;
|
||||
struct flowi4 fl4;
|
||||
struct rtable *rt;
|
||||
struct dst_entry *dst;
|
||||
bool new = false;
|
||||
|
||||
bh_lock_sock(sk);
|
||||
rt = (struct rtable *) __sk_dst_get(sk);
|
||||
|
||||
if (sock_owned_by_user(sk) || !rt) {
|
||||
__ipv4_sk_update_pmtu(skb, sk, mtu);
|
||||
goto out;
|
||||
}
|
||||
|
||||
__build_flow_key(&fl4, sk, iph, 0, 0, 0, 0, 0);
|
||||
|
||||
if (!__sk_dst_check(sk, 0)) {
|
||||
rt = ip_route_output_flow(sock_net(sk), &fl4, sk);
|
||||
if (IS_ERR(rt))
|
||||
goto out;
|
||||
|
||||
new = true;
|
||||
}
|
||||
|
||||
__ip_rt_update_pmtu((struct rtable *) rt->dst.path, &fl4, mtu);
|
||||
|
||||
dst = dst_check(&rt->dst, 0);
|
||||
if (!dst) {
|
||||
if (new)
|
||||
dst_release(&rt->dst);
|
||||
|
||||
rt = ip_route_output_flow(sock_net(sk), &fl4, sk);
|
||||
if (IS_ERR(rt))
|
||||
goto out;
|
||||
|
||||
new = true;
|
||||
}
|
||||
|
||||
if (new)
|
||||
__sk_dst_set(sk, &rt->dst);
|
||||
|
||||
out:
|
||||
bh_unlock_sock(sk);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(ipv4_sk_update_pmtu);
|
||||
|
||||
void ipv4_redirect(struct sk_buff *skb, struct net *net,
|
||||
|
|
@ -1120,7 +1170,7 @@ static unsigned int ipv4_mtu(const struct dst_entry *dst)
|
|||
if (!mtu || time_after_eq(jiffies, rt->dst.expires))
|
||||
mtu = dst_metric_raw(dst, RTAX_MTU);
|
||||
|
||||
if (mtu && rt_is_output_route(rt))
|
||||
if (mtu)
|
||||
return mtu;
|
||||
|
||||
mtu = dst->dev->mtu;
|
||||
|
|
|
|||
|
|
@ -369,11 +369,10 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
|
|||
* We do take care of PMTU discovery (RFC1191) special case :
|
||||
* we can receive locally generated ICMP messages while socket is held.
|
||||
*/
|
||||
if (sock_owned_by_user(sk) &&
|
||||
type != ICMP_DEST_UNREACH &&
|
||||
code != ICMP_FRAG_NEEDED)
|
||||
NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
|
||||
|
||||
if (sock_owned_by_user(sk)) {
|
||||
if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED))
|
||||
NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
|
||||
}
|
||||
if (sk->sk_state == TCP_CLOSE)
|
||||
goto out;
|
||||
|
||||
|
|
|
|||
|
|
@ -1977,6 +1977,7 @@ struct proto udp_prot = {
|
|||
.recvmsg = udp_recvmsg,
|
||||
.sendpage = udp_sendpage,
|
||||
.backlog_rcv = __udp_queue_rcv_skb,
|
||||
.release_cb = ip4_datagram_release_cb,
|
||||
.hash = udp_lib_hash,
|
||||
.unhash = udp_lib_unhash,
|
||||
.rehash = udp_v4_rehash,
|
||||
|
|
|
|||
Loading…
Reference in a new issue