1 From: Lubomir Rintel <lkundrak@v3.sk>
2 Date: Mon, 20 Jul 2015 11:01:04 +0200
3 Subject: [PATCH] platform: move link_get_user_ipv6ll_enabled() to nm-platform-linux
4 Source: https://mail.gnome.org/archives/networkmanager-list/2015-July/msg00028.html
6 This fixes build error kernels headers < 3.17.
8 Reported-by: Petr Vorel <petr.vorel@gmail.com>
9 Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
10 Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
12 src/platform/nm-linux-platform.c | 16 ++++++++++++++++
13 src/platform/nm-platform.c | 11 ++---------
14 src/platform/nm-platform.h | 1 +
15 3 files changed, 19 insertions(+), 9 deletions(-)
17 diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
18 index f3a9254..b6b8e33 100644
19 --- a/src/platform/nm-linux-platform.c
20 +++ b/src/platform/nm-linux-platform.c
21 @@ -2987,6 +2987,21 @@ link_set_user_ipv6ll_enabled (NMPlatform *platform, int ifindex, gboolean enable
25 +link_get_user_ipv6ll_enabled (NMPlatform *platform, int ifindex)
27 +#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
29 + const NMPlatformLink *pllink;
31 + pllink = nm_platform_link_get (platform, ifindex);
32 + if (pllink && pllink->inet6_addr_gen_mode_inv)
33 + return _nm_platform_uint8_inv (pllink->inet6_addr_gen_mode_inv) == IN6_ADDR_GEN_MODE_NONE;
40 link_supports_carrier_detect (NMPlatform *platform, int ifindex)
42 const char *name = nm_platform_link_get_name (platform, ifindex);
44 platform_class->link_get_udev_device = link_get_udev_device;
46 platform_class->link_set_user_ipv6ll_enabled = link_set_user_ipv6ll_enabled;
47 + platform_class->link_get_user_ipv6ll_enabled = link_get_user_ipv6ll_enabled;
49 platform_class->link_set_address = link_set_address;
50 platform_class->link_get_permanent_address = link_get_permanent_address;
52 diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c
53 index 8803377..ee4b1a1 100644
54 --- a/src/platform/nm-platform.c
55 +++ b/src/platform/nm-platform.c
58 g_return_val_if_fail (ifindex >= 0, FALSE);
60 -#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
62 - const NMPlatformLink *pllink;
64 - pllink = nm_platform_link_get (self, ifindex);
65 - if (pllink && pllink->inet6_addr_gen_mode_inv)
66 - return _nm_platform_uint8_inv (pllink->inet6_addr_gen_mode_inv) == IN6_ADDR_GEN_MODE_NONE;
69 + if (klass->link_get_user_ipv6ll_enabled)
70 + return klass->link_get_user_ipv6ll_enabled (self, ifindex);
74 diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h
75 index 16eb351..9ef4080 100644
76 --- a/src/platform/nm-platform.h
77 +++ b/src/platform/nm-platform.h
79 GObject *(*link_get_udev_device) (NMPlatform *self, int ifindex);
81 gboolean (*link_set_user_ipv6ll_enabled) (NMPlatform *, int ifindex, gboolean enabled);
82 + gboolean (*link_get_user_ipv6ll_enabled) (NMPlatform *, int ifindex);
84 gboolean (*link_get_permanent_address) (NMPlatform *,