qca / open-plc-utils

Qualcomm Atheros Open Powerline Toolkit.
Other
351 stars 154 forks source link

struct cm_mnbc_sound_indicate is wrong #163

Open vinicius-smartme opened 2 years ago

vinicius-smartme commented 2 years ago

The struct cm_mnbc_sound_indicate is wrong.

It should be:

typedef struct __packed cm_mnbc_sound_indicate
{
    struct ethernet_hdr ethernet;
    struct homeplug_fmi homeplug;
    uint8_t APPLICATION_TYPE;
    uint8_t SECURITY_TYPE;
    struct __packed
    {
        uint8_t SenderID [SLAC_UNIQUE_ID_LEN];
        uint8_t CNT;
        uint8_t RunID [SLAC_RUNID_LEN];
        uint8_t RSVD [8];
        uint8_t RND [SLAC_RND_LEN];
    }
    MSVarField;
}

However, it is:

typedef struct __packed cm_mnbc_sound_indicate
{
    struct ethernet_hdr ethernet;
    struct homeplug_fmi homeplug;
    uint8_t APPLICATION_TYPE;
    uint8_t SECURITY_TYPE;
    struct __packed
    {
        uint8_t SenderID [SLAC_UNIQUE_ID_LEN];
        uint8_t CNT;
        uint8_t RunID [SLAC_RUNID_LEN];
        uint8_t RND [SLAC_UNIQUE_ID_LEN];
    }
    MSVarField;
}
MichaelBMiner commented 6 months ago

Has this been fixed in master? I can confirm this causes malformed packets in sounding.