aboutsummaryrefslogtreecommitdiffstats
path: root/net/atm/resources.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/atm/resources.c')
-rw-r--r--net/atm/resources.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/net/atm/resources.c b/net/atm/resources.c
index a57a9268bd24..415d2615d475 100644
--- a/net/atm/resources.c
+++ b/net/atm/resources.c
@@ -40,6 +40,7 @@ static struct atm_dev *__alloc_atm_dev(const char *type)
40 dev->link_rate = ATM_OC3_PCR; 40 dev->link_rate = ATM_OC3_PCR;
41 spin_lock_init(&dev->lock); 41 spin_lock_init(&dev->lock);
42 INIT_LIST_HEAD(&dev->local); 42 INIT_LIST_HEAD(&dev->local);
43 INIT_LIST_HEAD(&dev->lecs);
43 44
44 return dev; 45 return dev;
45} 46}
@@ -320,10 +321,12 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
320 error = -EPERM; 321 error = -EPERM;
321 goto done; 322 goto done;
322 } 323 }
323 atm_reset_addr(dev); 324 atm_reset_addr(dev, ATM_ADDR_LOCAL);
324 break; 325 break;
325 case ATM_ADDADDR: 326 case ATM_ADDADDR:
326 case ATM_DELADDR: 327 case ATM_DELADDR:
328 case ATM_ADDLECSADDR:
329 case ATM_DELLECSADDR:
327 if (!capable(CAP_NET_ADMIN)) { 330 if (!capable(CAP_NET_ADMIN)) {
328 error = -EPERM; 331 error = -EPERM;
329 goto done; 332 goto done;
@@ -335,14 +338,21 @@ int atm_dev_ioctl(unsigned int cmd, void __user *arg)
335 error = -EFAULT; 338 error = -EFAULT;
336 goto done; 339 goto done;
337 } 340 }
338 if (cmd == ATM_ADDADDR) 341 if (cmd == ATM_ADDADDR || cmd == ATM_ADDLECSADDR)
339 error = atm_add_addr(dev, &addr); 342 error = atm_add_addr(dev, &addr,
343 (cmd == ATM_ADDADDR ?
344 ATM_ADDR_LOCAL : ATM_ADDR_LECS));
340 else 345 else
341 error = atm_del_addr(dev, &addr); 346 error = atm_del_addr(dev, &addr,
347 (cmd == ATM_DELADDR ?
348 ATM_ADDR_LOCAL : ATM_ADDR_LECS));
342 goto done; 349 goto done;
343 } 350 }
344 case ATM_GETADDR: 351 case ATM_GETADDR:
345 error = atm_get_addr(dev, buf, len); 352 case ATM_GETLECSADDR:
353 error = atm_get_addr(dev, buf, len,
354 (cmd == ATM_GETADDR ?
355 ATM_ADDR_LOCAL : ATM_ADDR_LECS));
346 if (error < 0) 356 if (error < 0)
347 goto done; 357 goto done;
348 size = error; 358 size = error;