Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 May 2007 07:52:32 -0700 (PDT)
From:      Mehul Vora <mehul_freebsd@yahoo.com>
To:        freebsd-net@freebsd.org
Subject:   Problem with "rt_check" routine.
Message-ID:  <93263.30264.qm@web63604.mail.re1.yahoo.com>

next in thread | raw e-mail | index | archive | help
--0-15606975-1178549552=:30264
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hi,
   
  Current implementation (Version 6.2) of rt_check() routine defined in route.c is not completely  MPSAFE. I found an issue when i started routing with "directisr" enabled. For the first rcvd packet this function initializes rt_gateway of the passed rt_entry. This is done by calling "rtalloc1" routine. But "rt_check" function doesnt hold any lock while calling this function. So incase if we have multiple instances of "ip_input - netisr" running than more than one thread can call this routine which may lead to some corruption, in my case it leads to a dead lock. Problem doesn't happen if before sending heavy traffic a single packet of same kind is sent. But if initially itself heavy traffic is sent than this happens immediately. I have fixed this and it works well after it. Workaround patch for this issue is attached here with. Probably we need to define a macro in route.h for the hardcoded values in the patch. Can any one confirm this ? 
   
  Thanks,
  Mehul.

 
---------------------------------
Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.
--0-15606975-1178549552=:30264
Content-Type: text/plain; name="rt_check.patch.txt"
Content-Description: 206142780-rt_check.patch.txt
Content-Disposition: inline; filename="rt_check.patch.txt"

1260a1261
> try_again:
1280a1282,1289
>
>               if(rt0->rt_flags & 0x80000000U){
>                       /*This rt is under process...*/
>                       RT_UNLOCK(rt);
>                       RT_UNLOCK(rt0);
>                       goto try_again;
>               }
>
1281a1291
>                       rt0->rt_flags |= 0x80000000U;
1288a1299
>                       rt0->rt_flags &= (~0x80000000U);

--0-15606975-1178549552=:30264--




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