Date: Thu, 14 Mar 2019 01:32:38 +0100 From: Andreas Kempe <kempe@lysator.liu.se> To: freebsd-net@freebsd.org Subject: Infiniband: IPv6 neighbour discovery issues using Mellanox MT26418 between Linux and FreeBSD Message-ID: <19d07d9c-aa07-41a5-26fb-5fd2c9df99ca@lysator.liu.se>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Hello!
We have been trying to use IPv6 together with Mellanox MT26418 and are
having issues with neighbour discovery responses not getting back to the
requesting machine when connecting a Linux machine to a FreeBSD machine.
The request is visible in tcpdump on both machines. On the responding
machine, the outgoing response message is visible, but on the requesting
machine, the response is not visible. It didn't matter whether the Linux
box or the FreeBSD box was the requester.
We applied the attached patch to ndp (since ndp is currently lacking
support for link layer addresses larger than 6 bytes) to be able to set
static neighbours and then the traffic got through.
When running traffic between two FreeBSD hosts, it worked without any
manual intervention.
The Linux machine is running Gentoo with Linux 4.14.83 and was acting as
the OpenSM master, while the FreeBSD machines are running 11.2-RELEASE-p9.
Does anyone recognise these issues?
Thank you for any assistance!
Cordially,
Andreas Kempe
[-- Attachment #2 --]
--- usr.sbin/ndp/ndp.c.old 2019-03-13 22:06:05.472614000 +0100
+++ usr.sbin/ndp/ndp.c 2019-03-14 01:10:30.049934000 +0100
@@ -388,7 +388,7 @@
register struct sockaddr_dl *sdl;
register struct rt_msghdr *rtm = &(m_rtmsg.m_rtm);
struct addrinfo hints, *res;
- int gai_error;
+ int gai_error, l;
u_char *ea;
char *host = argv[0], *eaddr = argv[1];
@@ -410,8 +410,9 @@
sin->sin6_scope_id =
((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id;
ea = (u_char *)LLADDR(&sdl_m);
- if (ndp_ether_aton(eaddr, ea) == 0)
- sdl_m.sdl_alen = 6;
+ l = ndp_ether_aton(eaddr, ea);
+ if (l != -1)
+ sdl_m.sdl_alen = l;
flags = expire_time = 0;
while (argc-- > 0) {
if (strncmp(argv[0], "temp", 4) == 0) {
@@ -804,17 +805,33 @@
static int
ndp_ether_aton(char *a, u_char *n)
{
- int i, o[6];
+ int i, l, o[20];
+ char buf[60];
+ char *p;
- i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o[0], &o[1], &o[2],
- &o[3], &o[4], &o[5]);
- if (i != 6) {
- fprintf(stderr, "ndp: invalid Ethernet address '%s'\n", a);
- return (1);
+ l = 0;
+ p = strncpy(buf, a, sizeof(buf));
+ if (p < (buf + sizeof(buf))) {
+ for (p = strtok(buf, ":"); p; l++, p = strtok(NULL, ":")) {
+ if (l > 19) {
+ /* l = 0 to indicate an error */
+ l = 0;
+ break;
+ }
+
+ if (sscanf(p, "%x", &o[l]) != 1) {
+ break;
+ }
+ }
}
- for (i = 0; i < 6; i++)
+ if (l > 20 || (l != 6 && l != 20)) {
+ fprintf(stderr, "ndp: invalid Ethernet address '%s'\n",
+ a);
+ return (-1);
+ }
+ for (i = 0; i < l; i++)
n[i] = o[i];
- return (0);
+ return (l);
}
static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19d07d9c-aa07-41a5-26fb-5fd2c9df99ca>
