Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224114
b: refs/heads/master
c: fc766e4
h: refs/heads/master
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 8, 2010
1 parent 9b35644 commit ec14dc8
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 89 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: e4a7b93bd5d84e1e79917d024d17d745d190fc9a
refs/heads/master: fc766e4c4965915ab52a1d1fa3c7a7b3e7bc07f0
2 changes: 1 addition & 1 deletion trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ struct net_device {
#endif
void *atalk_ptr; /* AppleTalk link */
struct in_device __rcu *ip_ptr; /* IPv4 specific data */
void *dn_ptr; /* DECnet specific data */
struct dn_dev __rcu *dn_ptr; /* DECnet specific data */
struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */
void *ec_ptr; /* Econet specific data */
void *ax25_ptr; /* AX.25 specific data */
Expand Down
27 changes: 18 additions & 9 deletions trunk/include/net/dn_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
struct dn_dev;

struct dn_ifaddr {
struct dn_ifaddr *ifa_next;
struct dn_ifaddr __rcu *ifa_next;
struct dn_dev *ifa_dev;
__le16 ifa_local;
__le16 ifa_address;
__u8 ifa_flags;
__u8 ifa_scope;
char ifa_label[IFNAMSIZ];
struct rcu_head rcu;
};

#define DN_DEV_S_RU 0 /* Run - working normally */
Expand Down Expand Up @@ -83,7 +84,7 @@ struct dn_dev_parms {


struct dn_dev {
struct dn_ifaddr *ifa_list;
struct dn_ifaddr __rcu *ifa_list;
struct net_device *dev;
struct dn_dev_parms parms;
char use_long;
Expand Down Expand Up @@ -171,19 +172,27 @@ extern int unregister_dnaddr_notifier(struct notifier_block *nb);

static inline int dn_dev_islocal(struct net_device *dev, __le16 addr)
{
struct dn_dev *dn_db = dev->dn_ptr;
struct dn_dev *dn_db;
struct dn_ifaddr *ifa;
int res = 0;

rcu_read_lock();
dn_db = rcu_dereference(dev->dn_ptr);
if (dn_db == NULL) {
printk(KERN_DEBUG "dn_dev_islocal: Called for non DECnet device\n");
return 0;
goto out;
}

for(ifa = dn_db->ifa_list; ifa; ifa = ifa->ifa_next)
if ((addr ^ ifa->ifa_local) == 0)
return 1;

return 0;
for (ifa = rcu_dereference(dn_db->ifa_list);
ifa != NULL;
ifa = rcu_dereference(ifa->ifa_next))
if ((addr ^ ifa->ifa_local) == 0) {
res = 1;
break;
}
out:
rcu_read_unlock();
return res;
}

#endif /* _NET_DN_DEV_H */
8 changes: 4 additions & 4 deletions trunk/include/net/dst.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ struct dst_entry {
int __use;
unsigned long lastuse;
union {
struct dst_entry *next;
struct rtable __rcu *rt_next;
struct rt6_info *rt6_next;
struct dn_route *dn_next;
struct dst_entry *next;
struct rtable __rcu *rt_next;
struct rt6_info *rt6_next;
struct dn_route __rcu *dn_next;
};
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/net/decnet/af_decnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1848,7 +1848,7 @@ unsigned dn_mss_from_pmtu(struct net_device *dev, int mtu)
{
unsigned mss = 230 - DN_MAX_NSP_DATA_HEADER;
if (dev) {
struct dn_dev *dn_db = dev->dn_ptr;
struct dn_dev *dn_db = rcu_dereference_raw(dev->dn_ptr);
mtu -= LL_RESERVED_SPACE(dev);
if (dn_db->use_long)
mtu -= 21;
Expand Down
Loading

0 comments on commit ec14dc8

Please sign in to comment.