>>> "Eddie Wai" <[email protected]> schrieb am 02.02.2012 um 04:03 in
Nachricht <[email protected]>:
> 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 <[email protected]>
> ---
>  usr/iface.c |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
> 
> diff --git a/usr/iface.c b/usr/iface.c
> index 37840a9..730820c 100644
> --- a/usr/iface.c
> +++ b/usr/iface.c
> @@ -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);

Hi!

I wonder if implementing a "copy_if_not_empty()" once would make sense here. 
The name is just a suggestion, but I think you get the idea. Assuming these are 
all actually C-strings.

Regards,
Ulrich


> +     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))



 

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to