| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In a simple test program that queries the source IP for a given
destination address I get a crash in the call to rtnl_link_alloc_cache.
Here is the stack trace (created with version 3.2.4):
Program received signal SIGSEGV, Segmentation fault.
0xb7eb7553 in strlen () from /lib/libc.so.6
(gdb) bt
#0 0xb7eb7553 in strlen () from /lib/libc.so.6
#1 0xb7eb7285 in strdup () from /lib/libc.so.6
#2 0xb7fcc305 in nla_strdup (nla=0x0) at attr.c:1033
#3 0xb7f9c173 in link_msg_parser (ops=0xb7fc2940, who=0x804b330, n=0x804c3e8, pp=0xbffffbf8) at route/link.c:486
#4 0xb7fcd485 in nl_cache_parse (ops=0xb7fc2940, who=0x804b330, nlh=0x804c3e8, params=0xbffffbf8) at cache.c:724
#5 0xb7fcd547 in update_msg_parser (msg=0x804b328, arg=0xbffffbb8) at cache.c:531
#6 0xb7fd1f25 in nl_cb_call (cb=<optimized out>, msg=<optimized out>, type=<optimized out>) at ../include/netlink-local.h:126
#7 recvmsgs (cb=<optimized out>, sk=<optimized out>) at nl.c:729
#8 nl_recvmsgs (sk=0x804b2d0, cb=0x804b368) at nl.c:780
#9 0xb7fcd5fd in __cache_pickup (sk=0x804b2d0, cache=<optimized out>, param=0xbffffbf8) at cache.c:560
#10 0xb7fcd83f in nl_cache_pickup (sk=0x804b2d0, cache=0x804b308) at cache.c:593
#11 0xb7fcd8c8 in nl_cache_refill (sk=0x804b2d0, cache=0x804b308) at cache.c:780
#12 0xb7f9d1fc in rtnl_link_alloc_cache (sk=0x804b2d0, family=4, result=0xbffffcd4) at route/link.c:868
#13 0x08048fd0 in libnl_init (data=<optimized out>) at helper_route.c:60
#14 iproute_get_source (destination=0xbffffeff "127.0.0.1",
source=0xbffffd0f "\b\004c\370\267\364_\370\267\260\224\004\b8\375\377\277e\024\347\267\320\016\377\267\273\224\004\b\364_\370\267\260\224\004\b", source_size=17)
at helper_route.c:105
#15 0x08048e6a in main (argc=2, argv=0xbffffde4) at ip_route_get.c:25
The attached patch (against 3.2.4) solves the problem, fixing something that
looks like a typo. The bug is still present in current Git master.
|
|
|
|
| |
Signed-off-by: Brett Ciphery <brett.ciphery@windriver.com>
|
| |
|
| |
|
|
|
|
|
|
|
| |
The existing declarations refered to non-existing functions so removing
them is safe.
Signed-off-by: Thomas Graf <tgraf@redhat.com>
|
|
|
|
| |
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
|
|
|
|
|
|
|
|
| |
store type kind in rtnl_link independently. That would allow to use this
value even if type_ops are not present. This allows for example to
create devices of type unknown to libnl.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
|
| |
|
| |
|
|
|
|
|
|
| |
this makes all set_master functions work.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
|
|
|
|
|
|
| |
Adds rtnl_link_enslave() / rtnl_link_release() providing a genreic
link enslaving/release API for use with all link types which use
the IFLA_MASTER property.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
RTM_DELLINK and RTM_NEWLINK bridging notifications should not delete/add
entries to a link cache.
|
|
|
|
|
| |
Certain notifications need to be filtered out and should not be applied to
a cache when a cache is handled by a cache manager.
|
|
|
|
| |
Problem found and fix proposed by Andrew Kraslavsky <andykras@hotmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only use the MULTIPATH attribute when adding routes with more than one
next hop.
This solves issues with two scenarios:
1. Adding an IPv4 route to a kernel configured without
CONFIG_IP_ROUTE_MULTIPATH=y.
2. Adding an IPv6 route in general, since the MULTIPATH attribute is not
supported there.
Signed-off-by: Michael Altizer <xiche@verizon.net>
|
|
|
|
| |
Signed-off-by: Michael Altizer <xiche@verizon.net>
|
|
|
|
| |
Signed-off-by: Michael Altizer <xiche@verizon.net>
|
|
|
|
| |
Signed-off-by: Jiří Župka <jzupka@redhat.com>
|
|
|
|
|
| |
Added more details on the changes to where and how libnl is being
instaslled since 3.2.0
|
| |
|
| |
|
|
|
|
|
| |
(Would be a good idea to change the header guard name when c&p
an existing header file to create a new one.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although it has been possible to create bonding devices, enslave and
release using the regular link API. The added API simplifies usage
and hides some of the compatibility logic.
F.e. enslave() and release() will both verify that the master assignment
has in fact been changed and return -NLE_OPNOTSUPP if it did not.
Also the API will make sure to use RTM_NEWLINK or RTM_SETLINK depending
on what is availble.
Examples are provided in src/ as nl-link-enslave.c and nl-link-release.c
|
|
|
|
|
|
| |
When requesting a single link with RTM_GETLINK (no dump) the
RTM_NEWLINK carrying the answer will be followed by an ACK
we have to wait for.
|
|
|
|
|
| |
Commit a73cb2f26932d90a2d47a28e9c524e7f33dcffbd missed to change the
EXTRA_DATA section
|
| |
|
| |
|
|
|
|
| |
Fixes a gcc warning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It has been a request that multiple libnl versions should be installabe
in parallel.
In order to achieve this, the basename of the library was changed to
libnl-3 which reflects the 3rd generation of libnl APIs. It also means
that release based library versioning is left behind and libtool
versioning is used instead.
Projects using pkgconfig will automatically link against the new library
basename and will not notice a difference.
The SO versioning is based on the glib model:
current := 100 * minor + micro - revision
revision := revision
age := age (number of backwards compatible versions)
|
|
|
|
|
|
| |
I observed that with the RedHat build target in the Open Build
Service, files were put into /etc rather than /etc/libnl.
Self-referential variables are a bad idea, and so just avoid this.
|
| |
|
|
|
|
|
| |
This allows for multiple major versions to be installed in parallel. Pkg-config
files are adapted to provide appropriate cflags to find new header locations.
|
| |
|
| |
|
|
|
|
|
| |
Fall back to using libnl-*.3.pc files. It may be common to have multiple
generations of libnl installed but unlikely within the same major release.
|
| |
|
|
|
|
| |
There is no code licensed GPL-3.0 so we might as well remove this file.
|
|
|
|
|
|
|
|
| |
As Jan Engelhardt pointed out, pktloc.c is currently licenses under the GPL
rather than the LGPL. This is a result of its previous existance in src/
which is GPL licensed. I missed to change its license when moving it to
lib/. Since I am the only contributor to the code, I am changing the license
hereby.
|
|
|
|
|
| |
Allows building without python and swig. Readd this using --enable-python
at some point.
|
|
|
|
| |
This patch fixes an unaligned access for IPv6. On systems with strict alignment requirements, the unaligned access will either result in garbage data or a crash.
|
|
|
|
|
|
|
|
|
|
| |
Now the return value in case group id is not find is 0. Change it to
return -NLE_OBJ_NOTFOUND which makes more sense. This should not break
anything because genl_ctrl_grp_by_name is static and called only from
genl_ctrl_resolve_grp. genl_ctrl_resolve_grp already might return
-NLE_OBJ_NOTFOUND.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
|
|
|
|
| |
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
|
|
|
|
|
|
|
| |
This function does the same as nl_socket_modify_cb except for error
callback
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
|
|
|
|
| |
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've found a bug in the following scenario (fragment of code):
while (1) {
struct nl_sock *sk = nl_socket_alloc();
if (sk == NULL) {
fprintf(stderr, "Failed to allocate nl socket\n");
break;
}
nl_socket_set_local_port(sk, 0);
nl_socket_free(sk);
}
The problem is that nl_socket_set_local_port(, 0) does not
release local port if it is allocated before.
|