Commit 12514c7c authored by Alessandro Rubini's avatar Alessandro Rubini

bugfix: fsm: PPM_NO_MESSAGE was set too early

  168655e6 fsm: when no frame, set msgtype to PPM_NO_MESSAGE

was good, but I didn't notice that pp_packet_prefilter() may
force a packet drop. This moves the assignemento of PPM_NO_MESSAGE
to a later place, just before calling the state machine.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <>
parent dd97c99a
......@@ -228,8 +228,6 @@ int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen)
plen = 0;
packet = NULL;
if (!plen)
ppi->received_ptp_header.messageType = PPM_NO_MESSAGE;
state = ppi->state;
......@@ -257,6 +255,8 @@ int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen)
if (ppi->state != ppi->next_state)
return leave_current_state(ppi);
if (!plen)
ppi->received_ptp_header.messageType = PPM_NO_MESSAGE;
err = ip->f1(ppi, packet, plen);
if (err)
pp_printf("fsm for %s: Error %i in %s\n",
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment