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
 static int legacy_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
21
 static int legacy_transmit ( struct net_device *netdev, struct pk_buff *pkb ) {
22
 	struct nic *nic = netdev->priv;
22
 	struct nic *nic = netdev->priv;
23
 	struct ethhdr *ethhdr = pkb->data;
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
 	pkb_pull ( pkb, sizeof ( *ethhdr ) );
29
 	pkb_pull ( pkb, sizeof ( *ethhdr ) );
26
 	nic->nic_op->transmit ( nic, ( const char * ) ethhdr->h_dest,
30
 	nic->nic_op->transmit ( nic, ( const char * ) ethhdr->h_dest,
27
 				ntohs ( ethhdr->h_protocol ),
31
 				ntohs ( ethhdr->h_protocol ),

Loading…
Cancel
Save