Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interfaces/kiss: fix KISS interface MTU check on RX #126

Merged
merged 1 commit into from Apr 24, 2019

Conversation

Projects
None yet
2 participants
@pacheco017
Copy link

commented Apr 12, 2019

driver->rx_packet holds each (temporally incomplete) incoming CSP packet,
while driver->rx_length has said buffer's valid number of bytes.

As interface->mtu only applies to CSP "data" (and driver->rx_packet is
filled from driver->rx_packet->id.ext, not driver->rx_packet->data), size
checks must take CSP_HEADER_LENGTH into account.

Whatsmore, when "End char" is processed, this is correctly being handled, as
evidenced by the following snippet:

/* The CSP packet length is without the header */
driver->rx_packet->length = driver->rx_length - CSP_HEADER_LENGTH;
Matias Devenuta
interfaces/kiss: fix KISS interface MTU check on RX
`driver->rx_packet` holds each (temporally incomplete) incoming CSP packet,
while `driver->rx_length` has said buffer's valid number of bytes.

As `interface->mtu` only applies to CSP "data" (and `driver->rx_packet` is
filled from `driver->rx_packet->id.ext`, not `driver->rx_packet->data`), size
checks must take `CSP_HEADER_LENGTH` into account.

Whatsmore, when "End char" is processed, this is correctly being handled, as
evidenced by the following snippet:

```
/* The CSP packet length is without the header */
driver->rx_packet->length = driver->rx_length - CSP_HEADER_LENGTH;
```

@johandc johandc merged commit 3c5ad0a into libcsp:master Apr 24, 2019

@pacheco017 pacheco017 deleted the pacheco017:fix-kiss-iface-rx-mtu-check branch Apr 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.