Print this page
OS-478 -- lint
OS-406
OS-327

*** 3122,3173 **** "protection", NULL, 0, DLADM_OPT_ACTIVE); if (dlstatus == DLADM_STATUS_NOTFOUND) { /* datalink does not belong to the GZ */ continue; } ! if (dlstatus != DLADM_STATUS_OK) { zerror(zlogp, B_FALSE, dladm_status2str(dlstatus, dlerr)); ! free(dllinks); ! return (-1); ! } dlstatus = dladm_set_linkprop(dld_handle, *dllink, "allowed-ips", NULL, 0, DLADM_OPT_ACTIVE); ! if (dlstatus != DLADM_STATUS_OK) { zerror(zlogp, B_FALSE, dladm_status2str(dlstatus, dlerr)); - free(dllinks); - return (-1); } - } free(dllinks); return (0); } static int - unconfigure_exclusive_network_interfaces(zlog_t *zlogp, zoneid_t zoneid) - { - int dlnum = 0; - - /* - * The kernel shutdown callback for the dls module should have removed - * all datalinks from this zone. If any remain, then there's a - * problem. - */ - if (zone_list_datalink(zoneid, &dlnum, NULL) != 0) { - zerror(zlogp, B_TRUE, "unable to list network interfaces"); - return (-1); - } - if (dlnum != 0) { - zerror(zlogp, B_FALSE, - "datalinks remain in zone after shutdown"); - return (-1); - } - return (0); - } - - static int tcp_abort_conn(zlog_t *zlogp, zoneid_t zoneid, const struct sockaddr_storage *local, const struct sockaddr_storage *remote) { int fd; struct strioctl ioc; --- 3122,3148 ---- "protection", NULL, 0, DLADM_OPT_ACTIVE); if (dlstatus == DLADM_STATUS_NOTFOUND) { /* datalink does not belong to the GZ */ continue; } ! if (dlstatus != DLADM_STATUS_OK) zerror(zlogp, B_FALSE, + "clear 'protection' link property: %s", dladm_status2str(dlstatus, dlerr)); ! dlstatus = dladm_set_linkprop(dld_handle, *dllink, "allowed-ips", NULL, 0, DLADM_OPT_ACTIVE); ! if (dlstatus != DLADM_STATUS_OK) zerror(zlogp, B_FALSE, + "clear 'allowed-ips' link property: %s", dladm_status2str(dlstatus, dlerr)); } free(dllinks); return (0); } static int tcp_abort_conn(zlog_t *zlogp, zoneid_t zoneid, const struct sockaddr_storage *local, const struct sockaddr_storage *remote) { int fd; struct strioctl ioc;
*** 5156,5175 **** if (unmount_cmd) (void) lu_root_teardown(zlogp); goto error; } ! if (remove_datalink_pool(zlogp, zoneid) != 0) { zerror(zlogp, B_FALSE, "unable clear datalink pool property"); - goto error; - } ! if (remove_datalink_protect(zlogp, zoneid) != 0) { zerror(zlogp, B_FALSE, "unable clear datalink protect property"); - goto error; - } /* * The datalinks assigned to the zone will be removed from the NGZ as * part of zone_shutdown() so that we need to remove protect/pool etc. * before zone_shutdown(). Even if the shutdown itself fails, the zone --- 5131,5146 ---- if (unmount_cmd) (void) lu_root_teardown(zlogp); goto error; } ! if (remove_datalink_pool(zlogp, zoneid) != 0) zerror(zlogp, B_FALSE, "unable clear datalink pool property"); ! if (remove_datalink_protect(zlogp, zoneid) != 0) zerror(zlogp, B_FALSE, "unable clear datalink protect property"); /* * The datalinks assigned to the zone will be removed from the NGZ as * part of zone_shutdown() so that we need to remove protect/pool etc. * before zone_shutdown(). Even if the shutdown itself fails, the zone
*** 5237,5252 **** "network interfaces in zone"); goto error; } break; case ZS_EXCLUSIVE: - if (unconfigure_exclusive_network_interfaces(zlogp, - zoneid) != 0) { - zerror(zlogp, B_FALSE, "unable to unconfigure " - "network interfaces in zone"); - goto error; - } status = dladm_zone_halt(dld_handle, zoneid); if (status != DLADM_STATUS_OK) { zerror(zlogp, B_FALSE, "unable to notify " "dlmgmtd of zone halt: %s", dladm_status2str(status, errmsg)); --- 5208,5217 ----