aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-03 22:06:19 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-03 22:06:19 -0400
commit3c8c7b2f32c52b259daa7564fefd582146799b23 (patch)
tree59ff1ad0d6b7821d474d8fccafd884703684b6d7 /drivers/net/wan
parent7cb3cd090c2725b80561958a362c2ba15a7a8c86 (diff)
parent9123e0d78990246304fe681167b8d8097f1e02d7 (diff)
Merge branch 'upstream-fixes'
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/sdlamain.c23
-rw-r--r--drivers/net/wan/syncppp.c2
2 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/wan/sdlamain.c b/drivers/net/wan/sdlamain.c
index 74e151acef3e..7a8b22a7ea31 100644
--- a/drivers/net/wan/sdlamain.c
+++ b/drivers/net/wan/sdlamain.c
@@ -57,6 +57,7 @@
57#include <linux/ioport.h> /* request_region(), release_region() */ 57#include <linux/ioport.h> /* request_region(), release_region() */
58#include <linux/wanrouter.h> /* WAN router definitions */ 58#include <linux/wanrouter.h> /* WAN router definitions */
59#include <linux/wanpipe.h> /* WANPIPE common user API definitions */ 59#include <linux/wanpipe.h> /* WANPIPE common user API definitions */
60#include <linux/rcupdate.h>
60 61
61#include <linux/in.h> 62#include <linux/in.h>
62#include <asm/io.h> /* phys_to_virt() */ 63#include <asm/io.h> /* phys_to_virt() */
@@ -1268,37 +1269,41 @@ unsigned long get_ip_address(struct net_device *dev, int option)
1268 1269
1269 struct in_ifaddr *ifaddr; 1270 struct in_ifaddr *ifaddr;
1270 struct in_device *in_dev; 1271 struct in_device *in_dev;
1272 unsigned long addr = 0;
1271 1273
1272 if ((in_dev = __in_dev_get(dev)) == NULL){ 1274 rcu_read_lock();
1273 return 0; 1275 if ((in_dev = __in_dev_get_rcu(dev)) == NULL){
1276 goto out;
1274 } 1277 }
1275 1278
1276 if ((ifaddr = in_dev->ifa_list)== NULL ){ 1279 if ((ifaddr = in_dev->ifa_list)== NULL ){
1277 return 0; 1280 goto out;
1278 } 1281 }
1279 1282
1280 switch (option){ 1283 switch (option){
1281 1284
1282 case WAN_LOCAL_IP: 1285 case WAN_LOCAL_IP:
1283 return ifaddr->ifa_local; 1286 addr = ifaddr->ifa_local;
1284 break; 1287 break;
1285 1288
1286 case WAN_POINTOPOINT_IP: 1289 case WAN_POINTOPOINT_IP:
1287 return ifaddr->ifa_address; 1290 addr = ifaddr->ifa_address;
1288 break; 1291 break;
1289 1292
1290 case WAN_NETMASK_IP: 1293 case WAN_NETMASK_IP:
1291 return ifaddr->ifa_mask; 1294 addr = ifaddr->ifa_mask;
1292 break; 1295 break;
1293 1296
1294 case WAN_BROADCAST_IP: 1297 case WAN_BROADCAST_IP:
1295 return ifaddr->ifa_broadcast; 1298 addr = ifaddr->ifa_broadcast;
1296 break; 1299 break;
1297 default: 1300 default:
1298 return 0; 1301 break;
1299 } 1302 }
1300 1303
1301 return 0; 1304out:
1305 rcu_read_unlock();
1306 return addr;
1302} 1307}
1303 1308
1304void add_gateway(sdla_t *card, struct net_device *dev) 1309void add_gateway(sdla_t *card, struct net_device *dev)
diff --git a/drivers/net/wan/syncppp.c b/drivers/net/wan/syncppp.c
index 3731b22f6757..2d1bba06a085 100644
--- a/drivers/net/wan/syncppp.c
+++ b/drivers/net/wan/syncppp.c
@@ -767,7 +767,7 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb)
767 u32 addr = 0, mask = ~0; /* FIXME: is the mask correct? */ 767 u32 addr = 0, mask = ~0; /* FIXME: is the mask correct? */
768#ifdef CONFIG_INET 768#ifdef CONFIG_INET
769 rcu_read_lock(); 769 rcu_read_lock();
770 if ((in_dev = __in_dev_get(dev)) != NULL) 770 if ((in_dev = __in_dev_get_rcu(dev)) != NULL)
771 { 771 {
772 for (ifa=in_dev->ifa_list; ifa != NULL; 772 for (ifa=in_dev->ifa_list; ifa != NULL;
773 ifa=ifa->ifa_next) { 773 ifa=ifa->ifa_next) {