Skip to content

SimpleNetworks transmit passes too long buffer to SNP protocol. #1549

@jas-nah

Description

@jas-nah

In proto/network/snp.rs the transmit method passes the sum of the provided buffer length (buffer.len()) plus the specified header_size as BufferSize to the protocol. In my small test program I can send valid packets (e.g. ARP) but on the wire I can also see additional (random) bytes being transmitted after my buffer.

With my reading of the spec then Buffer passed to transmit should already contain bytes for both header and body, and header_size only indicates whether the protocol should manipulate the header before sending. With that I think the right value to pass on as BufferSize would actually be just buffer.len().

However, the spec is inconsistent as it talks about "placeing the packet specified by Header and Buffer on the transmit queue" but I don't see any other mention of Header anywhere (certainly it's not a paramter for transmit).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions