From: Adheer Chandravanshi <[email protected]> Currently, iface conf file does not get populated with all the iface attrs that are exported in corresponding sysfs entry. This patch allows to setup conf file with all iface attrs in sysfs.
Signed-off-by: Adheer Chandravanshi <[email protected]> Signed-off-by: Vikas Chaudhary <[email protected]> --- usr/iface.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/usr/iface.c b/usr/iface.c index c86892e..8580d1a 100644 --- a/usr/iface.c +++ b/usr/iface.c @@ -476,11 +476,8 @@ static int iface_setup_binding_from_kern_iface(void *data, } memset(&iface, 0, sizeof(struct iface_rec)); - strcpy(iface.hwaddress, hinfo->iface.hwaddress); - strcpy(iface.transport_name, hinfo->iface.transport_name); - if (kern_iface) { - iface.iface_num = kern_iface->iface_num; + memcpy(&iface, kern_iface, sizeof(iface)); snprintf(iface.name, sizeof(iface.name), "%s.%s.%s.%u", kern_iface->transport_name, @@ -492,6 +489,9 @@ static int iface_setup_binding_from_kern_iface(void *data, hinfo->iface.transport_name, hinfo->iface.hwaddress); } + strcpy(iface.hwaddress, hinfo->iface.hwaddress); + strcpy(iface.transport_name, hinfo->iface.transport_name); + memset(iface_path, 0, sizeof(iface_path)); snprintf(iface_path, PATH_MAX, "%s/%s", IFACE_CONFIG_DIR, iface.name); -- 1.7.1 -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/open-iscsi. For more options, visit https://groups.google.com/groups/opt_out.
