I am getting a dst NULL pointer here (in port_delay_request)

 

    if (p->hybrid_e2e) {

        struct ptp_message *dst = TAILQ_FIRST(&p->best->messages);

        msg->address = dst->address;

        msg->header.flagField[0] |= UNICAST;

    }

 

(gdb) p dst

$13 = (struct ptp_message *) 0x0

 

This appears to be because the list is empty

(gdb) p /x  *p->best

$8 = {list = {le_next = 0x4d768, le_prev = 0x76d3614c}, messages = {tqh_first = 
0x0,
tqh_last = 0x4d7b0}, n_messages = 0x0, port = 0x76d36008, dataset = {

    priority1 = 0x10, identity = {id = {0xbe, 0x73, 0x51, 0xff, 0xfe, 0x5, 
0x60, 0x24}},
quality = {clockClass = 0xf8, clockAccuracy = 0xfe,

      offsetScaledLogVariance = 0xffff}, priority2 = 0x10, stepsRemoved = 0x0, 
sender =
{clockIdentity = {id = {0xbe, 0x73, 0x51, 0xff, 0xfe, 0x5, 0x60,

          0x24}}, portNumber = 0x1}, receiver = {clockIdentity = {id = {0xfe, 
0xb8, 0x97,
0xff, 0xfe, 0x5, 0x10, 0x64}}, portNumber = 0x1}}}

 

So is it enough just to add a check for n_messages - eg

    if (p->hybrid_e2e) 

    {

        if (p->best->n_messages == 0)

        {

            pr_err("ERROR: Cannot send hybrid DELAY_REQ as Master Clock ID 
unknown");

            goto out;

        }

        struct ptp_message *dst = TAILQ_FIRST(&p->best->messages);

        msg->address = dst->address;

        msg->header.flagField[0] |= UNICAST;

    }

 

Or should the list never be empty at this point ?

 

Regards

AndyCapp

 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to