summaryrefslogtreecommitdiffstats
path: root/lib/route
Commit message (Collapse)AuthorAgeFilesLines
* route_obj: don't add empty destination to nlmsgDavid Lamparter2010-10-131-1/+2
| | | | | | | | | | don't try to give the kernel an empty RTA_DST attribute. this would previously happening on trying to delete the default route as returned from the kernel. the kernel doesn't add a RTA_DST atttribute, so libnl does nl_addr_alloc(0) and inserts a zero-length RTA_DST attribute into the deletion request, which the kernel then refuses with ERANGE. Signed-off-by: David Lamparter <equinox@diac24.net>
* Trivial fix for TBF memleakDenys Fedorysychenko2010-10-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, running alloc / free cache loop will lead to huge memory leaks on machine with 3000 interfaces with tbf qdiscs. Here was valgrind output: ==5580== 18,070,728 bytes in 347,514 blocks are definitely lost in loss record 32 of 32 ==5580== at 0x4025485: calloc (in /lib/valgrind/vgpreload_memcheck-x86- linux.so) ==5580== by 0x405F410: tbf_msg_parser (tbf.c:46) ==5580== by 0x405302B: qdisc_msg_parser (qdisc.c:119) ==5580== by 0x4033DC9: nl_cache_parse (cache.c:643) ==5580== by 0x4033E7C: update_msg_parser (cache.c:460) ==5580== by 0x4038A11: nl_recvmsgs (netlink-local.h:112) ==5580== by 0x4034175: __cache_pickup (cache.c:483) ==5580== by 0x40343FF: nl_cache_pickup (cache.c:516) ==5580== by 0x403447D: nl_cache_refill (cache.c:698) ==5580== by 0x4034AB7: nl_cache_alloc_and_fill (cache.c:198) ==5580== by 0x4053216: rtnl_qdisc_alloc_cache (qdisc.c:388) ==5580== by 0x80489DB: main (in /home/root/nltest) Patch complied and tested for same test case, no more leaks anymore.
* Let git ignore generated pktloc source filesThomas Graf2010-07-031-0/+4
|
* Packet Location InterfaceThomas Graf2010-07-023-0/+318
|
* addr: add NL_DUMP_ENV functionPatrick McHardy2010-04-191-0/+76
| | | | Signed-off-by: Patrick McHardy <kaber@trash.net>
* addr: restore anycast functionsPatrick McHardy2010-04-191-0/+32
| | | | | | Seems it got lost during some cleanups. Signed-off-by: Patrick McHardy <kaber@trash.net>
* neigh: fix id_attrs to include ifindexPatrick McHardy2010-04-191-1/+1
| | | | | | | Neighbour entries for the same destination may exist on multiple interfaces. Include the interface in the ID attributes. Signed-off-by: Patrick McHardy <kaber@trash.net>
* one more fix, u32.cDenys Fedoryschenko2009-12-071-2/+1
| | | | | | One more segfault, also nl-tctree-list , fix Probably need reformat for better look Patch attached
* invalid comma cause segfault for nl-tctree-list, tbf.cDenys Fedoryschenko2009-12-071-1/+1
| | | | | | I notice segfault while running nl-tctree-list for tbf qdisc. Patch that fix this typo is attached.
* Add support for getting and deleting queueing classes.olc2009-09-021-0/+78
|
* Fix rtnl_addr cachingDan Winship2009-09-021-2/+1
| | | | | | addr_obj.ops.oo_id_attrs included ADDR_ATTR_PEER, so any address that didn't have a peer address set would compare as unequal to itself, meaning it could never be removed from a cache after it was added, etc.
* - Reworked the classifier interface.Thomas Graf2009-09-029-187/+1045
| | | | | | - Added initial ematch support - Added support for the basic classifier - Added support for the cgroup classifier
* restructure module documentation orderThomas Graf2008-12-101-2/+1
| | | | split hiearchy into one top level module per library
* Add internal wait_for_ack() which only waits for ACK if !NL_NO_AUTO_ACKThomas Graf2008-10-208-14/+14
| | | | | This changeset ensures that internal code properly synchronizes to ACKs if ACKs are enabled and otherwise return immediately.
* Error handling for rtnl_cls_set_kind() & addition of rtnl_cls_get_ops()Thomas Graf2008-10-151-1/+11
|
* Use 16bit ints for classifier prio/protocolThomas Graf2008-10-151-4/+4
|
* Only include local addr as peer addr if providedWolfgang Steudel2008-10-101-1/+1
| | | | | | | | | | | | | we're using libnl-1.1 for a project. When trying to delete all addresses of an interface by only setting interface index and address family of an rtnl_addr and executing rtnl_addr_delete() we received some error (I don't remember what it was). The bug(?) is in build_addr_msg() in lib/route/addr.c: IFA_ADDRESS is set to a_local when a_peer is not set, without checking if a_local was set. We just added if (tmpl->ce_mask & ADDR_ATTR_LOCAL) after the "else" (line 496 in the current git).
* Remove XML dumpingThomas Graf2008-06-174-243/+0
| | | | Bloats the library, not frequently used
* Improvements to address utilitiesThomas Graf2008-06-171-134/+89
| | | | | | - Moved env var dumping to nl-addr-list.c - support for ipv6 lifetimes - correct and complete help texts
* Improved printing of route cache entriesThomas Graf2008-06-161-5/+23
|
* Remove old line counting while dumpingThomas Graf2008-05-2323-786/+590
|
* Remove change routine, works flawlessly via add() with NLM_F_REPLACEThomas Graf2008-05-221-65/+8
| | | | This breaks the API but is the right thing to do.
* Improve printing of routing rulesThomas Graf2008-05-221-10/+3
|
* Add rtnl_neigh_get_family()Thomas Graf2008-05-201-0/+5
|
* Remove references to unused attribute anycastThomas Graf2008-05-151-50/+3
|
* Allow parser callbacks to return NL_OK, NL_SKIP, NL_EXITThomas Graf2008-05-159-44/+1
| | | | Obsoletes internal P_ACCEPT/P_IGNORE
* Fix memory leaks when sending of message failedThomas Graf2008-05-156-24/+36
| | | | | Various callers of nl_send_auto_complete() failed to free the allocated message when an error was reported.
* Rename struct nl_handle to struct nl_sockThomas Graf2008-05-1510-129/+121
| | | | | | | | The idea of a common handle is long revised and only misleading, nl_handle really represents a socket with some additional action handlers assigned to it. Alias for nl_handle is kept for backwards compatibility.
* Check length of provided address labelThomas Graf2008-05-141-2/+7
|
* Replace RTNL_LINK_NOT_FOUND with just 0Thomas Graf2008-05-144-30/+9
| | | | | The interface index 0 is reserved and can be safely used to signal that the device does not exist.
* Remove obsolete nla_get_addr() and nla_get_data()Thomas Graf2008-05-148-114/+145
| | | | | | | | Replaces obsolete calls to nla_get_addr() and nla_get_data() with nl_addr_alloc_attr() respectively nl_data_alloc_attr(). Also fixes missing error handling while parsing routing multipath configuration.
* Thread-safe error handlingThomas Graf2008-05-1427-685/+577
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order for the interface to become more thread safe, the error handling was revised to no longer depend on a static errno and error string buffer. This patch converts all error paths to return a libnl specific error code which can be translated to a error message using nl_geterror(int error). The functions nl_error() and nl_get_errno() are therefore obsolete. This change required various sets of function prototypes to be changed in order to return an error code, the most prominent are: struct nl_cache *foo_alloc_cache(...); changed to: int foo_alloc_cache(..., struct nl_cache **); struct nl_msg *foo_build_request(...); changed to: int foo_build_request(..., struct nl_msg **); struct foo *foo_parse(...); changed to: int foo_parse(..., struct foo **); This pretty much only leaves trivial allocation functions to still return a pointer object which can still return NULL to signal out of memory. This change is a serious API and ABI breaker, sorry!
* patch: fixed up support for tables in rulesBen Gamsa2008-05-081-1/+7
|
* Added two new functions to facilitate processing the nexthop entries for routes.Ben Gamsa2008-05-081-0/+28
| | | | | | Added rtnl_route_foreach_nexthop() to walk the list of nexthops invoking a caller-provided callback for each nexthop entry, and added rtnl_route_nexthop_n() to retrieve the Nth nexthop entry in the list.
* Speed up metrics comparisonThomas Graf2008-05-081-18/+11
| | | | | | | Using rtnl_route_get_metric() for route comparison became a bottleneck because each metric which was not available resulted in the generation of an error message. This changeset avoids this by accessing rt_metrics and rt_metrics_mask directly while comparing route objects.
* Fix dumping of iif route attributeThomas Graf2008-05-051-4/+19
|
* Route cache supportThomas Graf2008-05-051-2/+15
| | | | | | This changesets adds the possibility to fill a nl_cache with the contents of the route cache. It also adds the possibility to limit route caches to certain address families.
* Fixed netem_build_msg() delay distribution table existence test.Tad Kollar2008-05-011-3/+9
|
* New netem funtionality and TBF fixTad Kollar2008-04-303-18/+382
| | | | | | | | | | | | | | New netem-related functionality: Added ability to save new settings to the kernel. In netem.c, the netem_get_opts() stub has been replaced with netem_build_msg() which manipulates the nl_msg data directly and returns an error code instead of a new nl_msg. Modifications to qdisc_build() in qdisc.c and struct rtnl_qdisc_ops were necessary for this. Added support for getting/setting corruption probability/correlation. Added support for setting a delay distribution. Fixed tbf_msg_parser() to call tbf_alloc() instead of tbf_qdisc() to prevent a seg fault.
* Big routing code rework (API/ABI BREAK!)Thomas Graf2008-04-298-695/+821
| | | | | | | | | | Adds all missing routing attributes and brings the routing related code to a working state. In the process the API was broken several times with the justification that nobody is using this code yet. The changes include new example code which is also a prototype for how plain CLI tools could look like to control routes.
* Fix 64bit alignment issue on x86_64.Thomas Graf2008-03-311-7/+2
|
* [LIBNL]: Fix minor memleaks on exitPatrick McHardy2008-02-071-0/+10
| | | | | | Make valgrind happy ... Signed-off-by: Patrick McHardy <kaber@trash.net>
* Improve readability of link statistics outputThomas Graf2008-02-071-5/+5
|
* Make vlan_put_attrs() availableThomas Graf2008-01-081-0/+1
|
* Link info interface and vlan supportThomas Graf2008-01-083-11/+775
| | | | | Adds an external interface to implement link info types and implements the type vlan.
* Add support for the IFF_ECHO flagThomas Graf2007-12-191-0/+1
|
* Support link operstate and linkmodeThomas Graf2007-12-191-6/+123
|
* Represent default route with destination address length zeroThomas Graf2007-12-192-9/+13
| | | | | | | | | | So far the destination address for default routes was NULL which complicated the handling of routes in general. By assigning a address of length zero they can be compared to each other. This allows the cache manager to properly handle default routes.
* Fix memory leak when parsing netlink messages into cachesThomas Graf2007-12-179-11/+12
| | | | The reference created by the parsers was never given back.
* Export interface to define cachesThomas Graf2007-09-179-18/+9
| | | | | | | | | | This interface was internal so far which required all code defining caches to be compiled with the sources available. In order to simplify the interface, the co_msg_parser prototype was changed to take the struct nl_parser_param directly instead of a void *. It used to be void * because the co_msg_parser was directly passed as the NL_CB_VALID callback function.