Browse Source

Legacy drivers will not pad when necessary

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
754cfdfcf4
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/drivers/net/legacy.c

+ 4
- 0
src/drivers/net/legacy.c View File

@@ -21,7 +21,11 @@ struct nic nic;
21 21
 static int legacy_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
22 22
 	struct nic *nic = netdev->priv;
23 23
 	struct ethhdr *ethhdr = pkb->data;
24
+	int pad_len;
24 25
 
26
+	pad_len = ( ETH_ZLEN - pkb_len ( pkb ) );
27
+	if ( pad_len > 0 )
28
+		memset ( pkb_put ( pkb, pad_len ), 0, pad_len );
25 29
 	pkb_pull ( pkb, sizeof ( *ethhdr ) );
26 30
 	nic->nic_op->transmit ( nic, ( const char * ) ethhdr->h_dest,
27 31
 				ntohs ( ethhdr->h_protocol ),

Loading…
Cancel
Save