mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
This commit is contained in:
commit
e12fe68ce3
305 changed files with 2759 additions and 1685 deletions
|
|
@ -465,8 +465,10 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
|
|||
if (addr_len < sizeof(struct sockaddr_in))
|
||||
goto out;
|
||||
|
||||
if (addr->sin_family != AF_INET)
|
||||
if (addr->sin_family != AF_INET) {
|
||||
err = -EAFNOSUPPORT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
|
||||
|
||||
|
|
|
|||
|
|
@ -802,8 +802,6 @@ static int __ip_append_data(struct sock *sk,
|
|||
skb = skb_peek_tail(queue);
|
||||
|
||||
exthdrlen = !skb ? rt->dst.header_len : 0;
|
||||
length += exthdrlen;
|
||||
transhdrlen += exthdrlen;
|
||||
mtu = cork->fragsize;
|
||||
|
||||
hh_len = LL_RESERVED_SPACE(rt->dst.dev);
|
||||
|
|
@ -830,7 +828,7 @@ static int __ip_append_data(struct sock *sk,
|
|||
cork->length += length;
|
||||
if (((length > mtu) || (skb && skb_is_gso(skb))) &&
|
||||
(sk->sk_protocol == IPPROTO_UDP) &&
|
||||
(rt->dst.dev->features & NETIF_F_UFO)) {
|
||||
(rt->dst.dev->features & NETIF_F_UFO) && !rt->dst.header_len) {
|
||||
err = ip_ufo_append_data(sk, queue, getfrag, from, length,
|
||||
hh_len, fragheaderlen, transhdrlen,
|
||||
mtu, flags);
|
||||
|
|
@ -883,17 +881,16 @@ alloc_new_skb:
|
|||
else
|
||||
alloclen = fraglen;
|
||||
|
||||
alloclen += exthdrlen;
|
||||
|
||||
/* The last fragment gets additional space at tail.
|
||||
* Note, with MSG_MORE we overallocate on fragments,
|
||||
* because we have no idea what fragment will be
|
||||
* the last.
|
||||
*/
|
||||
if (datalen == length + fraggap) {
|
||||
if (datalen == length + fraggap)
|
||||
alloclen += rt->dst.trailer_len;
|
||||
/* make sure mtu is not reached */
|
||||
if (datalen > mtu - fragheaderlen - rt->dst.trailer_len)
|
||||
datalen -= ALIGN(rt->dst.trailer_len, 8);
|
||||
}
|
||||
|
||||
if (transhdrlen) {
|
||||
skb = sock_alloc_send_skb(sk,
|
||||
alloclen + hh_len + 15,
|
||||
|
|
@ -926,11 +923,11 @@ alloc_new_skb:
|
|||
/*
|
||||
* Find where to start putting bytes.
|
||||
*/
|
||||
data = skb_put(skb, fraglen);
|
||||
data = skb_put(skb, fraglen + exthdrlen);
|
||||
skb_set_network_header(skb, exthdrlen);
|
||||
skb->transport_header = (skb->network_header +
|
||||
fragheaderlen);
|
||||
data += fragheaderlen;
|
||||
data += fragheaderlen + exthdrlen;
|
||||
|
||||
if (fraggap) {
|
||||
skb->csum = skb_copy_and_csum_bits(
|
||||
|
|
@ -1064,7 +1061,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
|
|||
*/
|
||||
*rtp = NULL;
|
||||
cork->fragsize = inet->pmtudisc == IP_PMTUDISC_PROBE ?
|
||||
rt->dst.dev->mtu : dst_mtu(rt->dst.path);
|
||||
rt->dst.dev->mtu : dst_mtu(&rt->dst);
|
||||
cork->dst = &rt->dst;
|
||||
cork->length = 0;
|
||||
cork->tx_flags = ipc->tx_flags;
|
||||
|
|
|
|||
|
|
@ -17,51 +17,35 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
|
|||
const struct iphdr *iph = ip_hdr(skb);
|
||||
struct rtable *rt;
|
||||
struct flowi4 fl4 = {};
|
||||
unsigned long orefdst;
|
||||
__be32 saddr = iph->saddr;
|
||||
__u8 flags = 0;
|
||||
unsigned int hh_len;
|
||||
unsigned int type;
|
||||
|
||||
type = inet_addr_type(net, iph->saddr);
|
||||
if (skb->sk && inet_sk(skb->sk)->transparent)
|
||||
type = RTN_LOCAL;
|
||||
if (addr_type == RTN_UNSPEC)
|
||||
addr_type = type;
|
||||
if (!skb->sk && addr_type != RTN_LOCAL) {
|
||||
if (addr_type == RTN_UNSPEC)
|
||||
addr_type = inet_addr_type(net, saddr);
|
||||
if (addr_type == RTN_LOCAL || addr_type == RTN_UNICAST)
|
||||
flags |= FLOWI_FLAG_ANYSRC;
|
||||
else
|
||||
saddr = 0;
|
||||
}
|
||||
|
||||
/* some non-standard hacks like ipt_REJECT.c:send_reset() can cause
|
||||
* packets with foreign saddr to appear on the NF_INET_LOCAL_OUT hook.
|
||||
*/
|
||||
if (addr_type == RTN_LOCAL) {
|
||||
fl4.daddr = iph->daddr;
|
||||
if (type == RTN_LOCAL)
|
||||
fl4.saddr = iph->saddr;
|
||||
fl4.flowi4_tos = RT_TOS(iph->tos);
|
||||
fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
|
||||
fl4.flowi4_mark = skb->mark;
|
||||
fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : 0;
|
||||
rt = ip_route_output_key(net, &fl4);
|
||||
if (IS_ERR(rt))
|
||||
return -1;
|
||||
fl4.daddr = iph->daddr;
|
||||
fl4.saddr = saddr;
|
||||
fl4.flowi4_tos = RT_TOS(iph->tos);
|
||||
fl4.flowi4_oif = skb->sk ? skb->sk->sk_bound_dev_if : 0;
|
||||
fl4.flowi4_mark = skb->mark;
|
||||
fl4.flowi4_flags = skb->sk ? inet_sk_flowi_flags(skb->sk) : flags;
|
||||
rt = ip_route_output_key(net, &fl4);
|
||||
if (IS_ERR(rt))
|
||||
return -1;
|
||||
|
||||
/* Drop old route. */
|
||||
skb_dst_drop(skb);
|
||||
skb_dst_set(skb, &rt->dst);
|
||||
} else {
|
||||
/* non-local src, find valid iif to satisfy
|
||||
* rp-filter when calling ip_route_input. */
|
||||
fl4.daddr = iph->saddr;
|
||||
rt = ip_route_output_key(net, &fl4);
|
||||
if (IS_ERR(rt))
|
||||
return -1;
|
||||
|
||||
orefdst = skb->_skb_refdst;
|
||||
if (ip_route_input(skb, iph->daddr, iph->saddr,
|
||||
RT_TOS(iph->tos), rt->dst.dev) != 0) {
|
||||
dst_release(&rt->dst);
|
||||
return -1;
|
||||
}
|
||||
dst_release(&rt->dst);
|
||||
refdst_drop(orefdst);
|
||||
}
|
||||
/* Drop old route. */
|
||||
skb_dst_drop(skb);
|
||||
skb_dst_set(skb, &rt->dst);
|
||||
|
||||
if (skb_dst(skb)->error)
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ static void send_reset(struct sk_buff *oldskb, int hook)
|
|||
struct iphdr *niph;
|
||||
const struct tcphdr *oth;
|
||||
struct tcphdr _otcph, *tcph;
|
||||
unsigned int addr_type;
|
||||
|
||||
/* IP header checks: fragment. */
|
||||
if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET))
|
||||
|
|
@ -55,6 +54,9 @@ static void send_reset(struct sk_buff *oldskb, int hook)
|
|||
if (oth->rst)
|
||||
return;
|
||||
|
||||
if (skb_rtable(oldskb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
|
||||
return;
|
||||
|
||||
/* Check checksum */
|
||||
if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP))
|
||||
return;
|
||||
|
|
@ -101,19 +103,11 @@ static void send_reset(struct sk_buff *oldskb, int hook)
|
|||
nskb->csum_start = (unsigned char *)tcph - nskb->head;
|
||||
nskb->csum_offset = offsetof(struct tcphdr, check);
|
||||
|
||||
addr_type = RTN_UNSPEC;
|
||||
if (hook != NF_INET_FORWARD
|
||||
#ifdef CONFIG_BRIDGE_NETFILTER
|
||||
|| (nskb->nf_bridge && nskb->nf_bridge->mask & BRNF_BRIDGED)
|
||||
#endif
|
||||
)
|
||||
addr_type = RTN_LOCAL;
|
||||
|
||||
/* ip_route_me_harder expects skb->dst to be set */
|
||||
skb_dst_set_noref(nskb, skb_dst(oldskb));
|
||||
|
||||
nskb->protocol = htons(ETH_P_IP);
|
||||
if (ip_route_me_harder(nskb, addr_type))
|
||||
if (ip_route_me_harder(nskb, RTN_UNSPEC))
|
||||
goto free_nskb;
|
||||
|
||||
niph->ttl = ip4_dst_hoplimit(skb_dst(nskb));
|
||||
|
|
|
|||
|
|
@ -1250,6 +1250,9 @@ csum_copy_err:
|
|||
|
||||
if (noblock)
|
||||
return -EAGAIN;
|
||||
|
||||
/* starting over for a new packet */
|
||||
msg->msg_flags &= ~MSG_TRUNC;
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,12 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
|
|||
dst = skb_dst(skb);
|
||||
mtu = dst_mtu(dst);
|
||||
if (skb->len > mtu) {
|
||||
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
|
||||
if (skb->sk)
|
||||
ip_local_error(skb->sk, EMSGSIZE, ip_hdr(skb)->daddr,
|
||||
inet_sk(skb->sk)->inet_dport, mtu);
|
||||
else
|
||||
icmp_send(skb, ICMP_DEST_UNREACH,
|
||||
ICMP_FRAG_NEEDED, htonl(mtu));
|
||||
ret = -EMSGSIZE;
|
||||
}
|
||||
out:
|
||||
|
|
|
|||
Loading…
Reference in a new issue