Merge remote-tracking branch 'common/android-3.0' into msm-3.0
* common/android-3.0: (570 commits) misc: remove kernel debugger core ARM: common: fiq_debugger: dump sysrq directly to console if enabled ARM: common: fiq_debugger: add irq context debug functions net: wireless: bcmdhd: Call init_ioctl() only if was started properly for WEXT net: wireless: bcmdhd: Call init_ioctl() only if was started properly net: wireless: bcmdhd: Fix possible memory leak in escan/iscan cpufreq: interactive governor: default 20ms timer cpufreq: interactive governor: go to intermediate hi speed before max cpufreq: interactive governor: scale to max only if at min speed cpufreq: interactive governor: apply intermediate load on current speed ARM: idle: update idle ticks before call idle end notifier input: gpio_input: don't print debounce message unless flag is set net: wireless: bcm4329: Skip dhd_bus_stop() if bus is already down net: wireless: bcmdhd: Skip dhd_bus_stop() if bus is already down net: wireless: bcmdhd: Improve suspend/resume processing net: wireless: bcmdhd: Check if FW is Ok for internal FW call tcp: Don't nuke connections for the wrong protocol ARM: common: fiq_debugger: make uart irq be no_suspend net: wireless: Skip connect warning for CONFIG_CFG80211_ALLOW_RECONNECT mm: avoid livelock on !__GFP_FS allocations ... Conflicts: arch/arm/mm/cache-l2x0.c arch/arm/vfp/vfpmodule.c drivers/mmc/core/host.c kernel/power/wakelock.c net/bluetooth/hci_event.c Signed-off-by: Bryan Huntsman <bryanh@codeaurora.org>
This commit is contained in:
@@ -597,6 +597,35 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
|
||||
return offset;
|
||||
}
|
||||
|
||||
static u32 hashidentrnd __read_mostly;
|
||||
#define FID_HASH_SZ 16
|
||||
static u32 ipv6_fragmentation_id[FID_HASH_SZ];
|
||||
|
||||
void __init initialize_hashidentrnd(void)
|
||||
{
|
||||
get_random_bytes(&hashidentrnd, sizeof(hashidentrnd));
|
||||
}
|
||||
|
||||
static u32 __ipv6_select_ident(const struct in6_addr *addr)
|
||||
{
|
||||
u32 newid, oldid, hash = jhash2((u32 *)addr, 4, hashidentrnd);
|
||||
u32 *pid = &ipv6_fragmentation_id[hash % FID_HASH_SZ];
|
||||
|
||||
do {
|
||||
oldid = *pid;
|
||||
newid = oldid + 1;
|
||||
if (!(hash + newid))
|
||||
newid++;
|
||||
} while (cmpxchg(pid, oldid, newid) != oldid);
|
||||
|
||||
return hash + newid;
|
||||
}
|
||||
|
||||
void ipv6_select_ident(struct frag_hdr *fhdr, struct in6_addr *addr)
|
||||
{
|
||||
fhdr->identification = htonl(__ipv6_select_ident(addr));
|
||||
}
|
||||
|
||||
int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
|
||||
{
|
||||
struct sk_buff *frag;
|
||||
@@ -681,7 +710,7 @@ int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
|
||||
skb_reset_network_header(skb);
|
||||
memcpy(skb_network_header(skb), tmp_hdr, hlen);
|
||||
|
||||
ipv6_select_ident(fh);
|
||||
ipv6_select_ident(fh, &rt->rt6i_dst.addr);
|
||||
fh->nexthdr = nexthdr;
|
||||
fh->reserved = 0;
|
||||
fh->frag_off = htons(IP6_MF);
|
||||
@@ -827,7 +856,7 @@ slow_path:
|
||||
fh->nexthdr = nexthdr;
|
||||
fh->reserved = 0;
|
||||
if (!frag_id) {
|
||||
ipv6_select_ident(fh);
|
||||
ipv6_select_ident(fh, &rt->rt6i_dst.addr);
|
||||
frag_id = fh->identification;
|
||||
} else
|
||||
fh->identification = frag_id;
|
||||
@@ -1073,7 +1102,8 @@ static inline int ip6_ufo_append_data(struct sock *sk,
|
||||
int getfrag(void *from, char *to, int offset, int len,
|
||||
int odd, struct sk_buff *skb),
|
||||
void *from, int length, int hh_len, int fragheaderlen,
|
||||
int transhdrlen, int mtu,unsigned int flags)
|
||||
int transhdrlen, int mtu,unsigned int flags,
|
||||
struct rt6_info *rt)
|
||||
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
@@ -1117,7 +1147,7 @@ static inline int ip6_ufo_append_data(struct sock *sk,
|
||||
skb_shinfo(skb)->gso_size = (mtu - fragheaderlen -
|
||||
sizeof(struct frag_hdr)) & ~7;
|
||||
skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
|
||||
ipv6_select_ident(&fhdr);
|
||||
ipv6_select_ident(&fhdr, &rt->rt6i_dst.addr);
|
||||
skb_shinfo(skb)->ip6_frag_id = fhdr.identification;
|
||||
__skb_queue_tail(&sk->sk_write_queue, skb);
|
||||
|
||||
@@ -1283,7 +1313,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to,
|
||||
|
||||
err = ip6_ufo_append_data(sk, getfrag, from, length,
|
||||
hh_len, fragheaderlen,
|
||||
transhdrlen, mtu, flags);
|
||||
transhdrlen, mtu, flags, rt);
|
||||
if (err)
|
||||
goto error;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user