Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Large packet sender packet id handling #3

Open
SathiyalingamSenthilkumar opened this issue Nov 15, 2022 · 0 comments
Open

Large packet sender packet id handling #3

SathiyalingamSenthilkumar opened this issue Nov 15, 2022 · 0 comments

Comments

@SathiyalingamSenthilkumar
Copy link
Contributor

SathiyalingamSenthilkumar commented Nov 15, 2022

Is it by design that the sender example starts the transfer without checking if the requested packet id matches the registered one?

In large_packet_sender.c:

PROCESS_THREAD(reply_to_request_proc, ev, data)
{
    PROCESS_BEGIN();
    while (1) {
        PROCESS_WAIT_EVENT_UNTIL(ev == event_lp_requested);
        lp_event_requested_data_t req_data = *(lp_event_requested_data_t *) data;

        /* ... */

        large_packet_tx.node_addr = req_data.src;
        large_packet_tx.node_port = req_data.src_port;
        large_packet_tx.id = req_data.packet_id;    // The registered id is overwritten with requested one.
        large_packet_tx.mask = req_data.mask;
        large_packet_tx.period_ms = req_data.period_ms;

        RUN_CHECK(large_packet_send(&large_packet_tx));
    }
    PROCESS_END();
}

This can be a potential bug, when a sender node restarts in between the transfer, and rejoins quickly enough to hear the request for missing sub-packets.

When this happens, the sender starts to send a nonexistent packet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant