From f5a30e015362f2988199b0cb3f138eee52e6b8b4 Mon Sep 17 00:00:00 2001 From: luigi Date: Mon, 19 Apr 2004 07:48:48 +0000 Subject: Remove a tail-recursive call in nd6_output. This change is functionally identical to the original code, though I have no idea if that was correct in the first place (see comment in the commit). --- sys/netinet6/nd6.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index b4485a6..d907505 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1838,17 +1838,20 @@ nd6_output(ifp, origifp, m0, dst, rt0) /* * next hop determination. This routine is derived from ether_outpout. */ +again: if (rt) { if ((rt->rt_flags & RTF_UP) == 0) { rt0 = rt = rtalloc1((struct sockaddr *)dst, 1, 0UL); if (rt != NULL) { RT_REMREF(rt); RT_UNLOCK(rt); - if (rt->rt_ifp != ifp) { - /* XXX: loop care? */ - return nd6_output(ifp, origifp, m0, - dst, rt); - } + if (rt->rt_ifp != ifp) + /* + * XXX maybe we should update ifp too, + * but the original code didn't and I + * don't know what is correct here. + */ + goto again; } else senderr(EHOSTUNREACH); } -- cgit v1.1