Browse Source

PNIC doesn't auto-pad.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
7826de3f7e
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      src/drivers/net/pnic.c

+ 8
- 0
src/drivers/net/pnic.c View File

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

Loading…
Cancel
Save