]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[fcoe] Use only the first instance of a FIP descriptor
authorMichael Brown <mcb30@ipxe.org>
Sat, 27 Nov 2010 15:48:01 +0000 (15:48 +0000)
committerMichael Brown <mcb30@ipxe.org>
Sat, 27 Nov 2010 16:04:57 +0000 (16:04 +0000)
Almost all FIP packets contain at most one instance of each
descriptor.  A VLAN notification may contain multiple VLAN
descriptors.  The FCoE specification does not provide any guidance
regarding prioritisation of VLANs, so we may choose to arbitrarily
choose the first listed VLAN.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/fcoe.c

index c43fef61fc5a80d7f05473de721af7d39bf0d429..db2fc980645c59ceb04f734c5b393a4a691bbfda 100644 (file)
@@ -533,7 +533,9 @@ static int fcoe_fip_parse ( struct fcoe_port *fcoe, struct fip_header *fiphdr,
                /* Handle descriptors that we understand */
                if ( ( desc_type > FIP_RESERVED ) &&
                     ( desc_type < FIP_NUM_DESCRIPTOR_TYPES ) ) {
-                       descs->desc[desc_type] = desc;
+                       /* Use only the first instance of a descriptor */
+                       if ( descs->desc[desc_type] == NULL )
+                               descs->desc[desc_type] = desc;
                        continue;
                }