Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (40 commits) tg3: Fix tg3_skb_error_unmap() net: tracepoint of net_dev_xmit sees freed skb and causes panic drivers/net/can/flexcan.c: add missing clk_put net: dm9000: Get the chip in a known good state before enabling interrupts drivers/net/davinci_emac.c: add missing clk_put af-packet: Add flag to distinguish VID 0 from no-vlan. caif: Fix race when conditionally taking rtnl lock usbnet/cdc_ncm: add missing .reset_resume hook vlan: fix typo in vlan_dev_hard_start_xmit() net/ipv4: Check for mistakenly passed in non-IPv4 address iwl4965: correctly validate temperature value bluetooth l2cap: fix locking in l2cap_global_chan_by_psm ath9k: fix two more bugs in tx power cfg80211: don't drop p2p probe responses Revert "net: fix section mismatches" drivers/net/usb/catc.c: Fix potential deadlock in catc_ctrl_run() sctp: stop pending timers and purge queues when peer restart asoc drivers/net: ks8842 Fix crash on received packet when in PIO mode. ip_options_compile: properly handle unaligned pointer iwlagn: fix incorrect PCI subsystem id for 6150 devices ...
This commit is contained in:
@@ -465,6 +465,9 @@ 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)
|
||||
goto out;
|
||||
|
||||
chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
|
||||
|
||||
/* Not specified by any standard per-se, however it breaks too
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/ip.h>
|
||||
#include <linux/icmp.h>
|
||||
@@ -350,7 +351,7 @@ int ip_options_compile(struct net *net,
|
||||
goto error;
|
||||
}
|
||||
if (optptr[2] <= optlen) {
|
||||
__be32 *timeptr = NULL;
|
||||
unsigned char *timeptr = NULL;
|
||||
if (optptr[2]+3 > optptr[1]) {
|
||||
pp_ptr = optptr + 2;
|
||||
goto error;
|
||||
@@ -359,7 +360,7 @@ int ip_options_compile(struct net *net,
|
||||
case IPOPT_TS_TSONLY:
|
||||
opt->ts = optptr - iph;
|
||||
if (skb)
|
||||
timeptr = (__be32*)&optptr[optptr[2]-1];
|
||||
timeptr = &optptr[optptr[2]-1];
|
||||
opt->ts_needtime = 1;
|
||||
optptr[2] += 4;
|
||||
break;
|
||||
@@ -371,7 +372,7 @@ int ip_options_compile(struct net *net,
|
||||
opt->ts = optptr - iph;
|
||||
if (rt) {
|
||||
memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4);
|
||||
timeptr = (__be32*)&optptr[optptr[2]+3];
|
||||
timeptr = &optptr[optptr[2]+3];
|
||||
}
|
||||
opt->ts_needaddr = 1;
|
||||
opt->ts_needtime = 1;
|
||||
@@ -389,7 +390,7 @@ int ip_options_compile(struct net *net,
|
||||
if (inet_addr_type(net, addr) == RTN_UNICAST)
|
||||
break;
|
||||
if (skb)
|
||||
timeptr = (__be32*)&optptr[optptr[2]+3];
|
||||
timeptr = &optptr[optptr[2]+3];
|
||||
}
|
||||
opt->ts_needtime = 1;
|
||||
optptr[2] += 8;
|
||||
@@ -403,10 +404,10 @@ int ip_options_compile(struct net *net,
|
||||
}
|
||||
if (timeptr) {
|
||||
struct timespec tv;
|
||||
__be32 midtime;
|
||||
u32 midtime;
|
||||
getnstimeofday(&tv);
|
||||
midtime = htonl((tv.tv_sec % 86400) * MSEC_PER_SEC + tv.tv_nsec / NSEC_PER_MSEC);
|
||||
memcpy(timeptr, &midtime, sizeof(__be32));
|
||||
midtime = (tv.tv_sec % 86400) * MSEC_PER_SEC + tv.tv_nsec / NSEC_PER_MSEC;
|
||||
put_unaligned_be32(midtime, timeptr);
|
||||
opt->is_changed = 1;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user