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