network: disable IPv4LL for ipvlan with L3 or L3S mode

As L3 or L3S mode do not support ARP.
This commit is contained in:
Yu Watanabe
2019-05-22 17:58:46 +09:00
parent 40921f0886
commit f410d46358
3 changed files with 27 additions and 0 deletions
+16
View File
@@ -4,6 +4,7 @@
#include "conf-parser.h"
#include "netdev/ipvlan.h"
#include "networkd-link.h"
#include "string-table.h"
static const char* const ipvlan_mode_table[_NETDEV_IPVLAN_MODE_MAX] = {
@@ -85,3 +86,18 @@ const NetDevVTable ipvtap_vtable = {
.fill_message_create = netdev_ipvlan_fill_message_create,
.create_type = NETDEV_CREATE_STACKED,
};
IPVlanMode link_get_ipvlan_mode(Link *link) {
NetDev *netdev;
if (!streq_ptr(link->kind, "ipvlan"))
return _NETDEV_IPVLAN_MODE_INVALID;
if (netdev_get(link->manager, link->ifname, &netdev) < 0)
return _NETDEV_IPVLAN_MODE_INVALID;
if (netdev->kind != NETDEV_KIND_IPVLAN)
return _NETDEV_IPVLAN_MODE_INVALID;
return IPVLAN(netdev)->mode;
}
+2
View File
@@ -42,3 +42,5 @@ IPVlanFlags ipvlan_flags_from_string(const char *d) _pure_;
CONFIG_PARSER_PROTOTYPE(config_parse_ipvlan_mode);
CONFIG_PARSER_PROTOTYPE(config_parse_ipvlan_flags);
IPVlanMode link_get_ipvlan_mode(Link *link);