Two patches with different implementations to support ptp over non ethernet media. Currently ptpd fails the communicationTechnology() check for any media that is not ethernet and thus returns a uuid of 0. The uuid must be unique for each server.
The logic used is if the media is not ethernet, then use the interface IP address to create a uuid. The assumption is that the IP address should be unique per subnet.
patch 1 with filename ptpd-1.1.0-noneth-generic.patch
This patch blindly uses the IP address for uuid if communicationTechnology() returns PTP_DEFAULT - this will be the case for any network that is not ethernet. The problem with this solution is that all PTP frames will be generated with "(ptpd debug) communication technology: 255" which may not be correct according to the ptp standard.
patch 2 with filename ptpd-1.1.0-noneth-ib.patch
This patch adds a new technology specifically for Infiniband and only uses the interface IP address for the uuid if the technology is Infiniband. Clearly this patch is very specific and will require logic for every type of techology. The communication technology field will be set to 245 for Infiniband.
Also with my testing there appears to be a logic problem with this code in net.c:
if (ioctl(netPath->eventSock, SIOCGIFHWADDR, &device[i]) < 0)
DBGV("failed to get hardware address\n");
else if ((*communicationTechnology = lookupCommunicationTechnology(device[i].ifr_hwaddr.sa_family)) == PTP_DEFAULT)
DBGV("unsupported communication technology (%d)\n", *communicationTechnology);
memcpy(uuid, device[i].ifr_hwaddr.sa_data, PTP_UUID_LENGTH);
The logic says if the ioctl() call works to get the HWADDR (or uuid) but the tecnology check fails, then do nothing thus the uuid lands up being 0 later on in the code. I think if the ioctl() works then assume the HWADDR or uuid is valid and do not be so specific about the communication technology. This won't work for all cases as mac addresses returned by ioctl() are not always unique (eg Infiniband).