On Thu, Mar 12, 2015 at 11:41:42AM +0000, Romain FABBRI wrote:
> I can't find the related entry on bugs@ and the post your refer to isn't 
> published or accessible.
> But thanks a lot for your answer and I'm glad if it's really a knowed/patched 
> issue.
> 
> If you you could provide me the patch or tell me how to get it, it would be 
> very kind
> Or maybe I just have to wait for your link to be published...

It seems marc is having some problems, so I've included mpi's diff below.
You can also find it on gmane:
http://article.gmane.org/gmane.os.openbsd.bugs/21621

Index: netinet/if_ether.c
===================================================================
RCS file: /cvs/src/sys/netinet/if_ether.c,v
retrieving revision 1.146
diff -u -p -r1.146 if_ether.c
--- netinet/if_ether.c  11 Feb 2015 23:34:43 -0000      1.146
+++ netinet/if_ether.c  10 Mar 2015 15:25:48 -0000
@@ -399,6 +399,13 @@ arpresolve(struct arpcom *ac, struct rte
                return (EINVAL);
        }
        sdl = SDL(rt->rt_gateway);
+       if (sdl->sdl_alen > 0 && sdl->sdl_alen != ETHER_ADDR_LEN) {
+               log(LOG_DEBUG, "%s: %s: incorrect arp information\n", __func__,
+                   inet_ntop(AF_INET, &satosin(dst)->sin_addr,
+                       addr, sizeof(addr)));
+               m_freem(m);
+               return (EINVAL);
+       }
        /*
         * Check the address family and length is valid, the address
         * is resolved; otherwise, try to resolve.
Index: netinet6/nd6.c
===================================================================
RCS file: /cvs/src/sys/netinet6/nd6.c,v
retrieving revision 1.131
diff -u -p -r1.131 nd6.c
--- netinet6/nd6.c      11 Feb 2015 23:34:43 -0000      1.131
+++ netinet6/nd6.c      12 Mar 2015 09:35:34 -0000
@@ -1868,13 +1868,11 @@ nd6_storelladdr(struct ifnet *ifp, struc
                return (EINVAL);
        }
        sdl = SDL(rt->rt_gateway);
-       if (sdl->sdl_alen == 0) {
+       if (sdl->sdl_alen != ETHER_ADDR_LEN) {
                char addr[INET6_ADDRSTRLEN];
-               /* this should be impossible, but we bark here for debugging */
-               printf("nd6_storelladdr: sdl_alen == 0, dst=%s, if=%s\n",
+               log(LOG_DEBUG, "%s: %s: incorrect nd6 information\n", __func__,
                    inet_ntop(AF_INET6, &satosin6(dst)->sin6_addr,
-                       addr, sizeof(addr)),
-                   ifp->if_xname);
+                       addr, sizeof(addr)));
                m_freem(m);
                return (EINVAL);
        }

Reply via email to