Hi, all.<br><br>I misunderstood the functions defined in rtnl.h. We can check it by looking at the return value. Please, ignore my previous annoying thread. ;-)<br><br>Many thanks.<br><br><div class="gmail_quote">On Tue, Oct 20, 2009 at 3:40 PM, Jong-Hyouk Lee <span dir="ltr">&lt;<a href="mailto:jonghyouk@gmail.com">jonghyouk@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi, all.<br>
<br>
UMIP code involves and uses functions defined in rtnl.h in order to<br>
control routing tables. I have a simple question about the functions.<br>
For instance, when we use &quot;route_add()&quot; in order to add a routing<br>
entry, how can we ensure it has been done successfully? I know the<br>
function has a return value to check its operation. However, it is<br>
only true when the root account executes it. I mean if a normal user<br>
executes it, there is no error mechanism as I know. Is there any other<br>
ways to do it?<br>
<br>
I used the following code for test it.<br>
<br>
#include &lt;sys/types.h&gt;<br>
#include &lt;sys/socket.h&gt;<br>
#include &lt;arpa/inet.h&gt;<br>
<br>
#include &lt;stdio.h&gt;<br>
#include &lt;string.h&gt;<br>
#include &lt;stdlib.h&gt;<br>
<br>
#include &quot;libnetlink.c&quot;<br>
#include &quot;debug.c&quot;<br>
#include &quot;rtnl.c&quot;<br>
<br>
int main(void)<br>
{<br>
    int result = 0;<br>
    char addr[128];<br>
<br>
    const struct in6_addr *st_dest;<br>
<br>
    memset(addr, 0x00, sizeof(addr));<br>
<br>
    inet_pton(AF_INET6, &quot;2010:1:2:3::77&quot;, (void *)&amp;addr);<br>
    st_dest = (void *)&amp;addr;<br>
<br>
    result = route_add(2, RT_TABLE_MAIN, RTPROT_STATIC, 0, 99, NULL,<br>
0, st_dest, 64, NULL);<br>
<br>
    if(result)<br>
        printf(&quot;Done: route_add()\n&quot;);<br>
<br>
    return(0);<br>
}<br>
<br>
Many thanks.<br>
<font color="#888888"><br>
--<br>
IMARA Team, INRIA, France.<br>
Jong-Hyouk Lee.<br>
<br>
#email: jonghyouk (at) gmail (dot) com || jong-hyouk.lee (at) inria (dot) fr<br>
#webpage: <a href="http://hurryon.googlepages.com/" target="_blank">http://hurryon.googlepages.com/</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>IMARA Team, INRIA, France. <br>Jong-Hyouk Lee.<br><br>#email: jonghyouk (at) gmail (dot) com || jong-hyouk.lee (at) inria (dot) fr<br>#webpage: <a href="http://hurryon.googlepages.com/">http://hurryon.googlepages.com/</a><br>