tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mue(4) patch



On 2018/12/04 15:28, Harold Gutch wrote:
On Tue, Dec 04, 2018 at 10:58:34AM +0900, Rin Okuyama wrote:
Does anyone know a convenient way to generate packets with wrong
L3/L4 checksum fields?

If Python is OK, perhaps pkgsrc/net/scapy.  I have never used it, but
it is supposed to be good.


   Harold

Thank you Harold, it works great!

On 2018/12/04 10:58, Rin Okuyama wrote:
Thank you for working on this! I revised your patch as follows:

http://www.netbsd.org/~rin/if_mue_20181204.patch

(1) We need to check bits 30 and 31 of rx_cmd_a, which indicate
     checksum error detected by H/W for L4 and L3, respectively.
     Otherwise, broken packets bypass any checksumming.

(2) Mask csum by ifp->if_csum_flags_rx in mue_rxeof() for safety.

(3) Some style changes.

I've tested the patch with Z-TEK ZE582 (LAN7500). It works fine
as far as I can see, although no checksum errors were detected
during test.

I've updated the patch:

http://www.netbsd.org/~rin/if_mue_20181204-1.patch

(a) We cannot use bit 22 of rx_cmd_a (MUE_RX_CMD_A_RED) to drop
    wrong packets, since it is turned on in the cases of L3/L4
    checksum errors. Use bits 16--21 instead.

(b) For (3), undo renaming MUE_RX_CMD_A_FOO in the previous patch
    in favor of ones in Robert's original patch, that are taken
    from the data sheet. Sorry Robert, you were right.

Now, the driver can handle checksum errors correctly!

rin


Home | Main Index | Thread Index | Old Index