Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Linus Torvalds committed Jun 4, 2007
2 parents 4acbab8 + 6e1d910 commit 45efebf
Show file tree
Hide file tree
Showing 21 changed files with 132 additions and 96 deletions.
15 changes: 11 additions & 4 deletions drivers/atm/firestream.c
Expand Up @@ -1475,6 +1475,7 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
struct FS_BPENTRY *qe, *ne;
struct sk_buff *skb;
int n = 0;
u32 qe_tmp;

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,
Expand Down Expand Up @@ -1502,10 +1503,16 @@ static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
ne->skb = skb;
ne->fp = fp;

qe = (struct FS_BPENTRY *) (read_fs (dev, FP_EA(fp->offset)));
fs_dprintk (FS_DEBUG_QUEUE, "link at %p\n", qe);
if (qe) {
qe = bus_to_virt ((long) qe);
/*
* FIXME: following code encodes and decodes
* machine pointers (could be 64-bit) into a
* 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->flags &= ~FP_FLAGS_EPI;
} else
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/tg3.c
Expand Up @@ -64,8 +64,8 @@

#define DRV_MODULE_NAME "tg3"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "3.76"
#define DRV_MODULE_RELDATE "May 5, 2007"
#define DRV_MODULE_VERSION "3.77"
#define DRV_MODULE_RELDATE "May 31, 2007"

#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
Expand Down Expand Up @@ -10961,6 +10961,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
* upon subsystem IDs.
*/
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_flags |= (TG3_FLAG_USE_MI_INTERRUPT |
TG3_FLAG_USE_LINKCHG_REG);
Expand Down
8 changes: 3 additions & 5 deletions include/net/af_unix.h
Expand Up @@ -62,13 +62,11 @@ struct unix_skb_parms {
#define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
#define UNIXSID(skb) (&UNIXCB((skb)).secid)

#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock)
#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock)
#define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock)
#define unix_state_wlock_nested(s) \
#define unix_state_lock(s) spin_lock(&unix_sk(s)->lock)
#define unix_state_unlock(s) spin_unlock(&unix_sk(s)->lock)
#define unix_state_lock_nested(s) \
spin_lock_nested(&unix_sk(s)->lock, \
SINGLE_DEPTH_NESTING)
#define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock)

#ifdef __KERNEL__
/* The AF_UNIX socket */
Expand Down
3 changes: 1 addition & 2 deletions net/8021q/vlan.c
Expand Up @@ -736,8 +736,7 @@ static int vlan_ioctl_handler(void __user *arg)
case SET_VLAN_NAME_TYPE_CMD:
if (!capable(CAP_NET_ADMIN))
return -EPERM;
if ((args.u.name_type >= 0) &&
(args.u.name_type < VLAN_NAME_TYPE_HIGHEST)) {
if (args.u.name_type < VLAN_NAME_TYPE_HIGHEST) {
vlan_name_type = args.u.name_type;
err = 0;
} else {
Expand Down
2 changes: 1 addition & 1 deletion net/core/sock.c
Expand Up @@ -998,7 +998,7 @@ void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
__sk_dst_set(sk, dst);
sk->sk_route_caps = dst->dev->features;
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 (dst->header_len)
sk->sk_route_caps &= ~NETIF_F_GSO_MASK;
Expand Down
2 changes: 1 addition & 1 deletion net/dccp/probe.c
Expand Up @@ -128,7 +128,7 @@ static ssize_t dccpprobe_read(struct file *file, char __user *buf,
int error = 0, cnt = 0;
unsigned char *tbuf;

if (!buf || len < 0)
if (!buf)
return -EINVAL;

if (len == 0)
Expand Down
6 changes: 5 additions & 1 deletion net/ipv4/datagram.c
Expand Up @@ -50,8 +50,12 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
RT_CONN_FLAGS(sk), oif,
sk->sk_protocol,
inet->sport, usin->sin_port, sk, 1);
if (err)
if (err) {
if (err == -ENETUNREACH)
IP_INC_STATS_BH(IPSTATS_MIB_OUTNOROUTES);
return err;
}

if ((rt->rt_flags & RTCF_BROADCAST) && !sock_flag(sk, SOCK_BROADCAST)) {
ip_rt_put(rt);
return -EACCES;
Expand Down
15 changes: 9 additions & 6 deletions net/ipv4/icmp.c
Expand Up @@ -514,12 +514,15 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)

saddr = iph->daddr;
if (!(rt->rt_flags & RTCF_LOCAL)) {
/* This is broken, skb_in->dev points to the outgoing device
* after the packet passes through ip_output().
*/
if (skb_in->dev && sysctl_icmp_errors_use_inbound_ifaddr)
saddr = inet_select_addr(skb_in->dev, 0, RT_SCOPE_LINK);
else
struct net_device *dev = NULL;

if (rt->fl.iif && sysctl_icmp_errors_use_inbound_ifaddr)
dev = dev_get_by_index(rt->fl.iif);

if (dev) {
saddr = inet_select_addr(dev, 0, RT_SCOPE_LINK);
dev_put(dev);
} else
saddr = 0;
}

Expand Down
4 changes: 1 addition & 3 deletions net/ipv4/inet_connection_sock.c
Expand Up @@ -31,10 +31,8 @@ EXPORT_SYMBOL(inet_csk_timer_bug_msg);

/*
* 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,
const struct inet_bind_bucket *tb)
Expand Down
3 changes: 0 additions & 3 deletions net/ipv4/tcp.c
Expand Up @@ -2464,13 +2464,10 @@ void __init tcp_init(void)
order++)
;
if (order >= 4) {
sysctl_local_port_range[0] = 32768;
sysctl_local_port_range[1] = 61000;
tcp_death_row.sysctl_max_tw_buckets = 180000;
sysctl_tcp_max_orphans = 4096 << (order - 4);
sysctl_max_syn_backlog = 1024;
} else if (order < 3) {
sysctl_local_port_range[0] = 1024 * (3 - order);
tcp_death_row.sysctl_max_tw_buckets >>= (3 - order);
sysctl_tcp_max_orphans >>= (3 - order);
sysctl_max_syn_backlog = 128;
Expand Down
4 changes: 2 additions & 2 deletions net/ipv4/tcp_input.c
Expand Up @@ -2407,8 +2407,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
struct sk_buff *skb;
__u32 now = tcp_time_stamp;
int acked = 0;
int prior_packets = tp->packets_out;
__s32 seq_rtt = -1;
u32 pkts_acked = 0;
ktime_t last_ackt = ktime_set(0,0);

while ((skb = tcp_write_queue_head(sk)) &&
Expand Down Expand Up @@ -2437,7 +2437,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
*/
if (!(scb->flags & TCPCB_FLAG_SYN)) {
acked |= FLAG_DATA_ACKED;
++pkts_acked;
} else {
acked |= FLAG_SYN_ACKED;
tp->retrans_stamp = 0;
Expand Down Expand Up @@ -2481,6 +2480,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p)
}

if (acked&FLAG_ACKED) {
u32 pkts_acked = prior_packets - tp->packets_out;
const struct tcp_congestion_ops *ca_ops
= inet_csk(sk)->icsk_ca_ops;

Expand Down
5 changes: 4 additions & 1 deletion net/ipv4/tcp_ipv4.c
Expand Up @@ -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,
IPPROTO_TCP,
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;
}

if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) {
ip_rt_put(rt);
Expand Down
5 changes: 4 additions & 1 deletion net/ipv4/udp.c
Expand Up @@ -722,8 +722,11 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
.dport = dport } } };
security_sk_classify_flow(sk, &fl);
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;
}

