diff options
| author | Michael Brown | 2006-05-27 15:39:45 +0200 |
|---|---|---|
| committer | Michael Brown | 2006-05-27 15:39:45 +0200 |
| commit | 6c50564724bcce292fbe76010d637390c17d407a (patch) | |
| tree | 39e874e0e1fd4eac5a9dbc05330092322f1c2a67 /src/net | |
| parent | Tidied up debugging messages (diff) | |
| download | ipxe-6c50564724bcce292fbe76010d637390c17d407a.tar.gz ipxe-6c50564724bcce292fbe76010d637390c17d407a.tar.xz ipxe-6c50564724bcce292fbe76010d637390c17d407a.zip | |
Make PKB_ZLEN the minimum possible size of packet buffer (to allow for
hardware that can't autopad).
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/pkbuff.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net/pkbuff.c b/src/net/pkbuff.c index 964fbf623..ac3088301 100644 --- a/src/net/pkbuff.c +++ b/src/net/pkbuff.c @@ -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 ); |
