diff options
Diffstat (limited to 'drivers/net/wan/sdlamain.c')
-rw-r--r-- | drivers/net/wan/sdlamain.c | 23 |
1 files changed, 14 insertions, 9 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; | 1304 | out: |
1305 | rcu_read_unlock(); | ||
1306 | return addr; | ||
1302 | } | 1307 | } |
1303 | 1308 | ||
1304 | void add_gateway(sdla_t *card, struct net_device *dev) | 1309 | void add_gateway(sdla_t *card, struct net_device *dev) |