err = -EACCES;
if ((rt->rt_flags & RTCF_BROADCAST) &&
Expand Down
3 changes: 1 addition & 2 deletions net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
Expand Up @@ -177,8 +177,7 @@ static unsigned int ipv6_confirm(unsigned int hooknum,

protoff = nf_ct_ipv6_skip_exthdr(*pskb, extoff, &pnum,
(*pskb)->len - extoff);
if (protoff < 0 || protoff > (*pskb)->len ||
pnum == NEXTHDR_FRAGMENT) {
if (protoff > (*pskb)->len || pnum == NEXTHDR_FRAGMENT) {
DEBUGP("proto header not found\n");
return NF_ACCEPT;
}
Expand Down
3 changes: 1 addition & 2 deletions net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
Expand Up @@ -168,8 +168,7 @@ icmpv6_error_message(struct sk_buff *skb,
skb->len - inip6off
- sizeof(struct ipv6hdr));

if ((inprotoff < 0) || (inprotoff > skb->len) ||
(inprotonum == NEXTHDR_FRAGMENT)) {
if ((inprotoff > skb->len) || (inprotonum == NEXTHDR_FRAGMENT)) {
DEBUGP("icmpv6_error: Can't get protocol header in ICMPv6 payload.\n");
return -NF_ACCEPT;
}
Expand Down
3 changes: 1 addition & 2 deletions net/sched/act_pedit.c
Expand Up @@ -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");
goto bad;
}
if (skb->len < 0 ||
(offset > 0 && offset > skb->len)) {
if (offset > 0 && offset > skb->len) {
printk("offset %d cant exceed pkt length %d\n",
offset, skb->len);
goto bad;
Expand Down
3 changes: 2 additions & 1 deletion net/sched/sch_generic.c
Expand Up @@ -224,7 +224,8 @@ void __netdev_watchdog_up(struct net_device *dev)
if (dev->tx_timeout) {
if (dev->watchdog_timeo <= 0)
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);
}
}
Expand Down
8 changes: 0 additions & 8 deletions net/sctp/debug.c
Expand Up @@ -77,8 +77,6 @@ static const char *sctp_cid_tbl[SCTP_NUM_BASE_CHUNK_TYPES] = {
/* Lookup "chunk type" debug name. */
const char *sctp_cname(const sctp_subtype_t cid)
{
if (cid.chunk < 0)
return "illegal chunk id";
if (cid.chunk <= SCTP_CID_BASE_MAX)
return sctp_cid_tbl[cid.chunk];

Expand Down Expand Up @@ -146,8 +144,6 @@ static const char *sctp_primitive_tbl[SCTP_NUM_PRIMITIVE_TYPES] = {
/* Lookup primitive debug name. */
const char *sctp_pname(const sctp_subtype_t id)
{
if (id.primitive < 0)
return "illegal primitive";
if (id.primitive <= SCTP_EVENT_PRIMITIVE_MAX)
return sctp_primitive_tbl[id.primitive];
return "unknown_primitive";
Expand All @@ -161,8 +157,6 @@ static const char *sctp_other_tbl[] = {
/* Lookup "other" debug name. */
const char *sctp_oname(const sctp_subtype_t id)
{
if (id.other < 0)
return "illegal 'other' event";
if (id.other <= SCTP_EVENT_OTHER_MAX)
return sctp_other_tbl[id.other];
return "unknown 'other' event";
Expand All @@ -184,8 +178,6 @@ static const char *sctp_timer_tbl[] = {
/* Lookup timer debug name. */
const char *sctp_tname(const sctp_subtype_t id)
{
if (id.timeout < 0)
return "illegal 'timer' event";
if (id.timeout <= SCTP_EVENT_TIMEOUT_MAX)
return sctp_timer_tbl[id.timeout];
return "unknown_timer";
Expand Down
2 changes: 1 addition & 1 deletion net/sctp/sm_statetable.c
Expand Up @@ -960,7 +960,7 @@ static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t cid,
if (state > SCTP_STATE_MAX)
return &bug;

if (cid >= 0 && cid <= SCTP_CID_BASE_MAX)
if (cid <= SCTP_CID_BASE_MAX)
return &chunk_event_table[cid][state];

if (sctp_prsctp_enable) {
Expand Down

0 comments on commit 45efebf

Please sign in to comment.