[PATCH] IPV6: inappropriate static variable in net/ipv6/ndisc.c

STALE8510d

2 messages, 2 authors, 2003-06-26 · open the first message on its own page

[PATCH] IPV6: inappropriate static variable in net/ipv6/ndisc.c

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2003-06-26 05:21:09

Hello.

It is not appropriate to use static variable here.

--yoshfuji

Index: linux-2.5/net/ipv6/ndisc.c
===================================================================
RCS file: /home/cvs/linux-2.5/net/ipv6/ndisc.c,v
retrieving revision 1.40
diff -u -p -r1.40 ndisc.c
--- linux-2.5/net/ipv6/ndisc.c	21 Jun 2003 16:21:01 -0000	1.40
+++ linux-2.5/net/ipv6/ndisc.c	26 Jun 2003 03:58:58 -0000
@@ -423,7 +423,7 @@ static void ndisc_send_na(struct net_dev
 		   struct in6_addr *daddr, struct in6_addr *solicited_addr,
 	 	   int router, int solicited, int override, int inc_opt) 
 {
-	static struct in6_addr tmpaddr;
+	struct in6_addr tmpaddr;
 	struct inet6_ifaddr *ifp;
 	struct inet6_dev *idev;
 	struct flowi fl;
-- 
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

Re: [PATCH] IPV6: inappropriate static variable in net/ipv6/ndisc.c

From: David S. Miller <hidden>
Date: 2003-06-26 05:23:42

   From: YOSHIFUJI Hideaki / 吉藤英明 [off-list ref]
   Date: Thu, 26 Jun 2003 14:21:09 +0900 (JST)

   It is not appropriate to use static variable here.
   
It used to be actually needed when ipv6 flows contained
pointers to addresses, and yes that was racey.
   
I'll apply this, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help