aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/tipc/config.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c
index bc512102eebd..322367b2618f 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -38,15 +38,9 @@
38#include "port.h" 38#include "port.h"
39#include "link.h" 39#include "link.h"
40#include "name_table.h" 40#include "name_table.h"
41#include "user_reg.h"
42#include "config.h" 41#include "config.h"
43 42
44struct manager { 43static u32 config_port_ref;
45 u32 user_ref;
46 u32 port_ref;
47};
48
49static struct manager mng = { 0};
50 44
51static DEFINE_SPINLOCK(config_lock); 45static DEFINE_SPINLOCK(config_lock);
52 46
@@ -506,20 +500,16 @@ int tipc_cfg_init(void)
506 struct tipc_name_seq seq; 500 struct tipc_name_seq seq;
507 int res; 501 int res;
508 502
509 res = tipc_attach(&mng.user_ref); 503 res = tipc_createport(0, NULL, TIPC_CRITICAL_IMPORTANCE,
510 if (res)
511 goto failed;
512
513 res = tipc_createport(mng.user_ref, NULL, TIPC_CRITICAL_IMPORTANCE,
514 NULL, NULL, NULL, 504 NULL, NULL, NULL,
515 NULL, cfg_named_msg_event, NULL, 505 NULL, cfg_named_msg_event, NULL,
516 NULL, &mng.port_ref); 506 NULL, &config_port_ref);
517 if (res) 507 if (res)
518 goto failed; 508 goto failed;
519 509
520 seq.type = TIPC_CFG_SRV; 510 seq.type = TIPC_CFG_SRV;
521 seq.lower = seq.upper = tipc_own_addr; 511 seq.lower = seq.upper = tipc_own_addr;
522 res = tipc_nametbl_publish_rsv(mng.port_ref, TIPC_ZONE_SCOPE, &seq); 512 res = tipc_nametbl_publish_rsv(config_port_ref, TIPC_ZONE_SCOPE, &seq);
523 if (res) 513 if (res)
524 goto failed; 514 goto failed;
525 515
@@ -527,15 +517,13 @@ int tipc_cfg_init(void)
527 517
528failed: 518failed:
529 err("Unable to create configuration service\n"); 519 err("Unable to create configuration service\n");
530 tipc_detach(mng.user_ref);
531 mng.user_ref = 0;
532 return res; 520 return res;
533} 521}
534 522
535void tipc_cfg_stop(void) 523void tipc_cfg_stop(void)
536{ 524{
537 if (mng.user_ref) { 525 if (config_port_ref) {
538 tipc_detach(mng.user_ref); 526 tipc_deleteport(config_port_ref);
539 mng.user_ref = 0; 527 config_port_ref = 0;
540 } 528 }
541} 529}