diff options
author | luigi <luigi@FreeBSD.org> | 2004-04-19 07:48:48 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2004-04-19 07:48:48 +0000 |
commit | f5a30e015362f2988199b0cb3f138eee52e6b8b4 (patch) | |
tree | a2679450ee40851dab8442294faca5fb16a9b8e8 /sys/netinet6 | |
parent | 126fcbbfad419f17b82db7655c353c8344d86183 (diff) | |
download | FreeBSD-src-f5a30e015362f2988199b0cb3f138eee52e6b8b4.zip FreeBSD-src-f5a30e015362f2988199b0cb3f138eee52e6b8b4.tar.gz |
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).
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/nd6.c | 13 |
1 files 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); } |