Trying to debug a libnl3 issue with NM (adding IPv6 default gateway)

Mathieu Trudel-Lapierre mathieu.tl at gmail.com
Fri Sep 30 16:38:39 EDT 2011


Hi,

I'm trying to debug an issue I'm seeing with NetworkManager built
against libnl3 (3.0). Seems like although everything appears to be
there to add the default gateway route, it fails to do so with a
"Missing attribute" error.

Now, I eventually found out that the Missing attribute error was due
to the lack of a dst attribute for the route, but when I add that I'm
running into another issue:
"Object not found" is returned by NM. In reality, what appears to
happen is that I get a response with a -19 error (No such device).
Couldn't really find out why.

The (almost) exact same code works properly in libnl1; so I'm thinking
some other changes introduced with libnl3 are breaking this. I'm
saying "almost" the same code because there is some level of
abstraction to support both versions of the library in NM.

I wrote two small test case programs to try and figure out what is
going wrong: a libnl3 version (add_route.c) and a libnl1 version
(add_route1.c) that should achieve just about the same as what is
being done by NM. The libnl1 version works properly, the libnl3
version fails, as above, with "No such device":

mtrudel at gaea ~ % gcc -o test-add-route add_route.c -lnl -lnl-route
mtrudel at gaea ~ % sudo NLCB=debug ./test-add-route
[sudo] password for mtrudel:
Failed to read classid file: Object not found
-- Debug: Sent Message:
--------------------------   BEGIN NETLINK MESSAGE ---------------------------
  [HEADER] 16 octets
    .nlmsg_len = 96
    .nlmsg_type = 24 <route/route::new>
    .nlmsg_flags = 1029 <REQUEST,ACK,ATOMIC>
    .nlmsg_seq = 1317414708
    .nlmsg_pid = 6239
  [PAYLOAD] 12 octets
    0a 00 00 00 fe 04 00 01 00 00 00 00                   ............
  [ATTR 15] 4 octets
    fe 00 00 00                                           ....
  [ATTR 01] 16 octets
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00       ................
  [ATTR 06] 4 octets
    00 00 00 00                                           ....
  [ATTR 09] 28 octets
    1c 00 00 00 03 00 00 00 14 00 05 00 fe 80 00 00 00 00 ..................
    00 00 02 26 5a ff fe fd ba 38                         ...&Z....8
---------------------------  END NETLINK MESSAGE   ---------------------------
-- Debug: Received Message:
--------------------------   BEGIN NETLINK MESSAGE ---------------------------
  [HEADER] 16 octets
    .nlmsg_len = 116
    .nlmsg_type = 2 <ERROR>
    .nlmsg_flags = 0 <>
    .nlmsg_seq = 1317414708
    .nlmsg_pid = 6239
  [ERRORMSG] 20 octets
    .error = -19 "No such device"
  [ORIGINAL MESSAGE] 16 octets
    .nlmsg_len = 16
    .nlmsg_type = 24 <0x18>
    .nlmsg_flags = 1029 <REQUEST,ACK,ATOMIC>
    .nlmsg_seq = 1317414708
    .nlmsg_pid = 6239
---------------------------  END NETLINK MESSAGE   ---------------------------
-- Error received: No such device
-- Original message: type=0x18 length=96 flags=<REQUEST,ACK,ATOMIC>
sequence-nr=1317414708 pid=6239
12 mtrudel at gaea ~ %

The "12" above here is just return code for the command; NOTFOUND due
to the rewriting of the NLE_FAILURE error into that (which is also
what NM does).

Any help would be much appreciated.

Kind regards,

Mathieu Trudel-Lapierre <mathieu.tl at gmail.com>
Freenode: cyphermox, Jabber: mathieu.tl at gmail.com
4096R/EE018C93 1967 8F7D 03A1 8F38 732E  FF82 C126 33E1 EE01 8C93
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_route1.c
Type: text/x-csrc
Size: 1522 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20110930/8999ace5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_route.c
Type: text/x-csrc
Size: 1418 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20110930/8999ace5/attachment-0001.bin>


More information about the libnl mailing list