goto failed0;
}
+ lnet_net_lock(0);
+ if (lnet_nid_to_ni_locked(&ni->ni_nid, 0)) {
+ lnet_ni_addref_locked(ni, 0);
+ lnet_net_unlock(0);
+ return -EEXIST;
+ }
+ lnet_net_unlock(0);
+
/* We keep a reference on the loopback net through the loopback NI */
if (net->net_lnd->lnd_type == LOLND) {
lnet_ni_addref(ni);
/* make sure that the the NI we're about to start
* up is actually unique. if it's not fail. */
- if (!lnet_ni_unique_net(&net_l->net_ni_list,
+
+ if (ni->ni_interface &&
+ !lnet_ni_unique_net(&net_l->net_ni_list,
ni->ni_interface)) {
rc = -EEXIST;
goto failed1;
rc = lnet_startup_lndni(ni, tun);
+ if (rc == -EEXIST)
+ list_add_tail(&ni->ni_netlist, &local_ni_list);
+
if (rc != 0)
goto failed1;
if $FORCE_LARGE_NID; then
always_except LU-14288 101
always_except LU-14288 103
+ always_except LU-17457 199
always_except LU-17457 208
always_except LU-9680 213
always_except LU-17458 220
}
run_test 111 "Test many routes"
+test_199() {
+ [[ ${NETTYPE} == tcp* || ${NETTYPE} == o2ib* ]] ||
+ skip "Need tcp or o2ib NETTYPE"
+
+ reinit_dlc || return $?
+
+ echo "Add interface ${INTERFACES[0]}"
+ do_lnetctl net add --net ${NETTYPE} --if ${INTERFACES[0]} ||
+ error "Failed to add net ${NETTYPE} with ${INTERFACES[0]}"
+
+ local ipaddress=$(ip --oneline addr show dev ${INTERFACES[0]} |
+ awk '/inet /{print $4}' |
+ sed 's:/.*::')
+
+ echo "Add IP address ${ipaddress} for interface ${INTERFACES[0]}"
+ do_lnetctl net add --ip2net "${NETTYPE} ${ipaddress}" || return 0
+
+ error "Failed to add net ${NETTYPE} with ${INTERFACES[0]}"
+}
+run_test 199 "load lnet w/o module option, configure interface twice"
+
test_200() {
[[ ${NETTYPE} == tcp* ]] ||
skip "Need tcp NETTYPE"