Skip to content

Commit 33e2b32

Browse files
mfischerdavem330
authored andcommitted
net: ethernet: dec: tulip: Fix length mask in receive length calculation
The receive frame length calculation uses a wrong mask to calculate the length of the received frames. Per spec table 4-1 the length is contained in the FL (Frame Length) field in bits 30:16. This didn't show up as an issue so far since frames were limited to 1500 bytes which falls within the 11 bit window. Signed-off-by: Moritz Fischer <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7bb77d4 commit 33e2b32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/dec/tulip/de2104x.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,10 @@ static void de_rx (struct de_private *de)
417417
if (status & DescOwn)
418418
break;
419419

420-
len = ((status >> 16) & 0x7ff) - 4;
420+
/* the length is actually a 15 bit value here according
421+
* to Table 4-1 in the DE2104x spec so mask is 0x7fff
422+
*/
423+
len = ((status >> 16) & 0x7fff) - 4;
421424
mapping = de->rx_skb[rx_tail].mapping;
422425

423426
if (unlikely(drop)) {

0 commit comments

Comments
 (0)