merge: branch 'support_accept_all_mac_addresses' into 'main'

core: Support accept-all-mac-addresses

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/810
This commit is contained in:
Beniamino Galvani 2021-04-22 19:40:21 +00:00
commit 0500c6f923
33 changed files with 1318 additions and 1012 deletions

View file

@ -265,7 +265,7 @@ pppoe_vcc_config(NMDeviceAdsl *self)
_LOGD(LOGD_ADSL, "ATM setup successful");
/* otherwise we're good for stage3 */
nm_platform_link_set_up(nm_device_get_platform(device), priv->nas_ifindex, NULL);
nm_platform_link_change_flags(nm_device_get_platform(device), priv->nas_ifindex, IFF_UP, TRUE);
return TRUE;
}

View file

@ -693,6 +693,8 @@ typedef struct _NMDevicePrivate {
} stats;
bool mtu_force_set_done : 1;
NMOptionBool promisc_reset;
} NMDevicePrivate;
G_DEFINE_ABSTRACT_TYPE(NMDevice, nm_device, NM_TYPE_DBUS_OBJECT)
@ -2978,10 +2980,10 @@ nm_device_take_over_link(NMDevice *self, int ifindex, char **old_name, GError **
/* Rename the link to the device ifname */
if (up)
nm_platform_link_set_down(platform, ifindex);
nm_platform_link_change_flags(platform, ifindex, IFF_UP, FALSE);
success = nm_platform_link_set_name(platform, ifindex, nm_device_get_iface(self));
if (up)
nm_platform_link_set_up(platform, ifindex, NULL);
nm_platform_link_change_flags(platform, ifindex, IFF_UP, TRUE);
if (!success) {
nm_utils_error_set(error, NM_UTILS_ERROR_UNKNOWN, "failure renaming link %d", ifindex);
@ -3109,7 +3111,7 @@ _set_ip_ifindex(NMDevice *self, int ifindex, const char *ifname)
nm_platform_link_set_user_ipv6ll_enabled(platform, priv->ip_ifindex, TRUE);
if (!nm_platform_link_is_up(platform, priv->ip_ifindex))
nm_platform_link_set_up(platform, priv->ip_ifindex, NULL);
nm_platform_link_change_flags(platform, priv->ip_ifindex, IFF_UP, TRUE);
}
/* We don't care about any saved values from the old iface */
@ -5289,6 +5291,8 @@ device_update_interface_flags(NMDevice *self, const NMPlatformLink *plink)
flags |= NM_DEVICE_INTERFACE_FLAG_UP;
if (plink && NM_FLAGS_HAS(plink->n_ifi_flags, IFF_LOWER_UP))
flags |= NM_DEVICE_INTERFACE_FLAG_LOWER_UP;
if (plink && NM_FLAGS_HAS(plink->n_ifi_flags, IFF_PROMISC))
flags |= NM_DEVICE_INTERFACE_FLAG_PROMISC;
if (NM_FLAGS_ALL(priv->capabilities,
NM_DEVICE_CAP_CARRIER_DETECT | NM_DEVICE_CAP_NONSTANDARD_CARRIER)) {
@ -5301,7 +5305,8 @@ device_update_interface_flags(NMDevice *self, const NMPlatformLink *plink)
set_interface_flags_full(self,
NM_DEVICE_INTERFACE_FLAG_UP | NM_DEVICE_INTERFACE_FLAG_LOWER_UP
| NM_DEVICE_INTERFACE_FLAG_CARRIER,
| NM_DEVICE_INTERFACE_FLAG_CARRIER
| NM_DEVICE_INTERFACE_FLAG_PROMISC,
flags,
TRUE);
}
@ -8432,8 +8437,10 @@ activate_stage2_device_config(NMDevice *self)
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
NMDeviceClass * klass;
NMActStageReturn ret;
NMSettingWired * s_wired;
gboolean no_firmware = FALSE;
CList * iter;
NMTernary accept_all_mac_addresses;
nm_device_state_changed(self, NM_DEVICE_STATE_CONFIG, NM_DEVICE_STATE_REASON_NONE);
@ -8491,6 +8498,25 @@ activate_stage2_device_config(NMDevice *self)
nm_device_queue_recheck_assume(info->slave);
}
s_wired = nm_device_get_applied_setting(self, NM_TYPE_SETTING_WIRED);
accept_all_mac_addresses =
s_wired ? nm_setting_wired_get_accept_all_mac_addresses(s_wired) : NM_TERNARY_DEFAULT;
if (accept_all_mac_addresses != NM_TERNARY_DEFAULT) {
int ifi_flags;
ifi_flags = nm_platform_link_get_ifi_flags(nm_device_get_platform(self),
nm_device_get_ip_ifindex(self),
IFF_PROMISC);
if (ifi_flags >= 0 && ((!!ifi_flags) != (!!accept_all_mac_addresses))) {
nm_platform_link_change_flags(nm_device_get_platform(self),
nm_device_get_ip_ifindex(self),
IFF_PROMISC,
!!accept_all_mac_addresses);
if (priv->promisc_reset == NM_OPTION_BOOL_DEFAULT)
priv->promisc_reset = !accept_all_mac_addresses;
}
}
lldp_setup(self, NM_TERNARY_DEFAULT);
nm_device_activate_schedule_stage3_ip_config_start(self);
@ -11830,7 +11856,7 @@ activate_stage5_ip_config_result_x(NMDevice *self, int addr_family)
if (!nm_platform_link_is_up(nm_device_get_platform(self), ip_ifindex)
&& !nm_device_sys_iface_state_is_external_or_assume(self)) {
nm_platform_link_set_up(nm_device_get_platform(self), ip_ifindex, NULL);
nm_platform_link_change_flags(nm_device_get_platform(self), ip_ifindex, IFF_UP, TRUE);
if (!nm_platform_link_is_up(nm_device_get_platform(self), ip_ifindex))
_LOGW(LOGD_DEVICE,
"interface %s not up for IP configuration",
@ -14046,6 +14072,7 @@ nm_device_bring_up(NMDevice *self, gboolean block, gboolean *no_firmware)
gboolean device_is_up = FALSE;
NMDeviceCapabilities capabilities;
int ifindex;
int r;
g_return_val_if_fail(NM_IS_DEVICE(self), FALSE);
@ -14061,7 +14088,9 @@ nm_device_bring_up(NMDevice *self, gboolean block, gboolean *no_firmware)
if (ifindex <= 0) {
/* assume success. */
} else {
if (!nm_platform_link_set_up(nm_device_get_platform(self), ifindex, no_firmware))
r = nm_platform_link_change_flags(nm_device_get_platform(self), ifindex, IFF_UP, TRUE);
NM_SET_OUT(no_firmware, (r == -NME_PL_NO_FIRMWARE));
if (r < 0)
return FALSE;
}
@ -14148,7 +14177,7 @@ nm_device_take_down(NMDevice *self, gboolean block)
return;
}
if (!nm_platform_link_set_down(nm_device_get_platform(self), ifindex))
if (!nm_platform_link_change_flags(nm_device_get_platform(self), ifindex, IFF_UP, FALSE))
return;
device_is_up = nm_device_is_up(self);
@ -16001,6 +16030,14 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu
_ethtool_state_reset(self);
if (priv->promisc_reset != NM_OPTION_BOOL_DEFAULT && ifindex > 0) {
nm_platform_link_change_flags(nm_device_get_platform(self),
ifindex,
IFF_PROMISC,
!!priv->promisc_reset);
priv->promisc_reset = NM_OPTION_BOOL_DEFAULT;
}
_cleanup_generic_post(self, cleanup_type);
}
@ -18206,6 +18243,8 @@ nm_device_init(NMDevice *self)
priv->v4_commit_first_time = TRUE;
priv->v6_commit_first_time = TRUE;
priv->promisc_reset = NM_OPTION_BOOL_DEFAULT;
}
static GObject *

