david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

Use pkb_pad() rather than doing it the dangerous way :)

This commit is contained in:
Michael Brown 2007-01-11 05:26:16 +00:00
parent a3ed0cbbc7
commit 03390f0cd6
1 changed files with 2 additions and 5 deletions

View File

@ -148,12 +148,9 @@ TRANSMIT - Transmit a frame
***************************************************************************/
static int pnic_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
struct pnic *pnic = netdev->priv;
int pad_len;
/* Pad to minimum packet length */
pad_len = ( ETH_ZLEN - pkb_len ( pkb ) );
if ( pad_len > 0 )
memset ( pkb_put ( pkb, pad_len ), 0, pad_len );
/* Pad the packet */
pkb_pad ( pkb, ETH_ZLEN );
/* Send packet */
pnic_command ( pnic, PNIC_CMD_XMIT, pkb->data, pkb_len ( pkb ),