diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2011-07-25 13:59:46 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-25 14:53:52 -0400 |
commit | 5f00bcb38ef9a980a33c6dbdc0044964b05f22dd (patch) | |
tree | 3175fb9375aecb50bde1be0bf4fa8aa8155131d6 /net/decnet/dn_dev.c | |
parent | 34006cee28f7344f9557a4be3816c7891b1bbab1 (diff) | |
parent | b6844e8f64920cdee620157252169ba63afb0c89 (diff) |
Merge branch 'master' into devel and apply fixup from Stephen Rothwell:
vfs/nfs: fixup for nfs_open_context change
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/decnet/dn_dev.c')
-rw-r--r-- | net/decnet/dn_dev.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c index cf26ac74a18..ba4faceec40 100644 --- a/net/decnet/dn_dev.c +++ b/net/decnet/dn_dev.c | |||
@@ -437,17 +437,17 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg) | |||
437 | 437 | ||
438 | dev_load(&init_net, ifr->ifr_name); | 438 | dev_load(&init_net, ifr->ifr_name); |
439 | 439 | ||
440 | switch(cmd) { | 440 | switch (cmd) { |
441 | case SIOCGIFADDR: | 441 | case SIOCGIFADDR: |
442 | break; | 442 | break; |
443 | case SIOCSIFADDR: | 443 | case SIOCSIFADDR: |
444 | if (!capable(CAP_NET_ADMIN)) | 444 | if (!capable(CAP_NET_ADMIN)) |
445 | return -EACCES; | 445 | return -EACCES; |
446 | if (sdn->sdn_family != AF_DECnet) | 446 | if (sdn->sdn_family != AF_DECnet) |
447 | return -EINVAL; | ||
448 | break; | ||
449 | default: | ||
450 | return -EINVAL; | 447 | return -EINVAL; |
448 | break; | ||
449 | default: | ||
450 | return -EINVAL; | ||
451 | } | 451 | } |
452 | 452 | ||
453 | rtnl_lock(); | 453 | rtnl_lock(); |
@@ -470,27 +470,27 @@ int dn_dev_ioctl(unsigned int cmd, void __user *arg) | |||
470 | goto done; | 470 | goto done; |
471 | } | 471 | } |
472 | 472 | ||
473 | switch(cmd) { | 473 | switch (cmd) { |
474 | case SIOCGIFADDR: | 474 | case SIOCGIFADDR: |
475 | *((__le16 *)sdn->sdn_nodeaddr) = ifa->ifa_local; | 475 | *((__le16 *)sdn->sdn_nodeaddr) = ifa->ifa_local; |
476 | goto rarok; | 476 | goto rarok; |
477 | 477 | ||
478 | case SIOCSIFADDR: | 478 | case SIOCSIFADDR: |
479 | if (!ifa) { | 479 | if (!ifa) { |
480 | if ((ifa = dn_dev_alloc_ifa()) == NULL) { | 480 | if ((ifa = dn_dev_alloc_ifa()) == NULL) { |
481 | ret = -ENOBUFS; | 481 | ret = -ENOBUFS; |
482 | break; | 482 | break; |
483 | } | ||
484 | memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); | ||
485 | } else { | ||
486 | if (ifa->ifa_local == dn_saddr2dn(sdn)) | ||
487 | break; | ||
488 | dn_dev_del_ifa(dn_db, ifap, 0); | ||
489 | } | 483 | } |
484 | memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); | ||
485 | } else { | ||
486 | if (ifa->ifa_local == dn_saddr2dn(sdn)) | ||
487 | break; | ||
488 | dn_dev_del_ifa(dn_db, ifap, 0); | ||
489 | } | ||
490 | 490 | ||
491 | ifa->ifa_local = ifa->ifa_address = dn_saddr2dn(sdn); | 491 | ifa->ifa_local = ifa->ifa_address = dn_saddr2dn(sdn); |
492 | 492 | ||
493 | ret = dn_dev_set_ifa(dev, ifa); | 493 | ret = dn_dev_set_ifa(dev, ifa); |
494 | } | 494 | } |
495 | done: | 495 | done: |
496 | rtnl_unlock(); | 496 | rtnl_unlock(); |
@@ -1313,7 +1313,7 @@ static void *dn_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
1313 | 1313 | ||
1314 | ++*pos; | 1314 | ++*pos; |
1315 | 1315 | ||
1316 | dev = (struct net_device *)v; | 1316 | dev = v; |
1317 | if (v == SEQ_START_TOKEN) | 1317 | if (v == SEQ_START_TOKEN) |
1318 | dev = net_device_entry(&init_net.dev_base_head); | 1318 | dev = net_device_entry(&init_net.dev_base_head); |
1319 | 1319 | ||
@@ -1335,13 +1335,13 @@ static void dn_dev_seq_stop(struct seq_file *seq, void *v) | |||
1335 | 1335 | ||
1336 | static char *dn_type2asc(char type) | 1336 | static char *dn_type2asc(char type) |
1337 | { | 1337 | { |
1338 | switch(type) { | 1338 | switch (type) { |
1339 | case DN_DEV_BCAST: | 1339 | case DN_DEV_BCAST: |
1340 | return "B"; | 1340 | return "B"; |
1341 | case DN_DEV_UCAST: | 1341 | case DN_DEV_UCAST: |
1342 | return "U"; | 1342 | return "U"; |
1343 | case DN_DEV_MPOINT: | 1343 | case DN_DEV_MPOINT: |
1344 | return "M"; | 1344 | return "M"; |
1345 | } | 1345 | } |
1346 | 1346 | ||
1347 | return "?"; | 1347 | return "?"; |
@@ -1414,9 +1414,9 @@ void __init dn_dev_init(void) | |||
1414 | 1414 | ||
1415 | dn_dev_devices_on(); | 1415 | dn_dev_devices_on(); |
1416 | 1416 | ||
1417 | rtnl_register(PF_DECnet, RTM_NEWADDR, dn_nl_newaddr, NULL); | 1417 | rtnl_register(PF_DECnet, RTM_NEWADDR, dn_nl_newaddr, NULL, NULL); |
1418 | rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL); | 1418 | rtnl_register(PF_DECnet, RTM_DELADDR, dn_nl_deladdr, NULL, NULL); |
1419 | rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr); | 1419 | rtnl_register(PF_DECnet, RTM_GETADDR, NULL, dn_nl_dump_ifaddr, NULL); |
1420 | 1420 | ||
1421 | proc_net_fops_create(&init_net, "decnet_dev", S_IRUGO, &dn_dev_seq_fops); | 1421 | proc_net_fops_create(&init_net, "decnet_dev", S_IRUGO, &dn_dev_seq_fops); |
1422 | 1422 | ||