Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218421
b: refs/heads/master
c: 43a951e
h: refs/heads/master
i:
  218419: 4500b42
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 25, 2010
1 parent 67dc133 commit 1dfc739
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0d7da9ddd9a4eb7808698d04b98bf9d62d02649b
refs/heads/master: 43a951e9994fd218ab4e641f94a2fc53556c3675
4 changes: 2 additions & 2 deletions trunk/include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct ipcm_cookie {
#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))

struct ip_ra_chain {
struct ip_ra_chain *next;
struct ip_ra_chain __rcu *next;
struct sock *sk;
union {
void (*destructor)(struct sock *);
Expand All @@ -68,7 +68,7 @@ struct ip_ra_chain {
struct rcu_head rcu;
};

extern struct ip_ra_chain *ip_ra_chain;
extern struct ip_ra_chain __rcu *ip_ra_chain;

/* IP flags. */
#define IP_CE 0x8000 /* Flag: "Congestion" */
Expand Down
10 changes: 7 additions & 3 deletions trunk/net/ipv4/ip_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc)
but receiver should be enough clever f.e. to forward mtrace requests,
sent to multicast group to reach destination designated router.
*/
struct ip_ra_chain *ip_ra_chain;
struct ip_ra_chain __rcu *ip_ra_chain;
static DEFINE_SPINLOCK(ip_ra_lock);


Expand All @@ -253,15 +253,19 @@ static void ip_ra_destroy_rcu(struct rcu_head *head)
int ip_ra_control(struct sock *sk, unsigned char on,
void (*destructor)(struct sock *))
{
struct ip_ra_chain *ra, *new_ra, **rap;
struct ip_ra_chain *ra, *new_ra;
struct ip_ra_chain __rcu **rap;

if (sk->sk_type != SOCK_RAW || inet_sk(sk)->inet_num == IPPROTO_RAW)
return -EINVAL;

new_ra = on ? kmalloc(sizeof(*new_ra), GFP_KERNEL) : NULL;

spin_lock_bh(&ip_ra_lock);
for (rap = &ip_ra_chain; (ra = *rap) != NULL; rap = &ra->next) {
for (rap = &ip_ra_chain;
(ra = rcu_dereference_protected(*rap,
lockdep_is_held(&ip_ra_lock))) != NULL;
rap = &ra->next) {
if (ra->sk == sk) {
if (on) {
spin_unlock_bh(&ip_ra_lock);
Expand Down

0 comments on commit 1dfc739

Please sign in to comment.