View file

@ -78,8 +78,8 @@ fixture_setup(test_fixture *fixture, gconstpointer user_data)
fixture->ifindex1 =
nmtstp_link_get_typed(NM_PLATFORM_GET, -1, IFACE_VETH1, NM_LINK_TYPE_VETH)->ifindex;
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, fixture->ifindex0, NULL));
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, fixture->ifindex1, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, fixture->ifindex0, IFF_UP, TRUE) >= 0);
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, fixture->ifindex1, IFF_UP, TRUE) >= 0);
fixture->hwaddr0 =
nm_platform_link_get_address(NM_PLATFORM_GET, fixture->ifindex0, &fixture->hwaddr0_len);

View file

@ -10,6 +10,7 @@
#include <fcntl.h>
#include <termios.h>
#include <linux/if.h>
#include <linux/rtnetlink.h>
#include "libnm-core-intern/nm-core-internal.h"
@ -799,8 +800,10 @@ nm_modem_ip4_pre_commit(NMModem *modem, NMDevice *device, NMIP4Config *config)
g_assert(address);
if (address->plen == 32)
nm_platform_link_set_noarp(nm_device_get_platform(device),
nm_device_get_ip_ifindex(device));
nm_platform_link_change_flags(nm_device_get_platform(device),
nm_device_get_ip_ifindex(device),
IFF_NOARP,
TRUE);
}
}
@ -1199,7 +1202,7 @@ deactivate_cleanup(NMModem *self, NMDevice *device, gboolean stop_ppp_manager)
nm_platform_ip_route_flush(platform, AF_UNSPEC, ifindex);
nm_platform_ip_address_flush(platform, AF_UNSPEC, ifindex);
nm_platform_link_set_down(platform, ifindex);
nm_platform_link_change_flags(platform, ifindex, IFF_UP, FALSE);
}
}
}

View file

@ -12,6 +12,7 @@
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/if.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/resource.h>
@ -508,7 +509,7 @@ main(int argc, char *argv[])
* physical interfaces.
*/
nm_log_dbg(LOGD_CORE, "setting up local loopback");
nm_platform_link_set_up(NM_PLATFORM_GET, 1, NULL);
nm_platform_link_change_flags(NM_PLATFORM_GET, 1, IFF_UP, TRUE);
success = TRUE;

View file

