Date: Fri, 13 May 2005 17:58:30 +0200 From: Andre Oppermann <andre@freebsd.org> To: gnn@freebsd.org Cc: kame <snap-users@kame.net> Subject: Re: Code nit questions... Message-ID: <4284CEA6.CB014AA6@freebsd.org> References: <m2acmzet7b.wl%gnn@neville-neil.com>
next in thread | previous in thread | raw e-mail | index | archive | help
gnn@freebsd.org wrote:
>
> Hi Folks,
>
> In a continuing effort to clean up some code nits in the IPv6 code
> I'd like to propose the following diffs. There is a comment, starting
> with a *) explaining the problem and proposed fix.
>
> Let me know.
...
> *) Make sure that sro is also valid before de-referencing it.
>
> Index: in6_src.c
> ===================================================================
> RCS file: /Volumes/exported/FreeBSD-CVS/src/sys/netinet6/in6_src.c,v
> retrieving revision 1.29
> diff -u -r1.29 in6_src.c
> --- in6_src.c 7 Jan 2005 02:30:34 -0000 1.29
> +++ in6_src.c 11 May 2005 20:09:30 -0000
> @@ -454,7 +454,7 @@
>
> if ((error = in6_selectroute(dstsock, opts, mopts, ro, retifp,
> &rt, 0)) != 0) {
> - if (rt && rt == sro.ro_rt)
> + if (rt && sro && rt == sro.ro_rt)
> RTFREE(rt);
> return (error);
> }
AFAIK 'sro' is stack-route which is a 'struct route' on the stack
and thus always valid. The orginal check fine as it is.
--
Andre
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4284CEA6.CB014AA6>
