[En-Nut-Discussion] Extra packet in ethernet packet

Philipp Burch phip at hb9etc.ch
Fri Dec 5 20:51:30 CET 2014


On 05.12.2014 20:42, Mingshu Wang wrote:
> Hi all,
> I found an issue in one of our products that is using Nut/OS 4.8.7 and AT91SAM7X256. If I send a packet with odd number of characters to my computer, an extra byte is padded at the end. Wireshark interprets it as "VSS-Monitoring Ethernet trailer".  If the packet size is an even number, everything is fine.  Most applications can handle this packet correctly. But some  applications don't read the length in the header. They just process all characters in the packet and think this is a wrong message.
> Did anyone see this problem before? How do you solve it?
> Thank you very much.

In the EmacPutPacket() function in nut/arch/arm/dev/atmel/at91_emac.c,
there is this code:

    sz += nb->nb_dl.sz;
    if (sz & 1) {

In the Emac implementation of other architectures (like STM32), the
lower three lines are commented out. I don't know why this could be
required, maybe someone can explain it? Anyway, you could try what
happens if you just remove this "make it even" stuff.


More information about the En-Nut-Discussion mailing list