hardware that can't autopad).
*/
#define PKBUFF_ALIGN 2048
+/**
+ * Minimum packet buffer length
+ *
+ * alloc_pkb() will round up the allocated length to this size if
+ * necessary. This is used on behalf of hardware that is not capable
+ * of auto-padding.
+ */
+#define PKB_ZLEN 64
+
/** A packet buffer
*
* This structure is used to represent a network packet within gPXE.
struct pk_buff *pkb = NULL;
void *data;
+ /* Pad to minimum length */
+ if ( len < PKB_ZLEN )
+ len = PKB_ZLEN;
+
/* Align buffer length */
len = ( len + __alignof__( *pkb ) - 1 ) & ~( __alignof__( *pkb ) - 1 );