From c64e0e5f77b12a81615aa96305a0c3e5730481df Mon Sep 17 00:00:00 2001 From: Ales Kozumplik Date: Thu, 25 Nov 2010 14:00:31 +0100 Subject: [PATCH] brcm uio: handle the different iface_rec structures in iscsid and brcm. Related: rhbz#442980 --- brcm_iscsi_uio/include/config.h | 3 ++- brcm_iscsi_uio/include/iscsi_net_util.h | 14 ++++++++++++++ brcm_iscsi_uio/src/unix/iscsid_ipc.c | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 brcm_iscsi_uio/include/iscsi_net_util.h diff --git a/brcm_iscsi_uio/include/config.h b/brcm_iscsi_uio/include/config.h index cf6d88b..dfe4355 100644 --- a/brcm_iscsi_uio/include/config.h +++ b/brcm_iscsi_uio/include/config.h @@ -25,6 +25,7 @@ //#include "types.h" //#include "auth.h" /* for the username and password sizes */ #include "list.h" +#include "iscsi_net_util.h" /* ISIDs now have a typed naming authority in them. We use an OUI */ #define DRIVER_ISID_0 0x00 @@ -199,7 +200,7 @@ typedef struct iface_rec { * TODO: we may have to make this bigger and interconnect * specific for infinniband */ - char hwaddress[ISCSI_MAX_IFACE_LEN]; + char hwaddress[ISCSI_HWADDRESS_BUF_SIZE]; char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN]; /* * This is only used for boot now, but the iser guys diff --git a/brcm_iscsi_uio/include/iscsi_net_util.h b/brcm_iscsi_uio/include/iscsi_net_util.h new file mode 100644 index 0000000..2c45fe5 --- /dev/null +++ b/brcm_iscsi_uio/include/iscsi_net_util.h @@ -0,0 +1,14 @@ +#ifndef __ISCSI_NET_UTIL_h__ +#define __ISCSI_NET_UTIL_h__ + +#define ISCSI_HWADDRESS_BUF_SIZE 18 + +#if 0 + +extern int net_get_transport_name_from_netdev(char *netdev, char *transport); +extern int net_get_netdev_from_hwaddress(char *hwaddress, char *netdev); +extern int net_setup_netdev(char *netdev, char *local_ip, char *mask, + char *gateway, char *remote_ip, int needs_bringup); + +#endif +#endif diff --git a/brcm_iscsi_uio/src/unix/iscsid_ipc.c b/brcm_iscsi_uio/src/unix/iscsid_ipc.c index 4c00ef2..67b002a 100644 --- a/brcm_iscsi_uio/src/unix/iscsid_ipc.c +++ b/brcm_iscsi_uio/src/unix/iscsid_ipc.c @@ -349,7 +349,7 @@ int process_iscsid_broadcast(int s2) } /* This will be freed by parse_iface_thread() */ - data = (iscsid_uip_broadcast_t *) malloc(sizeof(*data)); + data = (iscsid_uip_broadcast_t *) calloc(1, sizeof(*data)); if(data == NULL) { LOG_ERR(PFX "Couldn't allocate memory for iface data"); return -ENOMEM; -- 1.7.3.2