@ -503,6 +503,21 @@ link_set_flags(NMPlatform *platform, NMFakePlatformLink *device, guint n_ifi_fla
link_set_obj(platform, device, obj_tmp);
}
static int
link_change_flags(NMPlatform *platform, int ifindex, unsigned flags_mask, unsigned flags_set)
{
NMFakePlatformLink *device = link_get(platform, ifindex);
if (!device)
return -ENOENT;
link_set_flags(platform,
device,
NM_FLAGS_ASSIGN_MASK(device->obj->link.n_ifi_flags, flags_mask, flags_set));
return 0;
}
static void
link_changed(NMPlatform * platform,
NMFakePlatformLink *device,
@ -540,65 +555,6 @@ link_changed(NMPlatform * platform,
}
}
static gboolean
link_set_up(NMPlatform *platform, int ifindex, gboolean *out_no_firmware)
{
NMFakePlatformLink *device = link_get(platform, ifindex);
if (out_no_firmware)
*out_no_firmware = FALSE;
if (!device) {
_LOGE("failure changing link: netlink error (No such device)");
return FALSE;
}
link_set_flags(platform, device, NM_FLAGS_ASSIGN(device->obj->link.n_ifi_flags, IFF_UP, TRUE));
return TRUE;
}
static gboolean
link_set_down(NMPlatform *platform, int ifindex)
{
NMFakePlatformLink *device = link_get(platform, ifindex);
if (!device) {
_LOGE("failure changing link: netlink error (No such device)");
return FALSE;
}
link_set_flags(platform, device, NM_FLAGS_UNSET(device->obj->link.n_ifi_flags, IFF_UP));
return TRUE;
}
static gboolean
link_set_arp(NMPlatform *platform, int ifindex)
{
NMFakePlatformLink *device = link_get(platform, ifindex);
if (!device) {
_LOGE("failure changing link: netlink error (No such device)");
return FALSE;
}
link_set_flags(platform, device, NM_FLAGS_UNSET(device->obj->link.n_ifi_flags, IFF_NOARP));
return TRUE;
}
static gboolean
link_set_noarp(NMPlatform *platform, int ifindex)
{
NMFakePlatformLink *device = link_get(platform, ifindex);
if (!device) {
_LOGE("failure changing link: netlink error (No such device)");
return FALSE;
}
link_set_flags(platform, device, NM_FLAGS_SET(device->obj->link.n_ifi_flags, IFF_NOARP));
return TRUE;
}
static int
link_set_address(NMPlatform *platform, int ifindex, gconstpointer addr, size_t len)
{
@ -1354,14 +1310,11 @@ nm_fake_platform_class_init(NMFakePlatformClass *klass)
platform_class->link_add = link_add;
platform_class->link_delete = link_delete;
platform_class->link_set_up = link_set_up;
platform_class->link_set_down = link_set_down;
platform_class->link_set_arp = link_set_arp;
platform_class->link_set_noarp = link_set_noarp;
platform_class->link_set_address = link_set_address;
platform_class->link_set_mtu = link_set_mtu;
platform_class->link_change_flags = link_change_flags;
platform_class->link_get_driver_info = link_get_driver_info;
platform_class->link_supports_carrier_detect = link_supports_carrier_detect;

View file

@ -235,7 +235,7 @@ test_ip4_address_general_2(void)
/* Looks like addresses are not announced by kernel when the interface
* is down. Link-local IPv6 address is automatically added.
*/
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, DEVICE_IFINDEX, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, DEVICE_IFINDEX, IFF_UP, TRUE) >= 0);
/* Add/delete notification */
nmtstp_ip4_address_add(NULL, EX, ifindex, addr, IP4_PLEN, addr, lifetime, preferred, 0, NULL);
@ -325,7 +325,7 @@ test_ip4_address_peer(void)
g_assert(addr != addr_peer);
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, ifindex, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_UP, TRUE) >= 0);
accept_signals(address_removed, 0, G_MAXINT);
accept_signals(address_added, 0, G_MAXINT);
@ -397,7 +397,7 @@ test_ip4_address_peer_zero(void)
peers[1] = addr_peer;
peers[2] = 0;
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, ifindex, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_UP, TRUE) >= 0);
nmtst_rand_perm(NULL, r_peers, peers, sizeof(peers[0]), G_N_ELEMENTS(peers));
for (i = 0; i < G_N_ELEMENTS(peers); i++) {

View file

@ -44,9 +44,12 @@ test_cleanup_internal(void)
g_assert(NMTST_NM_ERR_SUCCESS(nm_platform_link_dummy_add(NM_PLATFORM_GET, DEVICE_NAME, NULL)));
accept_signal(link_added);
free_signal(link_added);
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET,
nm_platform_link_get_ifindex(NM_PLATFORM_GET, DEVICE_NAME),
NULL));
g_assert(
nm_platform_link_change_flags(NM_PLATFORM_GET,
nm_platform_link_get_ifindex(NM_PLATFORM_GET, DEVICE_NAME),
IFF_UP,
TRUE)
>= 0);
ifindex = nm_platform_link_get_ifindex(NM_PLATFORM_GET, DEVICE_NAME);
g_assert(ifindex > 0);

View file

@ -2284,9 +2284,9 @@ nmtstp_link_set_updown(NMPlatform *platform, gboolean external_command, int ifin
nmtstp_run_command_check("ip link set %s %s", ifname, up ? "up" : "down");
} else {
if (up)
g_assert(nm_platform_link_set_up(platform, ifindex, NULL));
g_assert(nm_platform_link_change_flags(platform, ifindex, IFF_UP, TRUE) >= 0);
else
g_assert(nm_platform_link_set_down(platform, ifindex));
g_assert(nm_platform_link_change_flags(platform, ifindex, IFF_UP, FALSE) >= 0);
}
/* Let's wait until we get the result */

View file

@ -542,7 +542,7 @@ _nmtstp_env1_wrapper_setup(const NmtstTestData *test_data)
g_assert_cmpint(NMTSTP_ENV1_IFINDEX, ==, -1);
if (GPOINTER_TO_INT(p_ifup))
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, *p_ifindex, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, *p_ifindex, IFF_UP, TRUE) >= 0);
nm_platform_process_events(NM_PLATFORM_GET);

View file

