- if (!lnet_ni_unique_ni(ni->ni_interfaces, iface))
- return -EINVAL;
-
- /* Allocate a separate piece of memory and copy
- * into it the string, so we don't have
- * a depencency on the tokens string. This way we
- * can free the tokens at the end of the function.
- * The newly allocated ni_interfaces[] can be
- * freed when freeing the NI */
- while (niface < LNET_INTERFACES_NUM &&
- ni->ni_interfaces[niface] != NULL)
- niface++;
-
- if (niface >= LNET_INTERFACES_NUM) {
- LCONSOLE_ERROR_MSG(0x115, "Too many interfaces "
- "for net %s\n",
- libcfs_net2str(LNET_NIDNET(ni->ni_nid)));
+ if (ni->ni_interface != NULL) {
+ LCONSOLE_ERROR_MSG(0x115, "%s: interface %s already set for net %s: rc = %d\n",
+ iface, ni->ni_interface,
+ libcfs_net2str(LNET_NIDNET(ni->ni_nid)),
+ -EINVAL);