This fixes a segfault where there's a lookup_fcf call with mac hard set to NULL

The MACs not really needed, as fipvlan doesn't use the FCF information at all -
it just picks a VLAN and then FCF selection happens from the kernel FIP code
once activated.
---
 fipvlan.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fipvlan.c b/fipvlan.c
index cc71412..211da53 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -168,9 +168,10 @@ static struct fcf *lookup_fcf(struct fcf_list_head *head, 
int ifindex,
        struct fcf *fcf;
 
        TAILQ_FOREACH(fcf, head, list_node)
-               if ((ifindex == fcf->ifindex) && (vlan == fcf->vlan) &&
-                   (memcmp(mac, fcf->mac_addr, ETHER_ADDR_LEN) == 0))
-                       return fcf;
+               if ((ifindex == fcf->ifindex) && (vlan == fcf->vlan)) {
+                       if ((!mac) || (memcmp(mac, fcf->mac_addr, 
ETHER_ADDR_LEN) == 0))
+                               return fcf;
+               }
        return NULL;
 }
 
-- 
2.1.0

_______________________________________________
fcoe-devel mailing list
[email protected]
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel

Reply via email to