Browse Source

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

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
03390f0cd6
1 changed files with 2 additions and 5 deletions
  1. 2
    5
      src/drivers/net/pnic.c

+ 2
- 5
src/drivers/net/pnic.c View File

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

Loading…
Cancel
Save