X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lnet%2Flnet%2Fapi-ni.c;h=ed5eba9b6cb7219983d3f2c9477762aec60506db;hb=4443604ca437aaafe2a0dc700c1ceb8b131ba126;hp=6aa6f9e3759df2dcb566556f4b868fc815c89977;hpb=98060d83459ba10409f295898f0ec917f938b4d3;p=fs%2Flustre-release.git diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 6aa6f9e..ed5eba9 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -125,34 +125,16 @@ lnet_get_networks (void) { static char default_networks[256]; char *networks = getenv ("LNET_NETWORKS"); - char *ip2nets = getenv ("LNET_IP2NETS"); char *str; char *sep; int len; int nob; - int rc; cfs_list_t *tmp; -#ifdef NOT_YET - if (networks != NULL && ip2nets != NULL) { - LCONSOLE_ERROR_MSG(0x103, "Please set EITHER 'LNET_NETWORKS' or" - " 'LNET_IP2NETS' but not both at once\n"); - return NULL; - } - - if (ip2nets != NULL) { - rc = lnet_parse_ip2nets(&networks, ip2nets); - return (rc == 0) ? networks : NULL; - } -#else - SET_BUT_UNUSED(ip2nets); - SET_BUT_UNUSED(rc); -#endif if (networks != NULL) return networks; /* In userland, the default 'networks=' is the list of known net types */ - len = sizeof(default_networks); str = default_networks; *str = 0; @@ -163,13 +145,12 @@ lnet_get_networks (void) nob = snprintf(str, len, "%s%s", sep, libcfs_lnd2str(lnd->lnd_type)); + if (nob >= len) { + /* overflowed the string; leave it where it was */ + *str = 0; + break; + } len -= nob; - if (len < 0) { - /* overflowed the string; leave it where it was */ - *str = 0; - break; - } - str += nob; sep = ","; } @@ -1618,8 +1599,8 @@ LNetCtl(unsigned int cmd, void *arg) return lnet_fail_nid(data->ioc_nid, data->ioc_count); case IOC_LIBCFS_ADD_ROUTE: - rc = lnet_add_route(data->ioc_net, data->ioc_count, - data->ioc_nid); + rc = lnet_add_route(data->ioc_net, data->ioc_count, + data->ioc_nid, data->ioc_priority); return (rc != 0) ? rc : lnet_check_routes(); case IOC_LIBCFS_DEL_ROUTE: @@ -1628,7 +1609,8 @@ LNetCtl(unsigned int cmd, void *arg) case IOC_LIBCFS_GET_ROUTE: return lnet_get_route(data->ioc_count, &data->ioc_net, &data->ioc_count, - &data->ioc_nid, &data->ioc_flags); + &data->ioc_nid, &data->ioc_flags, + &data->ioc_priority); case IOC_LIBCFS_NOTIFY_ROUTER: return lnet_notify(NULL, data->ioc_nid, data->ioc_flags, cfs_time_current() - @@ -2107,12 +2089,8 @@ lnet_ping (lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_i for (i = 0; i < n_ids; i++) { tmpid.pid = info->pi_pid; tmpid.nid = info->pi_ni[i].ns_nid; -#ifdef __KERNEL__ - if (cfs_copy_to_user(&ids[i], &tmpid, sizeof(tmpid))) + if (copy_to_user(&ids[i], &tmpid, sizeof(tmpid))) goto out_1; -#else - ids[i] = tmpid; -#endif } rc = info->pi_nnis;