first_seq = item;
/* check if '-' is a part of NID, token */
- sep = strchr(token, '-');
+ if (token != NULL)
+ sep = strchr(token, '-');
+ else
+ sep = NULL;
+
if (sep == NULL) {
+ if (token == NULL)
+ id.nid = LNET_NID_ANY;
+ else
+ /* if no net is specified,
+ * libcfs_str2nid() will assume tcp
+ */
+ id.nid = libcfs_str2nid(token);
+
id.pid = LNET_PID_ANY;
- /* if no net is specified, libcfs_str2nid() will assume tcp */
- id.nid = libcfs_str2nid(token);
if (id.nid == LNET_NID_ANY) {
snprintf(err_str, sizeof(err_str),
"\"cannot parse NID '%s'\"",
- token);
+ token ? token : "NULL");
rc = LUSTRE_CFG_RC_BAD_PARAM;
cYAML_build_error(rc, seq_no, MANAGE_CMD,
oper, err_str, err_rc);
return rc;
}
- for (; optind < argc; optind++)
- rc = lustre_lnet_ping_nid(argv[optind], src_nidstr, timeout, -1,
- &show_rc, &err_rc);
+ for (; optind < argc; optind++) {
+ int rc2;
+
+ rc2 = lustre_lnet_ping_nid(argv[optind], src_nidstr, timeout,
+ -1, &show_rc, &err_rc);
+ if (rc2 != 0 && (rc > 0 || rc == -EOPNOTSUPP))
+ rc = rc2;
+ }
if (show_rc)
cYAML_print_tree(show_rc);