Permalink
Browse files

ISCSIADM: Included the new iface net params to the node creation

Whenever a new node gets created via the 'iscsiadm -m node -I <name>
-I <ifacename> -o new' command, the new iface net parameters doesn't
get populated to the created node automatically.

The bug is in the iface_copy routine where it only copies a portion
of the iface parameters.

Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
  • Loading branch information...
ew929595 authored and Mike Christie committed Feb 2, 2012
1 parent 4323e34 commit 8927ad34fc1e9eeea77e5faddca4cc66a1266da1
Showing with 30 additions and 0 deletions.
  1. +30 −0 usr/iface.c
View
@@ -532,10 +532,40 @@ void iface_copy(struct iface_rec *dst, struct iface_rec *src)
{
if (strlen(src->name))
strcpy(dst->name, src->name);
+ if (src->iface_num)
+ dst->iface_num = src->iface_num;
if (strlen(src->netdev))
strcpy(dst->netdev, src->netdev);
if (strlen(src->ipaddress))
strcpy(dst->ipaddress, src->ipaddress);
+ if (strlen(src->subnet_mask))
+ strcpy(dst->subnet_mask, src->subnet_mask);
+ if (strlen(src->gateway))
+ strcpy(dst->gateway, src->gateway);
+ if (strlen(src->bootproto))
+ strcpy(dst->bootproto, src->bootproto);
+ if (strlen(src->ipv6_linklocal))
+ strcpy(dst->ipv6_linklocal, src->ipv6_linklocal);
+ if (strlen(src->ipv6_router))
+ strcpy(dst->ipv6_router, src->ipv6_router);
+ if (strlen(src->ipv6_autocfg))
+ strcpy(dst->ipv6_autocfg, src->ipv6_autocfg);
+ if (strlen(src->linklocal_autocfg))
+ strcpy(dst->linklocal_autocfg, src->linklocal_autocfg);
+ if (strlen(src->router_autocfg))
+ strcpy(dst->router_autocfg, src->router_autocfg);
+ if (src->vlan_id)
+ dst->vlan_id = src->vlan_id;
+ if (src->vlan_priority)
+ dst->vlan_priority = src->vlan_priority;
+ if (strlen(src->vlan_state))
+ strcpy(dst->vlan_state, src->vlan_state);
+ if (strlen(src->state))
+ strcpy(dst->state, src->state);
+ if (src->mtu)
+ dst->mtu = src->mtu;
+ if (src->port)
+ dst->port = src->port;
if (strlen(src->hwaddress))
strcpy(dst->hwaddress, src->hwaddress);
if (strlen(src->transport_name))

0 comments on commit 8927ad3

Please sign in to comment.