diff options
Diffstat (limited to 'src/network/networkd-netdev-vxlan.c')
-rw-r--r-- | src/network/networkd-netdev-vxlan.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/network/networkd-netdev-vxlan.c b/src/network/networkd-netdev-vxlan.c index 7dec69d0f6..b19240e311 100644 --- a/src/network/networkd-netdev-vxlan.c +++ b/src/network/networkd-netdev-vxlan.c @@ -26,6 +26,7 @@ #include "sd-rtnl.h" #include "networkd-netdev-vxlan.h" #include "networkd-link.h" +#include "conf-parser.h" #include "missing.h" static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *m) { @@ -92,9 +93,89 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_ return r; } + r = sd_rtnl_message_append_u8(m, IFLA_VXLAN_RSC, v->route_short_circuit); + if (r < 0) { + log_error_netdev(netdev, + "Could not append IFLA_VXLAN_RSC attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_u8(m, IFLA_VXLAN_PROXY, v->arp_proxy); + if (r < 0) { + log_error_netdev(netdev, + "Could not append IFLA_VXLAN_PROXY attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_u8(m, IFLA_VXLAN_L2MISS, v->l2miss); + if (r < 0) { + log_error_netdev(netdev, + "Could not append IFLA_VXLAN_L2MISS attribute: %s", + strerror(-r)); + return r; + } + + r = sd_rtnl_message_append_u8(m, IFLA_VXLAN_L3MISS, v->l3miss); + if (r < 0) { + log_error_netdev(netdev, + "Could not append IFLA_VXLAN_L3MISS attribute: %s", + strerror(-r)); + return r; + } + + if(v->fdb_ageing) { + r = sd_rtnl_message_append_u32(m, IFLA_VXLAN_AGEING, v->fdb_ageing / USEC_PER_SEC); + if (r < 0) { + log_error_netdev(netdev, + "Could not append IFLA_VXLAN_AGEING attribute: %s", + strerror(-r)); + return r; + } + } + return r; } +int config_parse_vxlan_group_address(const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + VxLan *v = userdata; + union in_addr_union *addr = data, buffer; + int r, f; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + r = in_addr_from_string_auto(rvalue, &f, &buffer); + if (r < 0) { + log_syntax(unit, LOG_ERR, filename, line, EINVAL, + "vxlan multicast group address is invalid, ignoring assignment: %s", rvalue); + return 0; + } + + if(v->family != AF_UNSPEC && v->family != f) { + log_syntax(unit, LOG_ERR, filename, line, EINVAL, + "vxlan multicast group incompatible, ignoring assignment: %s", rvalue); + return 0; + } + + v->family = f; + *addr = buffer; + + return 0; +} + static int netdev_vxlan_verify(NetDev *netdev, const char *filename) { VxLan *v = VXLAN(netdev); |