This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

file cpswif.c; routine cpswif_output()

I would like to understand the code in cpswif.c; cpswif_output().

It appears to me that the pbuf passed to cpswif_transmit(), if there
is more than one pbuf linked together and the "total length" is less
than the minimum ethernet packet size, is the tail pbuf and not the
head pbuf. since they are not doubly linked, how does the "transmit"
routine see all of the pbufs in this case?

When the code artifically extends the "total length" to the minimum
ethernet packet size, it does not "set" the pad bytes. While this
saves a few cycles, it leaves "junk" bytes in the pad area. Some
network devices are not "keen" on random bits in the packet and the
packet looks "unprofessional". This is especially true for ARP
packets which only have 14 + 28, or 42 bytes. the remaining 18 bytes
appear as random bits from cpswif_output().