@ -48,13 +48,15 @@ test_bogus(void)
g_assert(!nm_platform_link_get_type(NM_PLATFORM_GET, BOGUS_IFINDEX));
g_assert(!nm_platform_link_get_type_name(NM_PLATFORM_GET, BOGUS_IFINDEX));
g_assert(!nm_platform_link_set_up(NM_PLATFORM_GET, BOGUS_IFINDEX, NULL));
g_assert(!(nm_platform_link_change_flags(NM_PLATFORM_GET, BOGUS_IFINDEX, IFF_UP, TRUE) >= 0));
g_assert(!nm_platform_link_set_down(NM_PLATFORM_GET, BOGUS_IFINDEX));
g_assert(!(nm_platform_link_change_flags(NM_PLATFORM_GET, BOGUS_IFINDEX, IFF_UP, FALSE) >= 0));
g_assert(!nm_platform_link_set_arp(NM_PLATFORM_GET, BOGUS_IFINDEX));
g_assert(
!(nm_platform_link_change_flags(NM_PLATFORM_GET, BOGUS_IFINDEX, IFF_NOARP, TRUE) >= 0));
g_assert(!nm_platform_link_set_noarp(NM_PLATFORM_GET, BOGUS_IFINDEX));
g_assert(
!(nm_platform_link_change_flags(NM_PLATFORM_GET, BOGUS_IFINDEX, IFF_NOARP, FALSE) >= 0));
g_assert(!nm_platform_link_is_up(NM_PLATFORM_GET, BOGUS_IFINDEX));
g_assert(!nm_platform_link_is_connected(NM_PLATFORM_GET, BOGUS_IFINDEX));
@ -147,7 +149,8 @@ software_add(NMLinkType link_type, const char *name)
NM_PLATFORM_SIGNAL_CHANGED,
link_callback,
parent_ifindex);
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, parent_ifindex, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, parent_ifindex, IFF_UP, TRUE)
>= 0);
if (was_up) {
/* when NM is running in the background, it will mess with addrgenmode which might cause additional signals. */
accept_signals(parent_changed, 0, 1);
@ -233,7 +236,7 @@ test_slave(int master, int type, SignalData *master_changed)
* See https://bugzilla.redhat.com/show_bug.cgi?id=910348
*/
g_assert(!nm_platform_link_is_up(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_set_down(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_UP, FALSE) >= 0);
g_assert(!nm_platform_link_is_up(NM_PLATFORM_GET, ifindex));
ensure_no_signal(link_changed);
@ -263,7 +266,7 @@ test_slave(int master, int type, SignalData *master_changed)
&test_link_changed_signal_arg2);
/* Set master up */
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, master, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, master, IFF_UP, TRUE) >= 0);
g_assert(nm_platform_link_is_up(NM_PLATFORM_GET, master));
accept_signals(master_changed, 1, 3);
@ -284,7 +287,7 @@ test_slave(int master, int type, SignalData *master_changed)
switch (nm_platform_link_get_type(NM_PLATFORM_GET, master)) {
case NM_LINK_TYPE_BOND:
case NM_LINK_TYPE_TEAM:
g_assert(nm_platform_link_set_down(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_UP, FALSE) >= 0);
accept_signal(link_changed);
accept_signals(master_changed, 0, 3);
break;
@ -317,7 +320,7 @@ test_slave(int master, int type, SignalData *master_changed)
}
/* Set slave up and see if master gets up too */
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, ifindex, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_UP, TRUE) >= 0);
g_assert(nm_platform_link_is_connected(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_is_connected(NM_PLATFORM_GET, master));
accept_signals(link_changed, 1, 3);
@ -439,10 +442,10 @@ test_software(NMLinkType link_type, const char *link_typename)
/* Set ARP/NOARP */
g_assert(nm_platform_link_uses_arp(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_set_noarp(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_NOARP, TRUE) >= 0);
g_assert(!nm_platform_link_uses_arp(NM_PLATFORM_GET, ifindex));
accept_signals(link_changed, 1, 2);
g_assert(nm_platform_link_set_arp(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_NOARP, FALSE) >= 0);
g_assert(nm_platform_link_uses_arp(NM_PLATFORM_GET, ifindex));
accept_signal(link_changed);
@ -672,21 +675,21 @@ test_internal(void)
/* Up/connected */
g_assert(!nm_platform_link_is_up(NM_PLATFORM_GET, ifindex));
g_assert(!nm_platform_link_is_connected(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_set_up(NM_PLATFORM_GET, ifindex, NULL));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_UP, TRUE) >= 0);
g_assert(nm_platform_link_is_up(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_is_connected(NM_PLATFORM_GET, ifindex));
accept_signals(link_changed, 1, 2);
g_assert(nm_platform_link_set_down(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_UP, FALSE) >= 0);
g_assert(!nm_platform_link_is_up(NM_PLATFORM_GET, ifindex));
g_assert(!nm_platform_link_is_connected(NM_PLATFORM_GET, ifindex));
accept_signal(link_changed);
/* arp/noarp */
g_assert(!nm_platform_link_uses_arp(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_set_arp(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_NOARP, FALSE) >= 0);
g_assert(nm_platform_link_uses_arp(NM_PLATFORM_GET, ifindex));
accept_signal(link_changed);
g_assert(nm_platform_link_set_noarp(NM_PLATFORM_GET, ifindex));
g_assert(nm_platform_link_change_flags(NM_PLATFORM_GET, ifindex, IFF_NOARP, TRUE) >= 0);
g_assert(!nm_platform_link_uses_arp(NM_PLATFORM_GET, ifindex));
accept_signal(link_changed);

View file

@ -5179,6 +5179,11 @@ make_wired_setting(shvarFile *ifcfg, const char *file, NMSetting8021x **s_8021x,
}
nm_clear_g_free(&value);
g_object_set(s_wired,
NM_SETTING_WIRED_ACCEPT_ALL_MAC_ADDRESSES,
svGetValueTernary(ifcfg, "ACCEPT_ALL_MAC_ADDRESSES"),
NULL);
if (!found) {
g_set_error(error,
NM_UTILS_ERROR,

View file

@ -800,6 +800,7 @@ nms_ifcfg_rh_utils_is_numbered_tag_impl(const char *key,
}
const NMSIfcfgKeyTypeInfo nms_ifcfg_well_known_keys[] = {
_KEY_TYPE("ACCEPT_ALL_MAC_ADDRESSES", NMS_IFCFG_KEY_TYPE_IS_PLAIN),
_KEY_TYPE("ACD_TIMEOUT", NMS_IFCFG_KEY_TYPE_IS_PLAIN),
_KEY_TYPE("ADDRESS", NMS_IFCFG_KEY_TYPE_IS_NUMBERED),
_KEY_TYPE("AP_ISOLATION", NMS_IFCFG_KEY_TYPE_IS_PLAIN),

View file

@ -33,7 +33,7 @@ typedef struct {
NMSIfcfgKeyTypeFlags key_flags;
} NMSIfcfgKeyTypeInfo;
extern const NMSIfcfgKeyTypeInfo nms_ifcfg_well_known_keys[247];
extern const NMSIfcfgKeyTypeInfo nms_ifcfg_well_known_keys[248];
const NMSIfcfgKeyTypeInfo *nms_ifcfg_well_known_key_find_info(const char *key, gssize *out_idx);

View file

@ -1170,6 +1170,10 @@ write_wired_setting(NMConnection *connection, shvarFile *ifcfg, GError **error)
svSetValueStr(ifcfg, "TYPE", TYPE_ETHERNET);
svSetValueTernary(ifcfg,
"ACCEPT_ALL_MAC_ADDRESSES",
nm_setting_wired_get_accept_all_mac_addresses(s_wired));
return TRUE;
}

View file

@ -82,8 +82,8 @@ _test_fixture_1_setup(TestFixture1 *f, int test_idx)
f->hwaddr0 = l0->l_address;
f->hwaddr1 = l1->l_address;
g_assert(nm_platform_link_set_up(f->platform, f->ifindex0, NULL));
g_assert(nm_platform_link_set_up(f->platform, f->ifindex1, NULL));
g_assert(nm_platform_link_change_flags(f->platform, f->ifindex0, IFF_UP, TRUE) >= 0);
g_assert(nm_platform_link_change_flags(f->platform, f->ifindex1, IFF_UP, TRUE) >= 0);
return f;
}

View file

@ -14,6 +14,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <syslog.h>
#include <linux/if.h>
#include <linux/rtnetlink.h>
#include "nm-proxy-config.h"
@ -371,7 +372,7 @@ vpn_cleanup(NMVpnConnection *self, NMDevice *parent_dev)
if (priv->ip_ifindex) {
NMPlatform *platform = nm_netns_get_platform(priv->netns);
nm_platform_link_set_down(platform, priv->ip_ifindex);
nm_platform_link_change_flags(platform, priv->ip_ifindex, IFF_UP, FALSE);
nm_platform_ip_route_flush(platform, AF_UNSPEC, priv->ip_ifindex);
nm_platform_ip_address_flush(platform, AF_UNSPEC, priv->ip_ifindex);
}
@ -1157,7 +1158,10 @@ nm_vpn_connection_apply_config(NMVpnConnection *self)
apply_parent_device_config(self);
if (priv->ip_ifindex > 0) {
nm_platform_link_set_up(nm_netns_get_platform(priv->netns), priv->ip_ifindex, NULL);
nm_platform_link_change_flags(nm_netns_get_platform(priv->netns),
priv->ip_ifindex,
IFF_UP,
TRUE);
if (priv->ip4_config) {
nm_assert(priv->ip_ifindex == nm_ip4_config_get_ifindex(priv->ip4_config));

View file

@ -1788,4 +1788,5 @@ global:
libnm_1_32_0 {
global:
nm_setting_match_new;
nm_setting_wired_get_accept_all_mac_addresses;
} libnm_1_30_0;

View file

@ -101,6 +101,7 @@ gboolean nm_utils_vlan_priority_map_parse_str(NMVlanPriorityMap map_type,
#define _NM_DEVICE_INTERFACE_FLAG_ALL \
((NMDeviceInterfaceFlags)(NM_DEVICE_INTERFACE_FLAG_UP | NM_DEVICE_INTERFACE_FLAG_LOWER_UP \
| NM_DEVICE_INTERFACE_FLAG_CARRIER \
| NM_DEVICE_INTERFACE_FLAG_PROMISC \
| NM_DEVICE_INTERFACE_FLAG_LLDP_CLIENT_ENABLED))
/*****************************************************************************/

View file

@ -44,7 +44,8 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMSettingWired,
PROP_S390_NETTYPE,
PROP_S390_OPTIONS,
PROP_WAKE_ON_LAN,
PROP_WAKE_ON_LAN_PASSWORD, );
PROP_WAKE_ON_LAN_PASSWORD,
PROP_ACCEPT_ALL_MAC_ADDRESSES, );
typedef struct {
struct {
@ -62,6 +63,7 @@ typedef struct {
char * s390_nettype;
char * wol_password;
NMSettingWiredWakeOnLan wol;
NMTernary accept_all_mac_addresses;
guint32 speed;
guint32 mtu;
bool auto_negotiate : 1;
@ -735,6 +737,22 @@ nm_setting_wired_get_wake_on_lan_password(NMSettingWired *setting)
return NM_SETTING_WIRED_GET_PRIVATE(setting)->wol_password;
}
/**
* nm_setting_wired_get_accept_all_mac_addresses:
* @setting: the #NMSettingWired
*
* Returns: the #NMSettingWired:accept-all-mac-addresses property of the setting
*
* Since: 1.32
**/
NMTernary
nm_setting_wired_get_accept_all_mac_addresses(NMSettingWired *setting)
{
g_return_val_if_fail(NM_IS_SETTING_WIRED(setting), NM_TERNARY_DEFAULT);
return NM_SETTING_WIRED_GET_PRIVATE(setting)->accept_all_mac_addresses;
}
static gboolean
verify(NMSetting *setting, NMConnection *connection, GError **error)
{
@ -1039,6 +1057,9 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
case PROP_WAKE_ON_LAN_PASSWORD:
g_value_set_string(value, priv->wol_password);
break;
case PROP_ACCEPT_ALL_MAC_ADDRESSES:
g_value_set_enum(value, priv->accept_all_mac_addresses);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@ -1174,6 +1195,9 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
g_free(priv->wol_password);
priv->wol_password = g_value_dup_string(value);
break;
case PROP_ACCEPT_ALL_MAC_ADDRESSES:
priv->accept_all_mac_addresses = g_value_get_enum(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@ -1191,7 +1215,8 @@ nm_setting_wired_init(NMSettingWired *setting)
priv->mac_address_blacklist = g_array_new(TRUE, FALSE, sizeof(char *));
g_array_set_clear_func(priv->mac_address_blacklist, (GDestroyNotify) clear_blacklist_item);
priv->wol = NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT;
priv->wol = NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT;
priv->accept_all_mac_addresses = NM_TERNARY_DEFAULT;
}
/**
@ -1684,6 +1709,29 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
"",
NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* NMSettingWired:accept-all-mac-addresses:
*
* When %TRUE, setup the interface to accept packets for all MAC addresses.
* This is enabling the kernel interface flag IFF_PROMISC.
* When %FALSE, the interface will only accept the packets with the
* interface destination mac address or broadcast.
*
* Since: 1.32
**/
/* ---ifcfg-rh---
* property: accept-all-mac-addresses
* variable: ACCEPT_ALL_MAC_ADDRESSES
* description: Enforce the interface to accept all the packets.
* ---end---
*/
obj_properties[PROP_ACCEPT_ALL_MAC_ADDRESSES] =
g_param_spec_enum(NM_SETTING_WIRED_ACCEPT_ALL_MAC_ADDRESSES,
"",
"",
NM_TYPE_TERNARY,
NM_TERNARY_DEFAULT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);

View file

@ -3841,6 +3841,7 @@ test_connection_diff_a_only(void)
{NM_SETTING_WIRED_S390_OPTIONS, NM_SETTING_DIFF_RESULT_IN_A},
{NM_SETTING_WIRED_WAKE_ON_LAN, NM_SETTING_DIFF_RESULT_IN_A},
{NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD, NM_SETTING_DIFF_RESULT_IN_A},
{NM_SETTING_WIRED_ACCEPT_ALL_MAC_ADDRESSES, NM_SETTING_DIFF_RESULT_IN_A},
{NULL, NM_SETTING_DIFF_RESULT_UNKNOWN},
}},
{NM_SETTING_IP4_CONFIG_SETTING_NAME,

View file

@ -1183,6 +1183,8 @@ typedef enum { /*< flags >*/
* administrative point of view. Corresponds to kernel IFF_UP.
* @NM_DEVICE_INTERFACE_FLAG_LOWER_UP: the physical link is up. Corresponds
* to kernel IFF_LOWER_UP.
* @NM_DEVICE_INTERFACE_FLAG_PROMISC: receive all packets. Corresponds to
* kernel IFF_PROMISC. Since: 1.32.
* @NM_DEVICE_INTERFACE_FLAG_CARRIER: the interface has carrier. In most
* cases this is equal to the value of @NM_DEVICE_INTERFACE_FLAG_LOWER_UP.
* However some devices have a non-standard carrier detection mechanism.
@ -1198,6 +1200,7 @@ typedef enum { /*< flags >*/
NM_DEVICE_INTERFACE_FLAG_NONE = 0, /*< skip >*/
NM_DEVICE_INTERFACE_FLAG_UP = 0x1,
NM_DEVICE_INTERFACE_FLAG_LOWER_UP = 0x2,
NM_DEVICE_INTERFACE_FLAG_PROMISC = 0x4,
/* NM-specific flags */
NM_DEVICE_INTERFACE_FLAG_CARRIER = 0x10000,
NM_DEVICE_INTERFACE_FLAG_LLDP_CLIENT_ENABLED = 0x20000,

View file

@ -79,6 +79,7 @@ typedef enum { /*< flags >*/
#define NM_SETTING_WIRED_S390_OPTIONS "s390-options"
#define NM_SETTING_WIRED_WAKE_ON_LAN "wake-on-lan"
#define NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD "wake-on-lan-password"
#define NM_SETTING_WIRED_ACCEPT_ALL_MAC_ADDRESSES "accept-all-mac-addresses"
/**
* NMSettingWired:
@ -106,6 +107,9 @@ gboolean nm_setting_wired_get_auto_negotiate(NMSettingWired *setting);
const char *nm_setting_wired_get_mac_address(NMSettingWired *setting);
const char *nm_setting_wired_get_cloned_mac_address(NMSettingWired *setting);
NM_AVAILABLE_IN_1_32
NMTernary nm_setting_wired_get_accept_all_mac_addresses(NMSettingWired *setting);
NM_AVAILABLE_IN_1_4
const char *nm_setting_wired_get_generate_mac_address_mask(NMSettingWired *setting);

View file

@ -7485,34 +7485,6 @@ link_change_flags(NMPlatform *platform, int ifindex, unsigned flags_mask, unsign
return do_change_link(platform, CHANGE_LINK_TYPE_UNSPEC, ifindex, nlmsg, NULL);
}
static gboolean
link_set_up(NMPlatform *platform, int ifindex, gboolean *out_no_firmware)
{
int r;
r = link_change_flags(platform, ifindex, IFF_UP, IFF_UP);
NM_SET_OUT(out_no_firmware, (r == -NME_PL_NO_FIRMWARE));
return r >= 0;
}
static gboolean
link_set_down(NMPlatform *platform, int ifindex)
{
return (link_change_flags(platform, ifindex, IFF_UP, 0) >= 0);
}
static gboolean
link_set_arp(NMPlatform *platform, int ifindex)
{
return (link_change_flags(platform, ifindex, IFF_NOARP, 0) >= 0);
}
static gboolean
link_set_noarp(NMPlatform *platform, int ifindex)
{
return (link_change_flags(platform, ifindex, IFF_NOARP, IFF_NOARP) >= 0);
}
static int
link_set_user_ipv6ll_enabled(NMPlatform *platform, int ifindex, gboolean enabled)
{
@ -9664,10 +9636,7 @@ nm_linux_platform_class_init(NMLinuxPlatformClass *klass)
platform_class->link_set_netns = link_set_netns;
platform_class->link_set_up = link_set_up;
platform_class->link_set_down = link_set_down;
platform_class->link_set_arp = link_set_arp;
platform_class->link_set_noarp = link_set_noarp;
platform_class->link_change_flags = link_change_flags;
platform_class->link_set_user_ipv6ll_enabled = link_set_user_ipv6ll_enabled;
platform_class->link_set_token = link_set_token;

View file

@ -1873,76 +1873,28 @@ nm_platform_link_set_bridge_vlans(NMPlatform * self,
}
/**
* nm_platform_link_set_up:
* nm_platform_link_change_flags_full:
* @self: platform instance
* @ifindex: Interface index
* @out_no_firmware: (allow-none): if the failure reason is due to missing firmware.
* @ifindex: interface index
* @flags_mask: flag mask to be set
* @flags_set: flag to be set on the flag mask
*
* Change the interface flag mask to the value specified.
*
* Returns: nm-errno code.
*
* Bring the interface up.
*/
gboolean
nm_platform_link_set_up(NMPlatform *self, int ifindex, gboolean *out_no_firmware)
int
nm_platform_link_change_flags_full(NMPlatform *self,
int ifindex,
unsigned flags_mask,
unsigned flags_set)
{
_CHECK_SELF(self, klass, FALSE);
g_return_val_if_fail(ifindex > 0, FALSE);
g_return_val_if_fail(ifindex > 0, -NME_BUG);
_LOG3D("link: setting up");
return klass->link_set_up(self, ifindex, out_no_firmware);
}
/**
* nm_platform_link_set_down:
* @self: platform instance
* @ifindex: Interface index
*
* Take the interface down.
*/
gboolean
nm_platform_link_set_down(NMPlatform *self, int ifindex)
{
_CHECK_SELF(self, klass, FALSE);
g_return_val_if_fail(ifindex > 0, FALSE);
_LOG3D("link: setting down");
return klass->link_set_down(self, ifindex);
}
/**
* nm_platform_link_set_arp:
* @self: platform instance
* @ifindex: Interface index
*
* Enable ARP on the interface.
*/
gboolean
nm_platform_link_set_arp(NMPlatform *self, int ifindex)
{
_CHECK_SELF(self, klass, FALSE);
g_return_val_if_fail(ifindex >= 0, FALSE);
_LOG3D("link: setting arp");
return klass->link_set_arp(self, ifindex);
}
/**
* nm_platform_link_set_noarp:
* @self: platform instance
* @ifindex: Interface index
*
* Disable ARP on the interface.
*/
gboolean
nm_platform_link_set_noarp(NMPlatform *self, int ifindex)
{
_CHECK_SELF(self, klass, FALSE);
g_return_val_if_fail(ifindex >= 0, FALSE);
_LOG3D("link: setting noarp");
return klass->link_set_noarp(self, ifindex);
return klass->link_change_flags(self, ifindex, flags_mask, flags_set);
}
/**

View file

@ -1091,10 +1091,10 @@ typedef struct {
gboolean (*link_delete)(NMPlatform *self, int ifindex);
gboolean (*link_refresh)(NMPlatform *self, int ifindex);
gboolean (*link_set_netns)(NMPlatform *self, int ifindex, int netns_fd);
gboolean (*link_set_up)(NMPlatform *self, int ifindex, gboolean *out_no_firmware);
gboolean (*link_set_down)(NMPlatform *self, int ifindex);
gboolean (*link_set_arp)(NMPlatform *self, int ifindex);
gboolean (*link_set_noarp)(NMPlatform *self, int ifindex);
int (*link_change_flags)(NMPlatform *platform,
int ifindex,
unsigned flags_mask,
unsigned flags_set);
int (*link_set_user_ipv6ll_enabled)(NMPlatform *self, int ifindex, gboolean enabled);
gboolean (*link_set_token)(NMPlatform *self, int ifindex, NMUtilsIPv6IfaceId iid);
@ -1817,10 +1817,28 @@ void nm_platform_process_events(NMPlatform *self);
const NMPlatformLink *
nm_platform_process_events_ensure_link(NMPlatform *self, int ifindex, const char *ifname);
gboolean nm_platform_link_set_up(NMPlatform *self, int ifindex, gboolean *out_no_firmware);
gboolean nm_platform_link_set_down(NMPlatform *self, int ifindex);
gboolean nm_platform_link_set_arp(NMPlatform *self, int ifindex);
gboolean nm_platform_link_set_noarp(NMPlatform *self, int ifindex);
int nm_platform_link_change_flags_full(NMPlatform *self,
int ifindex,
unsigned flags_mask,
unsigned flags_set);
/**
* nm_platform_link_change_flags:
* @self: platform instance
* @ifindex: interface index
* @value: flag to be set
* @set: value to be set
*
* Change the interface flag to the value set.
*
* Returns: nm-errno code.
*
*/
static inline int
nm_platform_link_change_flags(NMPlatform *self, int ifindex, unsigned value, gboolean set)
{
return nm_platform_link_change_flags_full(self, ifindex, value, set ? value : 0u);
}
const char *nm_platform_link_get_udi(NMPlatform *self, int ifindex);
const char *nm_platform_link_get_path(NMPlatform *self, int ifindex);

View file

@ -7455,6 +7455,9 @@ static const NMMetaPropertyInfo *const property_infos_WIRED[] = {
PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_WAKE_ON_LAN_PASSWORD,
.property_type = &_pt_gobject_mac,
),
PROPERTY_INFO_WITH_DESC (NM_SETTING_WIRED_ACCEPT_ALL_MAC_ADDRESSES,
.property_type = &_pt_gobject_enum,
),
NULL
};

View file

@ -89,6 +89,7 @@
#define DESCRIBE_DOC_NM_SETTING_802_1X_PRIVATE_KEY_PASSWORD_FLAGS N_("Flags indicating how to handle the \"private-key-password\" property.")
#define DESCRIBE_DOC_NM_SETTING_802_1X_SUBJECT_MATCH N_("Substring to be matched against the subject of the certificate presented by the authentication server. When unset, no verification of the authentication server certificate's subject is performed. This property provides little security, if any, and its use is deprecated in favor of NMSetting8021x:domain-suffix-match.")
#define DESCRIBE_DOC_NM_SETTING_802_1X_SYSTEM_CA_CERTS N_("When TRUE, overrides the \"ca-path\" and \"phase2-ca-path\" properties using the system CA directory specified at configure time with the --system-ca-path switch. The certificates in this directory are added to the verification chain in addition to any certificates specified by the \"ca-cert\" and \"phase2-ca-cert\" properties. If the path provided with --system-ca-path is rather a file name (bundle of trusted CA certificates), it overrides \"ca-cert\" and \"phase2-ca-cert\" properties instead (sets ca_cert/ca_cert2 options for wpa_supplicant).")
#define DESCRIBE_DOC_NM_SETTING_WIRED_ACCEPT_ALL_MAC_ADDRESSES N_("When TRUE, setup the interface to accept packets for all MAC addresses. This is enabling the kernel interface flag IFF_PROMISC. When FALSE, the interface will only accept the packets with the interface destination mac address or broadcast.")
#define DESCRIBE_DOC_NM_SETTING_WIRED_AUTO_NEGOTIATE N_("When TRUE, enforce auto-negotiation of speed and duplex mode. If \"speed\" and \"duplex\" properties are both specified, only that single mode will be advertised and accepted during the link auto-negotiation process: this works only for BASE-T 802.3 specifications and is useful for enforcing gigabits modes, as in these cases link negotiation is mandatory. When FALSE, \"speed\" and \"duplex\" properties should be both set or link configuration will be skipped.")
#define DESCRIBE_DOC_NM_SETTING_WIRED_CLONED_MAC_ADDRESS N_("If specified, request that the device use this MAC address instead. This is known as MAC cloning or spoofing. Beside explicitly specifying a MAC address, the special values \"preserve\", \"permanent\", \"random\" and \"stable\" are supported. \"preserve\" means not to touch the MAC address on activation. \"permanent\" means to use the permanent hardware address if the device has one (otherwise this is treated as \"preserve\"). \"random\" creates a random MAC address on each connect. \"stable\" creates a hashed MAC address based on connection.stable-id and a machine dependent key. If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to \"preserve\" (older versions of NetworkManager may use a different default value). On D-Bus, this field is expressed as \"assigned-mac-address\" or the deprecated \"cloned-mac-address\".")
#define DESCRIBE_DOC_NM_SETTING_WIRED_DUPLEX N_("When a value is set, either \"half\" or \"full\", configures the device to use the specified duplex mode. If \"auto-negotiate\" is \"yes\" the specified duplex mode will be the only one advertised during link negotiation: this works only for BASE-T 802.3 specifications and is useful for enforcing gigabits modes, as in these cases link negotiation is mandatory. If the value is unset (the default), the link configuration will be either skipped (if \"auto-negotiate\" is \"no\", the default) or will be auto-negotiated (if \"auto-negotiate\" is \"yes\") and the local device will advertise all the supported duplex modes. Must be set together with the \"speed\" property if specified. Before specifying a duplex mode be sure your device supports it.")

View file

@ -662,6 +662,9 @@ static gconstpointer
case NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_CARRIER:
return nmc_meta_generic_get_bool(NM_FLAGS_HAS(flags, NM_DEVICE_INTERFACE_FLAG_CARRIER),
get_type);
case NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_PROMISC:
return nmc_meta_generic_get_bool(NM_FLAGS_HAS(flags, NM_DEVICE_INTERFACE_FLAG_PROMISC),
get_type);
default:
break;
}
@ -685,6 +688,9 @@ const NmcMetaGenericInfo *const
_METAGEN_DEVICE_DETAIL_INTERFACE_FLAGS(
NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_CARRIER,
"CARRIER"),
_METAGEN_DEVICE_DETAIL_INTERFACE_FLAGS(
NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_PROMISC,
"PROMISC"),
};
/*****************************************************************************/

View file

@ -232,6 +232,8 @@
description="The NMSettingWiredWakeOnLan options to enable. Not all devices support all options. May be any combination of NM_SETTING_WIRED_WAKE_ON_LAN_PHY (0x2), NM_SETTING_WIRED_WAKE_ON_LAN_UNICAST (0x4), NM_SETTING_WIRED_WAKE_ON_LAN_MULTICAST (0x8), NM_SETTING_WIRED_WAKE_ON_LAN_BROADCAST (0x10), NM_SETTING_WIRED_WAKE_ON_LAN_ARP (0x20), NM_SETTING_WIRED_WAKE_ON_LAN_MAGIC (0x40) or the special values NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT (0x1) (to use global settings) and NM_SETTING_WIRED_WAKE_ON_LAN_IGNORE (0x8000) (to disable management of Wake-on-LAN in NetworkManager)." />
<property name="wake-on-lan-password"
description="If specified, the password used with magic-packet-based Wake-on-LAN, represented as an Ethernet MAC address. If NULL, no password will be required." />
<property name="accept-all-mac-addresses"
description="When TRUE, setup the interface to accept packets for all MAC addresses. This is enabling the kernel interface flag IFF_PROMISC. When FALSE, the interface will only accept the packets with the interface destination mac address or broadcast." />
</setting>
<setting name="adsl" >
<property name="username"

View file

@ -231,6 +231,7 @@ typedef enum {
NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_UP = 0,
NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_LOWER_UP,
NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_CARRIER,
NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_PROMISC,
_NMC_GENERIC_INFO_TYPE_DEVICE_DETAIL_INTERFACE_FLAGS_NUM,
} NmcGenericInfoType;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff