Commit 4c8ddedf authored by Alessandro Rubini's avatar Alessandro Rubini

state-initializing: properly pre-set port number

The port number used to be 1, but we are multi-port, and forgot to
update this item (no bad effects were seen so far, but the standard
requires each port to use a different port number so loops can be
managed, and, for example, having both Ethernet and UDP on the same
wire is a loop.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 63873358
......@@ -39,7 +39,8 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
*/
memcpy(&port->portIdentity.clockIdentity,
&DSDEF(ppi)->clockIdentity, PP_CLOCK_IDENTITY_LENGTH);
port->portIdentity.portNumber = 1;
/* 1-based port number = index of this ppi in the global array */
port->portIdentity.portNumber = 1 + ppi - ppi->glbs->pp_instances;
port->logMinDelayReqInterval = PP_DEFAULT_DELAYREQ_INTERVAL;
port->logAnnounceInterval = opt->announce_intvl;
port->announceReceiptTimeout = PP_DEFAULT_ANNOUNCE_RECEIPT_TIMEOUT;
......
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