summaryrefslogtreecommitdiff
path: root/system-linux.c
diff options
context:
space:
mode:
authorJohannes Kimmel <fff@bareminimum.eu>2020-09-04 04:59:42 +0200
committerHans Dedecker <dedeckeh@gmail.com>2020-09-12 21:14:03 +0200
commit11223f5550f7dd8faefb85441065b682be16e61f (patch)
tree64ea0204e58faa107fb8afb585b231f9fa9f3451 /system-linux.c
parent226566b967dc4ef4d83ed7844b8ad746f4306f8d (diff)
downloadnetifd-11223f5550f7dd8faefb85441065b682be16e61f.tar.gz
netifd: vxlan: add most missing boolean options
adds the folloing missing options: - learning - rsc - proxy - l2miss - l3miss - gbp See ip-link(3) for their meaning. still missing: - external - gpe I'm not sure how to handle them at the moment. It's unclear to me what IFLA_VXLAN_* value corresponds to the 'external' option and according to the manpage, gpe depends on it. Signed-off-by: Johannes Kimmel <fff@bareminimum.eu>
Diffstat (limited to 'system-linux.c')
-rw-r--r--system-linux.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/system-linux.c b/system-linux.c
index d87a9ee..c232c5f 100644
--- a/system-linux.c
+++ b/system-linux.c
@@ -3077,10 +3077,14 @@ static void system_vxlan_map_bool_attr(struct nl_msg *msg, struct blob_attr **tb
struct blob_attr *cur;
if ((cur = tb_data[vxlandatatype])) {
bool val = blobmsg_get_bool(cur);
- if (invert) {
+ if (invert)
val = !val;
- }
- nla_put_u8(msg, attrtype, val);
+
+ if ((attrtype == IFLA_VXLAN_GBP) && val)
+ nla_put_flag(msg, attrtype);
+ else
+ nla_put_u8(msg, attrtype, val);
+
}
}
@@ -3224,6 +3228,12 @@ static int system_add_vxlan(const char *name, const unsigned int link, struct bl
system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_CSUM, VXLAN_DATA_ATTR_TXCSUM, false);
system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_ZERO_CSUM6_RX, VXLAN_DATA_ATTR_RXCSUM, true);
system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_UDP_ZERO_CSUM6_TX, VXLAN_DATA_ATTR_TXCSUM, true);
+ system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_LEARNING, VXLAN_DATA_ATTR_LEARNING, false);
+ system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_RSC , VXLAN_DATA_ATTR_RSC, false);
+ system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_PROXY , VXLAN_DATA_ATTR_PROXY, false);
+ system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L2MISS , VXLAN_DATA_ATTR_L2MISS, false);
+ system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_L3MISS , VXLAN_DATA_ATTR_L3MISS, false);
+ system_vxlan_map_bool_attr(msg, tb_data, IFLA_VXLAN_GBP , VXLAN_DATA_ATTR_GBP, false);
if ((cur = tb[TUNNEL_ATTR_TOS])) {
char *str = blobmsg_get_string(cur);