<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
OK i found the bug, is is the patch !!<br>
<br>
Can someone push it into the git tree ?<br>
Regards,<br>
<br>
Romary Sonrier<br>
<br>
=========================<br>
My analysis:<br>
<br>
I guess that the pay load is <b>struct fib_rule_hdr</b><br>
struct fib_rule_hdr {<br>
__u8 family;<br>
__u8 dst_len;<br>
__u8 src_len;<br>
__u8 tos;<br>
<br>
__u8 table;<br>
__u8 res1; /* reserved */<br>
__u8 res2; /* reserved */<br>
__u8 action;<br>
<br>
__u32 flags;<br>
};<br>
<br>
<br>
<blockquote type="cite"> [PAYLOAD] 12 octets<br>
02 00 00 00 0a 00 00 01 00 00 00 00 ............
</blockquote>
so
<pre wrap="">family = 02 , fine
</pre>
table = 10, fine<br>
but <br>
src_len =0 !!!! should be 32<br>
<br>
<br>
Le 03/05/2011 10:55, Romary Sonrier a écrit :
<blockquote cite="mid:4DBFC307.7020705@sonrier.com" type="cite">
<pre wrap="">Thanks for the tips... here is the debug output :
-- Debug: Sent Message:
-------------------------- BEGIN NETLINK MESSAGE
---------------------------
[HEADER] 16 octets
.nlmsg_len = 44
.nlmsg_type = 32 <route/rule::new>
.nlmsg_flags = 1029 <REQUEST,ACK,ATOMIC>
.nlmsg_seq = 1304412847
.nlmsg_pid = 19007
[PAYLOAD] 12 octets
02 00 00 00 0a 00 00 01 00 00 00 00 ............
[ATTR 02] 4 octets
7f 00 00 01 ....
[ATTR 06] 4 octets
64 00 00 00 d...
--------------------------- END NETLINK MESSAGE
---------------------------
-- Debug: Received Message:
-------------------------- BEGIN NETLINK MESSAGE
---------------------------
[HEADER] 16 octets
.nlmsg_len = 36
.nlmsg_type = 2 <ERROR>
.nlmsg_flags = 0 <>
.nlmsg_seq = 1304412847
.nlmsg_pid = 19007
[ERRORMSG] 20 octets
.error = 0 "Success"
[ORIGINAL MESSAGE] 16 octets
.nlmsg_len = 16
.nlmsg_type = 32 <0x20>
.nlmsg_flags = 1029 <REQUEST,ACK,ATOMIC>
.nlmsg_seq = 1304412847
.nlmsg_pid = 19007
--------------------------- END NETLINK MESSAGE
---------------------------
Le 03/05/2011 10:34, Thomas Graf a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">On Tue, May 03, 2011 at 10:03:38AM +0200, Romary Sonrier wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello guys,
I am using libnl 3.0 from git (cc33b0940f8ca0a34c9fbc085963e7887adc4db7)
I am trying to add rules to the kernel routing engine, using libnl.
(kernel 2.6.35-28-generic x86_64 GNU/Linux / Ubuntu)
What i'm trying to do would be , with iproute2 :*ip rule add from
127.0.0.1 table 10 prio 100*
There is not any tool like src/nl-rule-add.c yet, so i did my own , you
can find it as attachement.
It seems that the call :*rtnl_rule_set_src(rule, a)* doesn't have any
effect.
Do you have any idea?
I tried to compare with iproute2 code source, but that's not that easy.
They use a struct "struct rtmsg", that is not use in libnl.
Any help would be welcome....
</pre>
</blockquote>
<pre wrap="">Can you run your program like this:
        NLCB=debug src/nl-rule-add
and post the output? That allows veryfing the netlink message that is being
sent to the kernel.
</pre>
</blockquote>
<pre wrap="">
_______________________________________________
libnl mailing list
<a class="moz-txt-link-abbreviated" href="mailto:libnl@lists.infradead.org">libnl@lists.infradead.org</a>
<a class="moz-txt-link-freetext" href="http://lists.infradead.org/mailman/listinfo/libnl">http://lists.infradead.org/mailman/listinfo/libnl</a>
</pre>
</blockquote>
<br>
</body>
</html>