]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/network-manager/0001-platform-move-link_get_user_ipv6ll_enabled-to-nm-platform-linux.patch
4aebaef8200af0159aa5631801a8f94b00b27f6d
[coffee/buildroot.git] / package / network-manager / 0001-platform-move-link_get_user_ipv6ll_enabled-to-nm-platform-linux.patch
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
5
6 This fixes build error kernels headers < 3.17.
7
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>
11 ---
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(-)
16
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
22  }
23
24  static gboolean
25 +link_get_user_ipv6ll_enabled (NMPlatform *platform, int ifindex)
26 +{
27 +#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
28 +       {
29 +               const NMPlatformLink *pllink;
30 +
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;
34 +       }
35 +#endif
36 +       return FALSE;
37 +}
38 +
39 +static gboolean
40  link_supports_carrier_detect (NMPlatform *platform, int ifindex)
41  {
42         const char *name = nm_platform_link_get_name (platform, ifindex);
43 @@ -4968,6 +4968,7 @@
44         platform_class->link_get_udev_device = link_get_udev_device;
45
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;
48
49         platform_class->link_set_address = link_set_address;
50         platform_class->link_get_permanent_address = link_get_permanent_address;
51
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
56 @@ -965,15 +965,8 @@
57
58         g_return_val_if_fail (ifindex >= 0, FALSE);
59
60 -#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
61 -       {
62 -               const NMPlatformLink *pllink;
63 -
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;
67 -       }
68 -#endif
69 +       if (klass->link_get_user_ipv6ll_enabled)
70 +               return klass->link_get_user_ipv6ll_enabled (self, ifindex);
71         return FALSE;
72  }
73
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
78 @@ -446,6 +446,7 @@
79         GObject *(*link_get_udev_device) (NMPlatform *self, int ifindex);
80
81         gboolean (*link_set_user_ipv6ll_enabled) (NMPlatform *, int ifindex, gboolean enabled);
82 +       gboolean (*link_get_user_ipv6ll_enabled) (NMPlatform *, int ifindex);
83
84         gboolean (*link_get_permanent_address) (NMPlatform *,
85                                                 int ifindex,
86 --
87 2.4.3