Make PKB_ZLEN the minimum possible size of packet buffer (to allow for

hardware that can't autopad).
This commit is contained in:
Michael Brown
2006-05-27 13:39:45 +00:00
parent 1dbafa8950
commit 6c50564724
2 changed files with 13 additions and 0 deletions

View File

@@ -39,6 +39,10 @@ struct pk_buff * alloc_pkb ( size_t len ) {
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 );