net: gptp: Return proper port number for given interface

The port number is stored starting from 0 in Ethernet context.
But in gPTP, it is an index which starts from 1. So increase
the value by 1 for a value returned from Ethernet context.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
Jukka Rissanen 2020-05-27 16:03:10 +03:00
commit 2675a11766

View file

@ -39,7 +39,7 @@ struct gptp_domain gptp_domain;
int gptp_get_port_number(struct net_if *iface)
{
int port = net_eth_get_ptp_port(iface);
int port = net_eth_get_ptp_port(iface) + 1;
if (port >= GPTP_PORT_START && port < GPTP_PORT_END) {
return port;