Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Oct 2004 15:03:26 +0300
From:      Giorgos Keramidas <keramida@freebsd.org>
To:        gnn@freebsd.org, rwatson@freebsd.org
Cc:        freebsd-net@freebsd.org
Subject:   Re: Locking fixes to IPv6 scope6.c
Message-ID:  <20041016120326.GA34124@gothmog.gr>
In-Reply-To: <m2is9b9fva.wl@minion.local.neville-neil.com>
References:  <m2is9b9fva.wl@minion.local.neville-neil.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2004-10-16 18:22, gnn@FreeBSD.org wrote:
> Howdy,
>
> 	Here is a proposed set of diffs for locking fixes in the
> 	scope6.c module.  Please let me know anyone has questions or
> 	comments.
>
> Thanks,
> George

I'm not a networking expert, but there are some style bugs you might
want to have fixed before committing this:

> Index: scope6.c
> ===================================================================
> RCS file: /Volumes/exported/FreeBSD-CVS/src/sys/netinet6/scope6.c,v
> retrieving revision 1.10
> diff -u -r1.10 scope6.c
> --- scope6.c	22 Oct 2003 15:13:36 -0000	1.10
> +++ scope6.c	16 Oct 2004 09:19:53 -0000
> @@ -1,4 +1,4 @@
> -/*	$FreeBSD$	*/
> +/*	$FreeBSD: src/sys/netinet6/scope6.c,v 1.10 2003/10/22 15:13:36 ume Exp $	*/
>  /*	$KAME: scope6.c,v 1.10 2000/07/24 13:29:31 itojun Exp $	*/
>
>  /*
> @@ -71,12 +71,14 @@
>  scope6_ifattach(ifp)
>  	struct ifnet *ifp;
>  {
> -	int s = splnet();
> +
>  	struct scope6_id *sid;

The empty line at the beginning of the function body can go away, since
there *is* at least one local variable present.

> +	/*
> +	 * SID retrieves data from the afdata section of the ifnet
> +	 * structure, but wwe also depend on ifp staying around for a
> +	 * while so lock the list, instead of the smaller afdata lock
> +	 * for the as long as we need either of them.
> +	 */

s/wwe/we/
s/for the as long as/for as long as/

> +	/*
> +	 * Need both the ifp and its afdata to stick around for
> +	 * this call.
> +	 */
> +	IFNET_WLOCK();

Make this a real sentence, please: ``We need both...''.

Regards,
Giorgos



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041016120326.GA34124>