<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:11pt;">
<div><font color="#365F91">Hi Thomas,</font></div>
<div><font color="#365F91"> </font></div>
<div><font color="#365F91">Any patch to fix it? I see one patch on our git tree, because there is little comment, I don't confirm it. The patch information is attached following.</font></div>
<div><font color="#365F91"> </font></div>
<div><font color="#365F91"> </font></div>
<div><font color="#365F91"> </font></div>
<div>avoid dangling co_major_cache reference to NL_AUTO_PROVIDE caches</div>
<div> </div>
<div>authorAlexander Sack <asac@jwsdot.com></div>
<div>Fri, 21 Oct 2011 06:31:39 +0800 (00:31 +0200)</div>
<div>committerThomas Graf <tgraf@redhat.com></div>
<div>Wed, 11 Jan 2012 19:31:40 +0800 (12:31 +0100)</div>
<div>commit9819717444e8f58bcf707aac724488c4d5f4e1d7</div>
<div>tree164d098fc82cb4fbe2967b36623caf475b5b7f3btree | snapshot</div>
<div>parent4a7791eca1268e24225c33ed1c00c140a14cd955commit | diff</div>
<div> </div>
<div> </div>
<div>avoid dangling co_major_cache reference to NL_AUTO_PROVIDE caches</div>
<div> </div>
<div>lib/cache_mngr.c</div>
<div><font face="Times New Roman" color="#365F91"> </font></div>
<div><font face="Times New Roman" color="#365F91"> </font></div>
<div><font face="Times New Roman" color="#365F91"> </font></div>
<div><font color="#365F91">Really thanks for your help.</font></div>
<div><font color="#365F91">-Hanks.Wang</font></div>
<div><font color="#365F91"> </font></div>
<div><font color="#365F91"> </font></div>
<div><font color="#365F91">________________________________________</font></div>
<div><font face="宋体" color="#365F91">发件人<font face="Calibri">: Thomas Graf [tgr@infradead.org] </font>代表<font face="Calibri"> Thomas Graf [tgraf@infradead.org]</font></font></div>
<div><font face="宋体" color="#365F91">发送时间<font face="Calibri">: 2012</font>年<font face="Calibri">4</font>月<font face="Calibri">20</font>日<font face="Calibri"> 1:10</font></font></div>
<div><font face="宋体" color="#365F91">到<font face="Calibri">: Hanks Wang</font></font></div>
<div><font color="#365F91">Cc: libnl@lists.infradead.org; tgraf@redhat.com</font></div>
<div><font face="宋体" color="#365F91">主题<font face="Calibri">: Re: rtnl_route_alloc_cache lost some route messages</font></font></div>
<div><font face="Times New Roman" color="#365F91"> </font></div>
<div><font color="#365F91">On Tue, Apr 17, 2012 at 09:52:25AM +0000, Hanks Wang wrote:</font></div>
<div><font color="#365F91">> Hi all,</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> In libnl3, I found a little problem.</font></div>
<div><font color="#365F91">> When use NL_AUTO_PROVIDE as the third parameter for rtnl_route_alloc_cache, some routing info has been lost! Then use rtnl_route_get_flags to get flags, the result of flags is right.</font></div>
<div><font color="#365F91">> Use 0 as the third parameter "int flags" for rtnl_route_alloc_cache, the routing info is correct, but then use rtnl_route_get_flags to get flags, it will always return zero.</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> I found that GNOME group also found this problem, but I have not found the similar bug in our bug queue. How to understand this problem?</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> uint32_t rtnl_route_get_flags(struct rtnl_route *route)</font></div>
<div><font color="#365F91">> {</font></div>
<div><font color="#365F91">> return route->rt_flags;</font></div>
<div><font color="#365F91">> }</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> int rtnl_route_alloc_cache(struct nl_sock *sk, int family, int flags,</font></div>
<div><font color="#365F91">> struct nl_cache **result)</font></div>
<div><font color="#365F91">> {</font></div>
<div><font color="#365F91">> struct nl_cache *cache;</font></div>
<div><font color="#365F91">> int err;</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> if (!(cache = nl_cache_alloc(&rtnl_route_ops)))</font></div>
<div><font color="#365F91">> return -NLE_NOMEM;</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> cache->c_iarg1 = family;</font></div>
<div><font color="#365F91">> cache->c_iarg2 = flags;</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> if (sk && (err = nl_cache_refill(sk, cache)) < 0) {</font></div>
<div><font color="#365F91">> free(cache);</font></div>
<div><font color="#365F91">> return err;</font></div>
<div><font color="#365F91">> }</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> *result = cache;</font></div>
<div><font color="#365F91">> return 0;</font></div>
<div><font color="#365F91">> }</font></div>
<div><font color="#365F91">></font></div>
<div><font color="#365F91">> Reference for GNOME on this libnl issue:</font></div>
<div><font color="#365F91">> <a href="http://mail.gnome.org/archives/networkmanager-list/2011-September/msg00233.html">
http://mail.gnome.org/archives/networkmanager-list/2011-September/msg00233.html</a></font></div>
<div><font color="#365F91"> </font></div>
<div><font color="#365F91">This is definitely a bug! Is there any chance someone is abusing</font></div>
<div><font color="#365F91">your route cache while you access it?</font></div>
<div><font face="Times New Roman" color="#365F91"> </font></div>
</span></font>
</body>
</html>