Commit d50485cb authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/net-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 8c736c01 18e71a89
......@@ -1039,6 +1039,7 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long
#ifdef TCP_DEBUG
printk(tcp_timer_bug_msg);
#endif
return;
};
}
......
......@@ -180,8 +180,7 @@ struct sock *ax25_get_socket(ax25_address *my_addr, ax25_address *dest_addr,
!ax25cmp(&s->dest_addr, dest_addr) &&
s->sk->sk_type == type) {
sk = s->sk;
/* XXX Sleeps with spinlock held, use refcounts instead. XXX */
lock_sock(sk);
sock_hold(sk);
break;
}
}
......
......@@ -275,6 +275,7 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
/* Now find a suitable dgram socket */
sk = ax25_get_socket(&dest, &src, SOCK_DGRAM);
if (sk != NULL) {
bh_lock_sock(sk);
if (atomic_read(&sk->sk_rmem_alloc) >=
sk->sk_rcvbuf) {
kfree_skb(skb);
......@@ -286,7 +287,8 @@ static int ax25_rcv(struct sk_buff *skb, struct net_device *dev,
if (sock_queue_rcv_skb(sk, skb) != 0)
kfree_skb(skb);
}
release_sock(sk);
bh_unlock_sock(sk);
sock_put(sk);
} else {
kfree_skb(skb);
}
......
......@@ -337,6 +337,10 @@ void br_fdb_update(struct net_bridge *br, struct net_bridge_port *source,
struct hlist_head *head = &br->hash[br_mac_hash(addr)];
struct net_bridge_fdb_entry *fdb;
/* some users want to always flood. */
if (hold_time(br) == 0)
return;
rcu_read_lock();
fdb = fdb_find(head, addr);
if (likely(fdb)) {
......
......@@ -179,9 +179,10 @@ unsigned int ebt_do_table (unsigned int hook, struct sk_buff **pskb,
struct ebt_chainstack *cs;
struct ebt_entries *chaininfo;
char *base;
struct ebt_table_info *private = table->private;
struct ebt_table_info *private;
read_lock_bh(&table->lock);
private = table->private;
cb_base = COUNTER_BASE(private->counters, private->nentries,
smp_processor_id());
if (private->chainstack)
......
......@@ -151,7 +151,7 @@
#include <asm/timex.h>
#define VERSION "pktgen v2.59: Packet Generator for packet performance testing.\n"
#define VERSION "pktgen v2.60: Packet Generator for packet performance testing.\n"
/* #define PG_DEBUG(a) a */
#define PG_DEBUG(a)
......@@ -1419,7 +1419,6 @@ static int proc_thread_write(struct file *file, const char __user *user_buffer,
if (debug)
printk("pktgen: t=%s, count=%lu\n", name, count);
thread_lock();
t = (struct pktgen_thread*)(data);
if(!t) {
......@@ -1441,14 +1440,18 @@ static int proc_thread_write(struct file *file, const char __user *user_buffer,
if( copy_from_user(f, &user_buffer[i], len) )
return -EFAULT;
i += len;
thread_lock();
pktgen_add_device(t, f);
thread_unlock();
ret = count;
sprintf(pg_result, "OK: add_device=%s", f);
goto out;
}
if (!strcmp(name, "rem_device_all")) {
thread_lock();
t->control |= T_REMDEV;
thread_unlock();
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(HZ/8); /* Propagate thread->control */
ret = count;
......@@ -1456,10 +1459,11 @@ static int proc_thread_write(struct file *file, const char __user *user_buffer,
goto out;
}
if (!strcmp(name, "max_before_softirq")) {
len = num_arg(&user_buffer[i], 10, &value);
thread_lock();
t->max_before_softirq = value;
thread_unlock();
ret = count;
sprintf(pg_result, "OK: max_before_softirq=%lu", value);
goto out;
......@@ -1467,7 +1471,6 @@ static int proc_thread_write(struct file *file, const char __user *user_buffer,
ret = -EINVAL;
out:
thread_unlock();
return ret;
}
......
......@@ -560,7 +560,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info)
/* RFC says return as much as we can without exceeding 576 bytes. */
room = dst_pmtu(&rt->u.dst);
room = dst_mtu(&rt->u.dst);
if (room > 576)
room = 576;
room -= sizeof(struct iphdr) + icmp_param.replyopts.optlen;
......
......@@ -37,6 +37,7 @@
#include <linux/netfilter_ipv4/ip_tables.h>
#include <linux/netfilter_ipv4/ipt_hashlimit.h>
#include <linux/netfilter_ipv4/lockhelp.h>
/* FIXME: this is just for IP_NF_ASSERRT */
#include <linux/netfilter_ipv4/ip_conntrack.h>
......@@ -109,7 +110,7 @@ static inline int dst_cmp(const struct dsthash_ent *ent, struct dsthash_dst *b)
static inline u_int32_t
hash_dst(const struct ipt_hashlimit_htable *ht, const struct dsthash_dst *dst)
{
return (jhash_3words(dst->dst_ip, (dst->dst_port<<16 & dst->src_port),
return (jhash_3words(dst->dst_ip, (dst->dst_port<<16 | dst->src_port),
dst->src_ip, ht->rnd) % ht->cfg.size);
}
......
......@@ -78,7 +78,7 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
IPCB(skb)->flags |= IPSKB_XFRM_TUNNEL_SIZE;
if (!(iph->frag_off & htons(IP_DF)))
if (!(iph->frag_off & htons(IP_DF)) || skb->local_df)
goto out;
dst = skb->dst;
......@@ -103,17 +103,17 @@ int xfrm4_output(struct sk_buff *skb)
goto error_nolock;
}
spin_lock_bh(&x->lock);
err = xfrm_state_check(x, skb);
if (err)
goto error;
if (x->props.mode) {
err = xfrm4_tunnel_check_size(skb);
if (err)
goto error;
goto error_nolock;
}
spin_lock_bh(&x->lock);
err = xfrm_state_check(x, skb);
if (err)
goto error;
xfrm4_encap(skb);
err = x->type->output(x, skb);
......
......@@ -2923,12 +2923,8 @@ static int inet6_fill_ifinfo(struct sk_buff *skb, struct inet6_dev *idev,
r->ifi_family = AF_INET6;
r->ifi_type = dev->type;
r->ifi_index = dev->ifindex;
r->ifi_flags = dev->flags;
r->ifi_flags = dev_get_flags(dev);
r->ifi_change = 0;
if (!netif_running(dev) || !netif_carrier_ok(dev))
r->ifi_flags &= ~IFF_RUNNING;
else
r->ifi_flags |= IFF_RUNNING;
RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name);
......
......@@ -397,6 +397,7 @@ int ip6_forward(struct sk_buff *skb)
IP6_INC_STATS(IPSTATS_MIB_INDISCARDS);
goto drop;
}
dst = skb->dst;
/* IPv6 specs say nothing about it, but it is clear that we cannot
send redirects to source routed frames.
......
......@@ -103,17 +103,17 @@ int xfrm6_output(struct sk_buff *skb)
goto error_nolock;
}
spin_lock_bh(&x->lock);
err = xfrm_state_check(x, skb);
if (err)
goto error;
if (x->props.mode) {
err = xfrm6_tunnel_check_size(skb);
if (err)
goto error;
goto error_nolock;
}
spin_lock_bh(&x->lock);
err = xfrm_state_check(x, skb);
if (err)
goto error;
xfrm6_encap(skb);
err = x->type->output(x, skb);
......
......@@ -430,7 +430,6 @@ static int netlink_autobind(struct socket *sock)
err = netlink_insert(sk, pid);
if (err == -EADDRINUSE)
goto retry;
nlk_sk(sk)->groups = 0;
return 0;
}
......
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