Commit graph

18 commits

Author SHA1 Message Date
Pavel Šimerda
47a3e24d32 netlink: replace libnl 1.x functions
Confusingly, nm-platform-compat's rtnl_link_set_oif adds a new nexthop
with ifindex set, while rtnl_link_set_gateway sets gateway for an
existing nexthop. Keeping the behavior to avoid potential problems.
2013-03-05 23:02:42 +01:00
Pavel Šimerda
dfa799cb40 netlink: clean up header includes 2013-01-25 00:13:39 +01:00
Dan Williams
4dc5e6c92a core: fix ifindex value checks
Kernel ifindexes are always greater than zero (see dev_new_index()
in net/core/dev.c).  Also don't bother warning about ifindex
lookup failures for devices we know aren't kernel network interfaces.
2012-05-17 13:23:39 -05:00
Dan Williams
1ecc9c215c trivial: formatting fixes 2012-03-21 22:58:00 -05:00
Dan Williams
ae34fa900b core: fix erroneous IPv6 routes by making route addition typesafe
Add two helper functions, one for IPv4 and one for IPv6, to ensure
that the core code benefits from compiler type checking when adding
routes.  Previously nm_netlink_route_add() took a void* which meant
we messed up adding IPv6 routes sometimes due to confusion over
what was supposed to be passed to it.  Also fixes what appears to
be a C&P error with add_ip6_route_to_gateway().

Reported by Tomáš Trnka <tomastrnka@gmx.com>
2012-02-13 13:10:23 -06:00
Dan Williams
c4758ef30e core: let callers do error logging for nm_netlink_route_add()
Callers of this function have a better idea of they want to
log errors or not.  Let them handle it, since they already
do, and having a warning here was causing duplicate log
messages.
2012-01-16 10:26:01 -06:00
Dan Williams
6e92c1b606 core: fix leaked return value of nm_netlink_index_to_iface()
This function now returns allocated strings, so we need to make
sure we free them.
2011-10-18 15:28:26 -05:00
Alfredo Matos
d2069c56e8 netlink: fix flags use in nm_netlink_route_add
Flags are not getting set when a route is added (e.g. NLM_F_REPLACE).
Apparently this was fixed in Ubuntu, but I didn't see a patch here, so
here it is.
2011-09-13 10:40:30 -05:00
Alfredo Matos
a73039c0ec libnl: Create a common netlink route add function 2011-08-16 17:11:52 -05:00
Alfredo Matos
83b1b1660f libnl: route delete can return ERANGE in libnl-1 2011-08-16 17:10:30 -05:00
Alfredo Matos
2e32003fd2 libnl3: Fix ESRCH return types
ESRCH becomes NLE_OBJ_NOTFOUND. Includes workaround for libnl
  aliased return value where ESRCH is being converted to a generic
  unspecified error by libnl [1].

  [1] http://git.kernel.org/?p=libs/netlink/libnl.git;a=commit;h=7e9d5f
2011-08-16 16:58:19 -05:00
Dan Williams
b562839df8 core: misc style fixes to libnl compat code 2011-07-30 15:47:39 -05:00
Alfredo Matos
a6c6556831 core: add libnl-2 support with libnl-1 compatibility 2011-07-30 15:47:26 -05:00
Dan Williams
73ddc1e307 core: move route creation to nm-netlink-utils.c 2011-07-22 18:10:28 -05:00
Dan Williams
abb89a7d2a core: move route iteration to nm-netlink-utils.c 2011-07-22 18:09:32 -05:00
Dan Williams
7461e33ce1 core: move route logging to nm-netlink-utils.c 2011-07-22 16:17:10 -05:00
Dan Williams
8b075fcdf2 core: move route deletion to nm-netlink-utils.c 2011-07-22 16:12:44 -05:00
Dan Williams
3a86b5ae34 core: move address checking functionality into separate file
Start to consolidate netlink stuff so we can eventually keep all
the API changes for libnl1 vs. libnl3 in fewer places.
2011-07-22 15:28:35 -05:00