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).
This commit is contained in:
Luigi Rizzo 2004-04-19 07:48:48 +00:00
parent 9554c70bbd
commit 3240408870

View File

@ -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);
}