Commit Graph

17 Commits

Author SHA1 Message Date
Pavel Šimerda
423d766b03 build: implement libnl version selection
Until we remove libnl-1.x and libnl-2.x support, it should be
possible to choose the libnl version at build time. This is
mostly important for testing legacy libnl support but it also
helps distributions that ship other tools built agains them.

(https://bugs.gentoo.org/show_bug.cgi?id=441750)
2012-11-22 18:03:16 +01:00
Weiping Pan
0878546df0 vlan: add compatible functions for libnl1
If we want to support vlan without libnl3,
then we can use ioctl.

Changelog:
V2: fix identation and comments.

Signed-off-by: Weiping Pan <wpan@redhat.com>
2012-02-24 14:31:41 -06:00
Jiří Klimeš
261d760a8b netlink: fix build on libnl1/2 2012-02-20 10:55:01 +01:00
Dan Williams
0c3efb1787 vlan: rework VLAN interface creation/deletion
First make it build on libnl1/2.  Second, the VLAN
virtual interface name might not always be given in the
NMConnection (if the master is a UUID and thus the name
is determined automatically) so just take the interface
name instead.  And make sure we verify it's a VLAN
interface before deleting it.

Lastly, construct the VLAN interface name if it's not
given in the NMConnection.  This means we need to know
the master interface name when creating the connection,
which we always will since you can't create the VLAN
interface without it's master being present.  That also
means we need to return the name to the caller so it
can be used to create the NMDevice for the VLAN interface
after we've created it in the kernel.
2012-02-16 15:05:55 -06:00
Weiping Pan
0ec51387c0 netlink: use correct preprocessor if format
I only install libnl-3.2.3 on my system, and I met an error:

In file included from ../../src/nm-netlink-monitor.h:93:0,
from nm-vpn-connection.c:48:
../../src/nm-netlink-compat.h:210:5: error: "HAVE_LIBNL1" is not defined
../../src/nm-netlink-compat.h:210:20: error: "HAVE_LIBNL2" is not defined
make[5]: *** [libvpn_manager_la-nm-vpn-connection.lo] Error 1

Signed-off-by: Weiping Pan <wpan@redhat.com>
2011-11-21 15:33:58 -06:00
Thomas Graf
9b05037c44 nl80211: use genl_ctrl_resolve()
Based on a patch for iw by Johannes Berg <johannes.berg@intel.com>

This simplifies the code quite a bit since we don't need
an nl_cache or nl_family anymore.

genl_ctrl_resolve() is available in libnl1.1, libnl2 and libnl3.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-14 18:42:49 -06:00
Thomas Graf
e654bb8d1d netlink: Fix #if check if HAVE_LIBNL1 and HAVE_LIBNL2 are not defined
Need to use #if defined HAVE_LIBNL1 instead of #if HAVE_LIBNL1.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:24:04 -06:00
Thomas Graf
b496355b2a bonding: enslave/release bonding slaves in activation/deactivation
Code is written generic enough to allow easy addition of further master/slave
relationships such as bridging relations.

Signed-off-by: Thomas Graf <tgraf@redhat.com>

(whitespace cleanups and libnl compat by dcbw)
2011-11-09 23:24:04 -06:00
Thomas Graf
8d5af59812 bonding: detect virtual bonding devices and create an ethernet device
A bonding device is like a virtual ethernet device. We therefore reuse
nm-device-ethernet and add some special handling to detect bonding
connections.

Changes v2:
 - Fixed memory leak

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:16:31 -06:00
Thomas Graf
095aff0c21 bonding: kernel bonding device creation
Creates virtual kernel devices as needed. Since the manager is
initialized after the connections have been loaded no
CONNECTIONS_ADDED notification is received for connections parsed
at startup.

Therefore walks the loaded connections looking for bonding
connections.

Connections added on the fly are handled via the notifications.

Connection renaming and deleting is not supported yet.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:16:31 -06:00
Johannes Berg
ba8527ca58 wifi: preliminary nl80211 patch
Add nl80211 support to wifi utils.
2011-11-09 21:28:02 -06:00
Dan Williams
7956d661ee core: fix builds with libnl2 2011-10-04 13:20:11 -05:00
Dan Williams
43a6f8a003 netlink: alias nlmsg_datalen() for libnl1 2011-09-13 00:08:30 -05:00
Alfredo Matos
638d3beb01 libnl: Use compat return for nl_route_add() 2011-08-16 17:08:57 -05:00
Dan Williams
b562839df8 core: misc style fixes to libnl compat code 2011-07-30 15:47:39 -05:00
Alfredo Matos
daeb181fa2 core: add libnl-3 API compatibility 2011-07-30 15:47:33 -05:00
Alfredo Matos
a6c6556831 core: add libnl-2 support with libnl-1 compatibility 2011-07-30 15:47:26 -05:00