diff options
author | artem <none@none> | 2008-06-19 14:31:31 -0700 |
---|---|---|
committer | artem <none@none> | 2008-06-19 14:31:31 -0700 |
commit | 308903890e892f9c21ee582e3a52fdd67e52870b (patch) | |
tree | 732f36a3e4382b987a7d27c152d718a839ab8e69 /usr/src/cmd/dlmgmtd | |
parent | d81b850f296ee36f8a9ecba637e8c8e2996eaaee (diff) | |
download | illumos-gate-308903890e892f9c21ee582e3a52fdd67e52870b.tar.gz |
PSARC/2008/222 Brussels persistence
6485961 link property values do not persist across unplumb/unload
Diffstat (limited to 'usr/src/cmd/dlmgmtd')
-rw-r--r-- | usr/src/cmd/dlmgmtd/dlmgmt_door.c | 33 | ||||
-rw-r--r-- | usr/src/cmd/dlmgmtd/dlmgmt_main.c | 2 |
2 files changed, 33 insertions, 2 deletions
diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_door.c b/usr/src/cmd/dlmgmtd/dlmgmt_door.c index 1481d0dfa3..50892004a9 100644 --- a/usr/src/cmd/dlmgmtd/dlmgmt_door.c +++ b/usr/src/cmd/dlmgmtd/dlmgmt_door.c @@ -873,6 +873,33 @@ done: dlmgmt_dlconf_table_unlock(); } +static void +dlmgmt_upcall_linkprop_init(void *argp, void *retp) +{ + dlmgmt_door_linkprop_init_t *lip = argp; + dlmgmt_linkprop_init_retval_t *retvalp = retp; + dlmgmt_link_t *linkp; + boolean_t do_linkprop = B_FALSE; + + /* + * Ignore wifi links until wifi property ioctls are converted + * to generic property ioctls. This avoids deadlocks due to + * wifi property ioctls using their own /dev/net device, + * not the DLD control device. + */ + dlmgmt_table_lock(B_FALSE); + if ((linkp = link_by_id(lip->ld_linkid)) == NULL) + retvalp->lr_err = ENOENT; + else if (linkp->ll_media == DL_WIFI) + retvalp->lr_err = 0; + else + do_linkprop = B_TRUE; + dlmgmt_table_unlock(); + + if (do_linkprop) + retvalp->lr_err = dladm_init_linkprop(lip->ld_linkid, B_TRUE); +} + static dlmgmt_door_info_t i_dlmgmt_door_info_tbl[] = { { DLMGMT_CMD_DLS_CREATE, B_TRUE, sizeof (dlmgmt_upcall_arg_create_t), sizeof (dlmgmt_create_retval_t), dlmgmt_upcall_create }, @@ -911,7 +938,11 @@ static dlmgmt_door_info_t i_dlmgmt_door_info_tbl[] = { { DLMGMT_CMD_DESTROYCONF, B_TRUE, sizeof (dlmgmt_door_destroyconf_t), sizeof (dlmgmt_destroyconf_retval_t), dlmgmt_destroyconf }, { DLMGMT_CMD_GETATTR, B_FALSE, sizeof (dlmgmt_door_getattr_t), - sizeof (dlmgmt_getattr_retval_t), dlmgmt_getattr } + sizeof (dlmgmt_getattr_retval_t), dlmgmt_getattr }, + { DLMGMT_CMD_LINKPROP_INIT, B_TRUE, + sizeof (dlmgmt_door_linkprop_init_t), + sizeof (dlmgmt_linkprop_init_retval_t), + dlmgmt_upcall_linkprop_init } }; #define DLMGMT_INFO_TABLE_SIZE (sizeof (i_dlmgmt_door_info_tbl) / \ diff --git a/usr/src/cmd/dlmgmtd/dlmgmt_main.c b/usr/src/cmd/dlmgmtd/dlmgmt_main.c index 8915b544ec..43e627d4f0 100644 --- a/usr/src/cmd/dlmgmtd/dlmgmt_main.c +++ b/usr/src/cmd/dlmgmtd/dlmgmt_main.c @@ -252,7 +252,7 @@ dlmgmt_init_privileges() return (errno); if (__init_daemon_priv(PU_RESETGROUPS|PU_CLEARLIMITSET, UID_DLADM, - GID_SYS, NULL) == -1) { + GID_SYS, PRIV_SYS_NET_CONFIG, NULL) == -1) { (void) close(dld_control_fd); dld_control_fd = -1; return (EPERM); |