Commit 45efebf2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [ICMP]: Fix icmp_errors_use_inbound_ifaddr sysctl
  [IPV4]: Fix "ipOutNoRoutes" counter error for TCP and UDP
  [NET] gso: Fix GSO feature mask in sk_setup_caps
  [TCP]: Fix GSO ignorance of pkts_acked arg (cong.cntrl modules)
  [NET]: Fix comparisons of unsigned < 0.
  [NET]: Make net watchdog timers 1 sec jiffy aligned.
  [ATM]: Fix warning.
  [TCP]: Use default 32768-61000 outgoing port range in all cases.
  [AF_UNIX]: Fix datagram connect race causing an OOPS.
  [TG3]: Fix link problem on Dell's onboard 5906.
  [AF_UNIX]: Make socket locking much less confusing.
parents 4acbab84 6e1d9103
...@@ -1475,6 +1475,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp, ...@@ -1475,6 +1475,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
struct FS_BPENTRY *qe, *ne; struct FS_BPENTRY *qe, *ne;
struct sk_buff *skb; struct sk_buff *skb;
int n = 0; int n = 0;
u32 qe_tmp;
fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n", fs_dprintk (FS_DEBUG_QUEUE, "Topping off queue at %x (%d-%d/%d)\n",
fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n, fp->offset, read_fs (dev, FP_CNT (fp->offset)), fp->n,
...@@ -1502,10 +1503,16 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp, ...@@ -1502,10 +1503,16 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
ne->skb = skb; ne->skb = skb;
ne->fp = fp; ne->fp = fp;
qe = (struct FS_BPENTRY *) (read_fs (dev, FP_EA(fp->offset))); /*
fs_dprintk (FS_DEBUG_QUEUE, "link at %p\n", qe); * FIXME: following code encodes and decodes
if (qe) { * machine pointers (could be 64-bit) into a
qe = bus_to_virt ((long) qe); * 32-bit register.
*/
qe_tmp = read_fs (dev, FP_EA(fp->offset));
fs_dprintk (FS_DEBUG_QUEUE, "link at %x\n", qe_tmp);
if (qe_tmp) {
qe = bus_to_virt ((long) qe_tmp);
qe->next = virt_to_bus(ne); qe->next = virt_to_bus(ne);
qe->flags &= ~FP_FLAGS_EPI; qe->flags &= ~FP_FLAGS_EPI;
} else } else
......
...@@ -64,8 +64,8 @@ ...@@ -64,8 +64,8 @@
#define DRV_MODULE_NAME "tg3" #define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": " #define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.76" #define DRV_MODULE_VERSION "3.77"
#define DRV_MODULE_RELDATE "May 5, 2007" #define DRV_MODULE_RELDATE "May 31, 2007"
#define TG3_DEF_MAC_MODE 0 #define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0 #define TG3_DEF_RX_MODE 0
...@@ -10961,6 +10961,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -10961,6 +10961,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
* upon subsystem IDs. * upon subsystem IDs.
*/ */
if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL && if (tp->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL &&
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701 &&
!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) { !(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT | tp->tg3_flags |= (TG3_FLAG_USE_MI_INTERRUPT |
TG3_FLAG_USE_LINKCHG_REG); TG3_FLAG_USE_LINKCHG_REG);
......
...@@ -62,13 +62,11 @@ struct unix_skb_parms { ...@@ -62,13 +62,11 @@ struct unix_skb_parms {
#define UNIXCREDS(skb) (&UNIXCB((skb)).creds) #define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
#define UNIXSID(skb) (&UNIXCB((skb)).secid) #define UNIXSID(skb) (&UNIXCB((skb)).secid)
#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock) #define unix_state_lock(s) spin_lock(&unix_sk(s)->lock)
#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock) #define unix_state_unlock(s) spin_unlock(&unix_sk(s)->lock)
#define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock) #define unix_state_lock_nested(s) \
#define unix_state_wlock_nested(s) \
spin_lock_nested(&unix_sk(s)->lock, \ spin_lock_nested(&unix_sk(s)->lock, \
SINGLE_DEPTH_NESTING) SINGLE_DEPTH_NESTING)
#define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock)
#ifdef __KERNEL__ #ifdef __KERNEL__
/* The AF_UNIX socket */ /* The AF_UNIX socket */
......
...@@ -736,8 +736,7 @@ static int vlan_ioctl_handler(void __user *arg) ...@@ -736,8 +736,7 @@ static int vlan_ioctl_handler(void __user *arg)
case SET_VLAN_NAME_TYPE_CMD: case SET_VLAN_NAME_TYPE_CMD:
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
if ((args.u.name_type >= 0) && if (args.u.name_type < VLAN_NAME_TYPE_HIGHEST) {
(args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) {
vlan_name_type = args.u.name_type; vlan_name_type = args.u.name_type;
err = 0; err = 0;
} else { } else {
......
...@@ -998,7 +998,7 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst) ...@@ -998,7 +998,7 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
__sk_dst_set(sk, dst); __sk_dst_set(sk, dst);
sk->sk_route_caps = dst->dev->features; sk->sk_route_caps = dst->dev->features;
if (sk->sk_route_caps & NETIF_F_GSO) if (sk->sk_route_caps & NETIF_F_GSO)
sk->sk_route_caps |= NETIF_F_GSO_MASK; sk->sk_route_caps |= NETIF_F_GSO_SOFTWARE;
if (sk_can_gso(sk)) { if (sk_can_gso(sk)) {
if (dst->header_len) if (dst->header_len)
sk->sk_route_caps &= ~NETIF_F_GSO_MASK; sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
......
...@@ -128,7 +128,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf, ...@@ -128,7 +128,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf,
int error = 0, cnt = 0; int error = 0, cnt = 0;
unsigned char *tbuf; unsigned char *tbuf;
if (!buf || len < 0) if (!buf)
return -EINVAL; return -EINVAL;
if (len == 0) if (len == 0)
......
...@@ -50,8 +50,12 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -50,8 +50,12 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
RT_CONN_FLAGS(sk), oif, RT_CONN_FLAGS(sk), oif,
sk->sk_protocol, sk->sk_protocol,
inet->sport, usin->sin_port, sk, 1); inet->sport, usin->sin_port, sk, 1);
if (err) if (err) {
if (err == -ENETUNREACH)
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
return err; return err;
}
if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) { if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) {
ip_rt_put(rt); ip_rt_put(rt);
return -EACCES; return -EACCES;
......
...@@ -514,12 +514,15 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info) ...@@ -514,12 +514,15 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
saddr = iph->daddr; saddr = iph->daddr;
if (!(rt->rt_flags & RTCF_LOCAL)) { if (!(rt->rt_flags & RTCF_LOCAL)) {
/* This is broken, skb_in->dev points to the outgoing device struct net_device *dev = NULL;
* after the packet passes through ip_output().
*/ if (rt->fl.iif && sysctl_icmp_errors_use_inbound_ifaddr)
if (skb_in->dev && sysctl_icmp_errors_use_inbound_ifaddr) dev = dev_get_by_index(rt->fl.iif);
saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK);
else if (dev) {
saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK);
dev_put(dev);
} else
saddr = 0; saddr = 0;
} }
......
...@@ -31,10 +31,8 @@ EXPORT_SYMBOL(inet_csk_timer_bug_msg); ...@@ -31,10 +31,8 @@ EXPORT_SYMBOL(inet_csk_timer_bug_msg);
/* /*
* This array holds the first and last local port number. * This array holds the first and last local port number.
* For high-usage systems, use sysctl to change this to
* 32768-61000
*/ */
int sysctl_local_port_range[2] = { 1024, 4999 }; int sysctl_local_port_range[2] = { 32768, 61000 };
int inet_csk_bind_conflict(const struct sock *sk, int inet_csk_bind_conflict(const struct sock *sk,
const struct inet_bind_bucket *tb) const struct inet_bind_bucket *tb)
......
...@@ -2464,13 +2464,10 @@ void __init tcp_init(void) ...@@ -2464,13 +2464,10 @@ void __init tcp_init(void)
order++) order++)
; ;
if (order >= 4) { if (order >= 4) {
sysctl_local_port_range[0] = 32768;
sysctl_local_port_range[1] = 61000;
tcp_death_row.sysctl_max_tw_buckets = 180000; tcp_death_row.sysctl_max_tw_buckets = 180000;
sysctl_tcp_max_orphans = 4096 << (order - 4); sysctl_tcp_max_orphans = 4096 << (order - 4);
sysctl_max_syn_backlog = 1024; sysctl_max_syn_backlog = 1024;
} else if (order < 3) { } else if (order < 3) {
sysctl_local_port_range[0] = 1024 * (3 - order);
tcp_death_row.sysctl_max_tw_buckets >>= (3 - order); tcp_death_row.sysctl_max_tw_buckets >>= (3 - order);
sysctl_tcp_max_orphans >>= (3 - order); sysctl_tcp_max_orphans >>= (3 - order);
sysctl_max_syn_backlog = 128; sysctl_max_syn_backlog = 128;
......
...@@ -2407,8 +2407,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p) ...@@ -2407,8 +2407,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
struct sk_buff *skb; struct sk_buff *skb;
__u32 now = tcp_time_stamp; __u32 now = tcp_time_stamp;
int acked = 0; int acked = 0;
int prior_packets = tp->packets_out;
__s32 seq_rtt = -1; __s32 seq_rtt = -1;
u32 pkts_acked = 0;
ktime_t last_ackt = ktime_set(0,0); ktime_t last_ackt = ktime_set(0,0);
while ((skb = tcp_write_queue_head(sk)) && while ((skb = tcp_write_queue_head(sk)) &&
...@@ -2437,7 +2437,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p) ...@@ -2437,7 +2437,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
*/ */
if (!(scb->flags & TCPCB_FLAG_SYN)) { if (!(scb->flags & TCPCB_FLAG_SYN)) {
acked |= FLAG_DATA_ACKED; acked |= FLAG_DATA_ACKED;
++pkts_acked;
} else { } else {
acked |= FLAG_SYN_ACKED; acked |= FLAG_SYN_ACKED;
tp->retrans_stamp = 0; tp->retrans_stamp = 0;
...@@ -2481,6 +2480,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p) ...@@ -2481,6 +2480,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
} }
if (acked&FLAG_ACKED) { if (acked&FLAG_ACKED) {
u32 pkts_acked = prior_packets - tp->packets_out;
const struct tcp_congestion_ops *ca_ops const struct tcp_congestion_ops *ca_ops
= inet_csk(sk)->icsk_ca_ops; = inet_csk(sk)->icsk_ca_ops;
......
...@@ -192,8 +192,11 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) ...@@ -192,8 +192,11 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
RT_CONN_FLAGS(sk), sk->sk_bound_dev_if, RT_CONN_FLAGS(sk), sk->sk_bound_dev_if,
IPPROTO_TCP, IPPROTO_TCP,
inet->sport, usin->sin_port, sk, 1); inet->sport, usin->sin_port, sk, 1);
if (tmp < 0) if (tmp < 0) {
if (tmp == -ENETUNREACH)
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
return tmp; return tmp;
}
if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) { if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) {
ip_rt_put(rt); ip_rt_put(rt);
......
...@@ -722,8 +722,11 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -722,8 +722,11 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
.dport = dport } } }; .dport = dport } } };
security_sk_classify_flow(sk, &fl); security_sk_classify_flow(sk, &fl);
err = ip_route_output_flow(&rt, &fl, sk, 1); err = ip_route_output_flow(&rt, &fl, sk, 1);
if (err) if (err) {
if (err == -ENETUNREACH)
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
goto out; goto out;
}
err = -EACCES; err = -EACCES;
if ((rt->rt_flags & RTCF_BROADCAST) && if ((rt->rt_flags & RTCF_BROADCAST) &&
......
...@@ -177,8 +177,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum, ...@@ -177,8 +177,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum,
protoff = nf_ct_ipv6_skip_exthdr(*pskb, extoff, &pnum, protoff = nf_ct_ipv6_skip_exthdr(*pskb, extoff, &pnum,
(*pskb)->len - extoff); (*pskb)->len - extoff);
if (protoff < 0 || protoff > (*pskb)->len || if (protoff > (*pskb)->len || pnum == NEXTHDR_FRAGMENT) {
pnum == NEXTHDR_FRAGMENT) {
DEBUGP("proto header not found\n"); DEBUGP("proto header not found\n");
return NF_ACCEPT; return NF_ACCEPT;
} }
......
...@@ -168,8 +168,7 @@ icmpv6_error_message(struct sk_buff *skb, ...@@ -168,8 +168,7 @@ icmpv6_error_message(struct sk_buff *skb,
skb->len - inip6off skb->len - inip6off
- sizeof(struct ipv6hdr)); - sizeof(struct ipv6hdr));
if ((inprotoff < 0) || (inprotoff > skb->len) || if ((inprotoff > skb->len) || (inprotonum == NEXTHDR_FRAGMENT)) {
(inprotonum == NEXTHDR_FRAGMENT)) {
DEBUGP("icmpv6_error: Can't get protocol header in ICMPv6 payload.\n"); DEBUGP("icmpv6_error: Can't get protocol header in ICMPv6 payload.\n");
return -NF_ACCEPT; return -NF_ACCEPT;
} }
......
...@@ -164,8 +164,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a, ...@@ -164,8 +164,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
printk("offset must be on 32 bit boundaries\n"); printk("offset must be on 32 bit boundaries\n");
goto bad; goto bad;
} }
if (skb->len < 0 || if (offset > 0 && offset > skb->len) {
(offset > 0 && offset > skb->len)) {
printk("offset %d cant exceed pkt length %d\n", printk("offset %d cant exceed pkt length %d\n",
offset, skb->len); offset, skb->len);
goto bad; goto bad;
......
...@@ -224,7 +224,8 @@ void __netdev_watchdog_up(struct net_device *dev) ...@@ -224,7 +224,8 @@ void __netdev_watchdog_up(struct net_device *dev)
if (dev->tx_timeout) { if (dev->tx_timeout) {
if (dev->watchdog_timeo <= 0) if (dev->watchdog_timeo <= 0)
dev->watchdog_timeo = 5*HZ; dev->watchdog_timeo = 5*HZ;
if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo)) if (!mod_timer(&dev->watchdog_timer,
round_jiffies(jiffies + dev->watchdog_timeo)))
dev_hold(dev); dev_hold(dev);
} }
} }
......
...@@ -77,8 +77,6 @@ static const char *sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = { ...@@ -77,8 +77,6 @@ static const char *sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = {
/* Lookup "chunk type" debug name. */ /* Lookup "chunk type" debug name. */
const char *sctp_cname(const sctp_subtype_t cid) const char *sctp_cname(const sctp_subtype_t cid)
{ {
if (cid.chunk < 0)
return "illegal chunk id";
if (cid.chunk <= SCTP_CID_BASE_MAX) if (cid.chunk <= SCTP_CID_BASE_MAX)
return sctp_cid_tbl[cid.chunk]; return sctp_cid_tbl[cid.chunk];
...@@ -146,8 +144,6 @@ static const char *sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = { ...@@ -146,8 +144,6 @@ static const char *sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = {
/* Lookup primitive debug name. */ /* Lookup primitive debug name. */
const char *sctp_pname(const sctp_subtype_t id) const char *sctp_pname(const sctp_subtype_t id)
{ {
if (id.primitive < 0)
return "illegal primitive";
if (id.primitive <= SCTP_EVENT_PRIMITIVE_MAX) if (id.primitive <= SCTP_EVENT_PRIMITIVE_MAX)
return sctp_primitive_tbl[id.primitive]; return sctp_primitive_tbl[id.primitive];
return "unknown_primitive"; return "unknown_primitive";
...@@ -161,8 +157,6 @@ static const char *sctp_other_tbl[] = { ...@@ -161,8 +157,6 @@ static const char *sctp_other_tbl[] = {
/* Lookup "other" debug name. */ /* Lookup "other" debug name. */
const char *sctp_oname(const sctp_subtype_t id) const char *sctp_oname(const sctp_subtype_t id)
{ {
if (id.other < 0)
return "illegal 'other' event";
if (id.other <= SCTP_EVENT_OTHER_MAX) if (id.other <= SCTP_EVENT_OTHER_MAX)
return sctp_other_tbl[id.other]; return sctp_other_tbl[id.other];
return "unknown 'other' event"; return "unknown 'other' event";
...@@ -184,8 +178,6 @@ static const char *sctp_timer_tbl[] = { ...@@ -184,8 +178,6 @@ static const char *sctp_timer_tbl[] = {
/* Lookup timer debug name. */ /* Lookup timer debug name. */
const char *sctp_tname(const sctp_subtype_t id) const char *sctp_tname(const sctp_subtype_t id)
{ {
if (id.timeout < 0)
return "illegal 'timer' event";
if (id.timeout <= SCTP_EVENT_TIMEOUT_MAX) if (id.timeout <= SCTP_EVENT_TIMEOUT_MAX)
return sctp_timer_tbl[id.timeout]; return sctp_timer_tbl[id.timeout];
return "unknown_timer"; return "unknown_timer";
......
...@@ -960,7 +960,7 @@ static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t cid, ...@@ -960,7 +960,7 @@ static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t cid,
if (state > SCTP_STATE_MAX) if (state > SCTP_STATE_MAX)
return &bug; return &bug;
if (cid >= 0 && cid <= SCTP_CID_BASE_MAX) if (cid <= SCTP_CID_BASE_MAX)
return &chunk_event_table[cid][state]; return &chunk_event_table[cid][state];
if (sctp_prsctp_enable) { if (sctp_prsctp_enable) {
......
This diff is collapsed.
...@@ -454,7 +454,7 @@ static int wanrouter_device_setup(struct wan_device *wandev, ...@@ -454,7 +454,7 @@ static int wanrouter_device_setup(struct wan_device *wandev,
} }
if (conf->data_size && conf->data) { if (conf->data_size && conf->data) {
if (conf->data_size > 128000 || conf->data_size < 0) { if (conf->data_size > 128000) {
printk(KERN_INFO printk(KERN_INFO
"%s: ERROR, Invalid firmware data size %i !\n", "%s: ERROR, Invalid firmware data size %i !\n",
wandev->name, conf->data_size); wandev->name, conf->data_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment