mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 19:28:04 +02:00
platform: add _support_user_ipv6ll_still_undecided() macro
(cherry picked from commit a2d793f0e1)
This commit is contained in:
parent
521d80dd9d
commit
8d13e08cd3
1 changed files with 5 additions and 2 deletions
|
|
@ -306,13 +306,16 @@ _nl_sock_flush_data (struct nl_sock *sk)
|
||||||
|
|
||||||
#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
|
#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
|
||||||
static int _support_user_ipv6ll = 0;
|
static int _support_user_ipv6ll = 0;
|
||||||
|
#define _support_user_ipv6ll_still_undecided() (G_UNLIKELY (_support_user_ipv6ll == 0))
|
||||||
|
#else
|
||||||
|
#define _support_user_ipv6ll_still_undecided() (FALSE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_support_user_ipv6ll_get (void)
|
_support_user_ipv6ll_get (void)
|
||||||
{
|
{
|
||||||
#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
|
#if HAVE_LIBNL_INET6_ADDR_GEN_MODE
|
||||||
if (G_UNLIKELY (_support_user_ipv6ll == 0)) {
|
if (_support_user_ipv6ll_still_undecided ()) {
|
||||||
_support_user_ipv6ll = -1;
|
_support_user_ipv6ll = -1;
|
||||||
nm_log_warn (LOGD_PLATFORM, "kernel support for IFLA_INET6_ADDR_GEN_MODE %s", "failed to detect; assume no support");
|
nm_log_warn (LOGD_PLATFORM, "kernel support for IFLA_INET6_ADDR_GEN_MODE %s", "failed to detect; assume no support");
|
||||||
} else
|
} else
|
||||||
|
|
@ -329,7 +332,7 @@ _support_user_ipv6ll_detect (const struct rtnl_link *rtnl_link)
|
||||||
/* If we ever see a link with valid IPv6 link-local address
|
/* If we ever see a link with valid IPv6 link-local address
|
||||||
* generation modes, the kernel supports it.
|
* generation modes, the kernel supports it.
|
||||||
*/
|
*/
|
||||||
if (G_UNLIKELY (_support_user_ipv6ll == 0)) {
|
if (_support_user_ipv6ll_still_undecided ()) {
|
||||||
uint8_t mode;
|
uint8_t mode;
|
||||||
|
|
||||||
if (rtnl_link_inet6_get_addr_gen_mode ((struct rtnl_link *) rtnl_link, &mode) == 0) {
|
if (rtnl_link_inet6_get_addr_gen_mode ((struct rtnl_link *) rtnl_link, &mode) == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue