2 * iplink_vxlan.c VXLAN device support
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version
7 * 2 of the License, or (at your option) any later version.
9 * Authors: Stephen Hemminger <shemminger@vyatta.com
17 #include <linux/if_link.h>
18 #include <arpa/inet.h>
22 #include "ip_common.h"
24 #define VXLAN_ATTRSET(attrs, type) (((attrs) & (1L << (type))) != 0)
26 static void print_explain(FILE *f
)
29 "Usage: ... vxlan id VNI\n"
30 " [ { group | remote } IP_ADDRESS ]\n"
34 " [ flowlabel LABEL ]\n"
37 " [ srcport MIN MAX ]\n"
43 " [ ageing SECONDS ]\n"
44 " [ maxaddress NUMBER ]\n"
46 " [ [no]udp6zerocsumtx ]\n"
47 " [ [no]udp6zerocsumrx ]\n"
48 " [ [no]remcsumtx ] [ [no]remcsumrx ]\n"
49 " [ [no]external ] [ gbp ] [ gpe ]\n"
51 "Where: VNI := 0-16777215\n"
52 " ADDR := { IP_ADDRESS | any }\n"
53 " TOS := { NUMBER | inherit }\n"
54 " TTL := { 1..255 | inherit }\n"
55 " LABEL := 0-1048575\n"
59 static void explain(void)
61 print_explain(stderr
);
64 static void check_duparg(__u64
*attrs
, int type
, const char *key
,
67 if (!VXLAN_ATTRSET(*attrs
, type
)) {
68 *attrs
|= (1L << type
);
74 static int vxlan_parse_opt(struct link_util
*lu
, int argc
, char **argv
,
80 struct in6_addr gaddr6
= IN6ADDR_ANY_INIT
;
81 struct in6_addr daddr6
= IN6ADDR_ANY_INIT
;
86 bool set_op
= (n
->nlmsg_type
== RTM_NEWLINK
&&
87 !(n
->nlmsg_flags
& NLM_F_CREATE
));
90 if (!matches(*argv
, "id") ||
91 !matches(*argv
, "vni")) {
92 /* We will add ID attribute outside of the loop since we
93 * need to consider metadata information as well.
96 check_duparg(&attrs
, IFLA_VXLAN_ID
, "id", *argv
);
97 if (get_u32(&vni
, *argv
, 0) ||
99 invarg("invalid id", *argv
);
100 } else if (!matches(*argv
, "group")) {
101 if (daddr
|| !IN6_IS_ADDR_UNSPECIFIED(&daddr6
)) {
102 fprintf(stderr
, "vxlan: both group and remote");
103 fprintf(stderr
, " cannot be specified\n");
107 check_duparg(&attrs
, IFLA_VXLAN_GROUP
, "group", *argv
);
108 if (!inet_get_addr(*argv
, &gaddr
, &gaddr6
)) {
109 fprintf(stderr
, "Invalid address \"%s\"\n", *argv
);
112 if (!IN6_IS_ADDR_MULTICAST(&gaddr6
) && !IN_MULTICAST(ntohl(gaddr
)))
113 invarg("invalid group address", *argv
);
114 } else if (!matches(*argv
, "remote")) {
115 if (gaddr
|| !IN6_IS_ADDR_UNSPECIFIED(&gaddr6
)) {
116 fprintf(stderr
, "vxlan: both group and remote");
117 fprintf(stderr
, " cannot be specified\n");
121 check_duparg(&attrs
, IFLA_VXLAN_GROUP
, "remote", *argv
);
122 if (!inet_get_addr(*argv
, &daddr
, &daddr6
)) {
123 fprintf(stderr
, "Invalid address \"%s\"\n", *argv
);
126 if (IN6_IS_ADDR_MULTICAST(&daddr6
) || IN_MULTICAST(ntohl(daddr
)))
127 invarg("invalid remote address", *argv
);
128 } else if (!matches(*argv
, "local")) {
130 struct in6_addr saddr6
= IN6ADDR_ANY_INIT
;
133 check_duparg(&attrs
, IFLA_VXLAN_LOCAL
, "local", *argv
);
134 if (strcmp(*argv
, "any")) {
135 if (!inet_get_addr(*argv
, &saddr
, &saddr6
)) {
136 fprintf(stderr
, "Invalid address \"%s\"\n", *argv
);
141 if (IN_MULTICAST(ntohl(saddr
)) || IN6_IS_ADDR_MULTICAST(&saddr6
))
142 invarg("invalid local address", *argv
);
145 addattr_l(n
, 1024, IFLA_VXLAN_LOCAL
, &saddr
, 4);
146 else if (!IN6_IS_ADDR_UNSPECIFIED(&saddr6
))
147 addattr_l(n
, 1024, IFLA_VXLAN_LOCAL6
, &saddr6
,
148 sizeof(struct in6_addr
));
149 } else if (!matches(*argv
, "dev")) {
153 check_duparg(&attrs
, IFLA_VXLAN_LINK
, "dev", *argv
);
154 link
= if_nametoindex(*argv
);
156 fprintf(stderr
, "Cannot find device \"%s\"\n",
160 addattr32(n
, 1024, IFLA_VXLAN_LINK
, link
);
161 } else if (!matches(*argv
, "ttl") ||
162 !matches(*argv
, "hoplimit")) {
167 check_duparg(&attrs
, IFLA_VXLAN_TTL
, "ttl", *argv
);
168 if (strcmp(*argv
, "inherit") != 0) {
169 if (get_unsigned(&uval
, *argv
, 0))
170 invarg("invalid TTL", *argv
);
172 invarg("TTL must be <= 255", *argv
);
175 addattr8(n
, 1024, IFLA_VXLAN_TTL
, ttl
);
176 } else if (!matches(*argv
, "tos") ||
177 !matches(*argv
, "dsfield")) {
182 check_duparg(&attrs
, IFLA_VXLAN_TOS
, "tos", *argv
);
183 if (strcmp(*argv
, "inherit") != 0) {
184 if (rtnl_dsfield_a2n(&uval
, *argv
))
185 invarg("bad TOS value", *argv
);
189 addattr8(n
, 1024, IFLA_VXLAN_TOS
, tos
);
190 } else if (!matches(*argv
, "label") ||
191 !matches(*argv
, "flowlabel")) {
195 check_duparg(&attrs
, IFLA_VXLAN_LABEL
, "flowlabel",
197 if (get_u32(&uval
, *argv
, 0) ||
198 (uval
& ~LABEL_MAX_MASK
))
199 invarg("invalid flowlabel", *argv
);
200 addattr32(n
, 1024, IFLA_VXLAN_LABEL
, htonl(uval
));
201 } else if (!matches(*argv
, "ageing")) {
205 check_duparg(&attrs
, IFLA_VXLAN_AGEING
, "ageing",
207 if (strcmp(*argv
, "none") == 0)
209 else if (get_u32(&age
, *argv
, 0))
210 invarg("ageing timer", *argv
);
211 addattr32(n
, 1024, IFLA_VXLAN_AGEING
, age
);
212 } else if (!matches(*argv
, "maxaddress")) {
216 check_duparg(&attrs
, IFLA_VXLAN_LIMIT
,
217 "maxaddress", *argv
);
218 if (strcmp(*argv
, "unlimited") == 0)
220 else if (get_u32(&maxaddr
, *argv
, 0))
221 invarg("max addresses", *argv
);
222 addattr32(n
, 1024, IFLA_VXLAN_LIMIT
, maxaddr
);
223 } else if (!matches(*argv
, "port") ||
224 !matches(*argv
, "srcport")) {
225 struct ifla_vxlan_port_range range
= { 0, 0 };
228 check_duparg(&attrs
, IFLA_VXLAN_PORT_RANGE
, "srcport",
230 if (get_be16(&range
.low
, *argv
, 0))
231 invarg("min port", *argv
);
233 if (get_be16(&range
.high
, *argv
, 0))
234 invarg("max port", *argv
);
235 if (range
.low
|| range
.high
) {
236 addattr_l(n
, 1024, IFLA_VXLAN_PORT_RANGE
,
237 &range
, sizeof(range
));
239 } else if (!matches(*argv
, "dstport")) {
241 check_duparg(&attrs
, IFLA_VXLAN_PORT
, "dstport", *argv
);
242 if (get_u16(&dstport
, *argv
, 0))
243 invarg("dst port", *argv
);
244 } else if (!matches(*argv
, "nolearning")) {
245 check_duparg(&attrs
, IFLA_VXLAN_LEARNING
, *argv
, *argv
);
247 } else if (!matches(*argv
, "learning")) {
248 check_duparg(&attrs
, IFLA_VXLAN_LEARNING
, *argv
, *argv
);
250 } else if (!matches(*argv
, "noproxy")) {
251 check_duparg(&attrs
, IFLA_VXLAN_PROXY
, *argv
, *argv
);
252 addattr8(n
, 1024, IFLA_VXLAN_PROXY
, 0);
253 } else if (!matches(*argv
, "proxy")) {
254 check_duparg(&attrs
, IFLA_VXLAN_PROXY
, *argv
, *argv
);
255 addattr8(n
, 1024, IFLA_VXLAN_PROXY
, 1);
256 } else if (!matches(*argv
, "norsc")) {
257 check_duparg(&attrs
, IFLA_VXLAN_RSC
, *argv
, *argv
);
258 addattr8(n
, 1024, IFLA_VXLAN_RSC
, 0);
259 } else if (!matches(*argv
, "rsc")) {
260 check_duparg(&attrs
, IFLA_VXLAN_RSC
, *argv
, *argv
);
261 addattr8(n
, 1024, IFLA_VXLAN_RSC
, 1);
262 } else if (!matches(*argv
, "nol2miss")) {
263 check_duparg(&attrs
, IFLA_VXLAN_L2MISS
, *argv
, *argv
);
264 addattr8(n
, 1024, IFLA_VXLAN_L2MISS
, 0);
265 } else if (!matches(*argv
, "l2miss")) {
266 check_duparg(&attrs
, IFLA_VXLAN_L2MISS
, *argv
, *argv
);
267 addattr8(n
, 1024, IFLA_VXLAN_L2MISS
, 1);
268 } else if (!matches(*argv
, "nol3miss")) {
269 check_duparg(&attrs
, IFLA_VXLAN_L3MISS
, *argv
, *argv
);
270 addattr8(n
, 1024, IFLA_VXLAN_L3MISS
, 0);
271 } else if (!matches(*argv
, "l3miss")) {
272 check_duparg(&attrs
, IFLA_VXLAN_L3MISS
, *argv
, *argv
);
273 addattr8(n
, 1024, IFLA_VXLAN_L3MISS
, 1);
274 } else if (!matches(*argv
, "udpcsum")) {
275 check_duparg(&attrs
, IFLA_VXLAN_UDP_CSUM
, *argv
, *argv
);
276 addattr8(n
, 1024, IFLA_VXLAN_UDP_CSUM
, 1);
277 } else if (!matches(*argv
, "noudpcsum")) {
278 check_duparg(&attrs
, IFLA_VXLAN_UDP_CSUM
, *argv
, *argv
);
279 addattr8(n
, 1024, IFLA_VXLAN_UDP_CSUM
, 0);
280 } else if (!matches(*argv
, "udp6zerocsumtx")) {
281 check_duparg(&attrs
, IFLA_VXLAN_UDP_ZERO_CSUM6_TX
,
283 addattr8(n
, 1024, IFLA_VXLAN_UDP_ZERO_CSUM6_TX
, 1);
284 } else if (!matches(*argv
, "noudp6zerocsumtx")) {
285 check_duparg(&attrs
, IFLA_VXLAN_UDP_ZERO_CSUM6_TX
,
287 addattr8(n
, 1024, IFLA_VXLAN_UDP_ZERO_CSUM6_TX
, 0);
288 } else if (!matches(*argv
, "udp6zerocsumrx")) {
289 check_duparg(&attrs
, IFLA_VXLAN_UDP_ZERO_CSUM6_RX
,
291 addattr8(n
, 1024, IFLA_VXLAN_UDP_ZERO_CSUM6_RX
, 1);
292 } else if (!matches(*argv
, "noudp6zerocsumrx")) {
293 check_duparg(&attrs
, IFLA_VXLAN_UDP_ZERO_CSUM6_RX
,
295 addattr8(n
, 1024, IFLA_VXLAN_UDP_ZERO_CSUM6_RX
, 0);
296 } else if (!matches(*argv
, "remcsumtx")) {
297 check_duparg(&attrs
, IFLA_VXLAN_REMCSUM_TX
,
299 addattr8(n
, 1024, IFLA_VXLAN_REMCSUM_TX
, 1);
300 } else if (!matches(*argv
, "noremcsumtx")) {
301 check_duparg(&attrs
, IFLA_VXLAN_REMCSUM_TX
,
303 addattr8(n
, 1024, IFLA_VXLAN_REMCSUM_TX
, 0);
304 } else if (!matches(*argv
, "remcsumrx")) {
305 check_duparg(&attrs
, IFLA_VXLAN_REMCSUM_RX
,
307 addattr8(n
, 1024, IFLA_VXLAN_REMCSUM_RX
, 1);
308 } else if (!matches(*argv
, "noremcsumrx")) {
309 check_duparg(&attrs
, IFLA_VXLAN_REMCSUM_RX
,
311 addattr8(n
, 1024, IFLA_VXLAN_REMCSUM_RX
, 0);
312 } else if (!matches(*argv
, "external")) {
313 check_duparg(&attrs
, IFLA_VXLAN_COLLECT_METADATA
,
317 /* we will add LEARNING attribute outside of the loop */
318 addattr8(n
, 1024, IFLA_VXLAN_COLLECT_METADATA
,
320 } else if (!matches(*argv
, "noexternal")) {
321 check_duparg(&attrs
, IFLA_VXLAN_COLLECT_METADATA
,
324 addattr8(n
, 1024, IFLA_VXLAN_COLLECT_METADATA
,
326 } else if (!matches(*argv
, "gbp")) {
327 check_duparg(&attrs
, IFLA_VXLAN_GBP
, *argv
, *argv
);
328 addattr_l(n
, 1024, IFLA_VXLAN_GBP
, NULL
, 0);
329 } else if (!matches(*argv
, "gpe")) {
330 check_duparg(&attrs
, IFLA_VXLAN_GPE
, *argv
, *argv
);
331 addattr_l(n
, 1024, IFLA_VXLAN_GPE
, NULL
, 0);
332 } else if (matches(*argv
, "help") == 0) {
336 fprintf(stderr
, "vxlan: unknown command \"%s\"?\n", *argv
);
343 if (metadata
&& VXLAN_ATTRSET(attrs
, IFLA_VXLAN_ID
)) {
344 fprintf(stderr
, "vxlan: both 'external' and vni cannot be specified\n");
348 if (!metadata
&& !VXLAN_ATTRSET(attrs
, IFLA_VXLAN_ID
) && !set_op
) {
349 fprintf(stderr
, "vxlan: missing virtual network identifier\n");
353 if ((gaddr
|| !IN6_IS_ADDR_UNSPECIFIED(&gaddr6
)) &&
354 !VXLAN_ATTRSET(attrs
, IFLA_VXLAN_LINK
)) {
355 fprintf(stderr
, "vxlan: 'group' requires 'dev' to be specified\n");
359 if (!VXLAN_ATTRSET(attrs
, IFLA_VXLAN_PORT
) &&
360 VXLAN_ATTRSET(attrs
, IFLA_VXLAN_GPE
)) {
362 } else if (!VXLAN_ATTRSET(attrs
, IFLA_VXLAN_PORT
) && !set_op
) {
363 fprintf(stderr
, "vxlan: destination port not specified\n"
364 "Will use Linux kernel default (non-standard value)\n");
366 "Use 'dstport 4789' to get the IANA assigned value\n"
367 "Use 'dstport 0' to get default and quiet this message\n");
370 if (VXLAN_ATTRSET(attrs
, IFLA_VXLAN_ID
))
371 addattr32(n
, 1024, IFLA_VXLAN_ID
, vni
);
373 addattr_l(n
, 1024, IFLA_VXLAN_GROUP
, &gaddr
, 4);
375 addattr_l(n
, 1024, IFLA_VXLAN_GROUP
, &daddr
, 4);
376 else if (!IN6_IS_ADDR_UNSPECIFIED(&gaddr6
))
377 addattr_l(n
, 1024, IFLA_VXLAN_GROUP6
, &gaddr6
, sizeof(struct in6_addr
));
378 else if (!IN6_IS_ADDR_UNSPECIFIED(&daddr6
))
379 addattr_l(n
, 1024, IFLA_VXLAN_GROUP6
, &daddr6
, sizeof(struct in6_addr
));
380 else if (preferred_family
== AF_INET
)
381 addattr_l(n
, 1024, IFLA_VXLAN_GROUP
, &daddr
, 4);
382 else if (preferred_family
== AF_INET6
)
383 addattr_l(n
, 1024, IFLA_VXLAN_GROUP6
, &daddr6
, sizeof(struct in6_addr
));
385 if (!set_op
|| VXLAN_ATTRSET(attrs
, IFLA_VXLAN_LEARNING
))
386 addattr8(n
, 1024, IFLA_VXLAN_LEARNING
, learning
);
389 addattr16(n
, 1024, IFLA_VXLAN_PORT
, htons(dstport
));
394 static void vxlan_print_opt(struct link_util
*lu
, FILE *f
, struct rtattr
*tb
[])
405 if (!tb
[IFLA_VXLAN_ID
] ||
406 RTA_PAYLOAD(tb
[IFLA_VXLAN_ID
]) < sizeof(__u32
))
409 vni
= rta_getattr_u32(tb
[IFLA_VXLAN_ID
]);
410 print_uint(PRINT_ANY
, "id", "id %u ", vni
);
412 if (tb
[IFLA_VXLAN_GROUP
]) {
413 __be32 addr
= rta_getattr_u32(tb
[IFLA_VXLAN_GROUP
]);
416 if (IN_MULTICAST(ntohl(addr
)))
417 print_string(PRINT_ANY
,
420 format_host(AF_INET
, 4, &addr
));
422 print_string(PRINT_ANY
,
425 format_host(AF_INET
, 4, &addr
));
427 } else if (tb
[IFLA_VXLAN_GROUP6
]) {
428 struct in6_addr addr
;
430 memcpy(&addr
, RTA_DATA(tb
[IFLA_VXLAN_GROUP6
]), sizeof(struct in6_addr
));
431 if (!IN6_IS_ADDR_UNSPECIFIED(&addr
)) {
432 if (IN6_IS_ADDR_MULTICAST(&addr
))
433 print_string(PRINT_ANY
,
436 format_host(AF_INET6
,
437 sizeof(struct in6_addr
),
440 print_string(PRINT_ANY
,
443 format_host(AF_INET6
,
444 sizeof(struct in6_addr
),
449 if (tb
[IFLA_VXLAN_LOCAL
]) {
450 __be32 addr
= rta_getattr_u32(tb
[IFLA_VXLAN_LOCAL
]);
453 print_string(PRINT_ANY
,
456 format_host(AF_INET
, 4, &addr
));
457 } else if (tb
[IFLA_VXLAN_LOCAL6
]) {
458 struct in6_addr addr
;
460 memcpy(&addr
, RTA_DATA(tb
[IFLA_VXLAN_LOCAL6
]), sizeof(struct in6_addr
));
461 if (!IN6_IS_ADDR_UNSPECIFIED(&addr
))
462 print_string(PRINT_ANY
,
465 format_host(AF_INET6
,
466 sizeof(struct in6_addr
),
470 if (tb
[IFLA_VXLAN_LINK
] &&
471 (link
= rta_getattr_u32(tb
[IFLA_VXLAN_LINK
]))) {
472 const char *n
= if_indextoname(link
, s2
);
475 print_string(PRINT_ANY
, "link", "dev %s ", n
);
477 print_uint(PRINT_ANY
, "link_index", "dev %u ", link
);
480 if (tb
[IFLA_VXLAN_PORT_RANGE
]) {
481 const struct ifla_vxlan_port_range
*r
482 = RTA_DATA(tb
[IFLA_VXLAN_PORT_RANGE
]);
483 if (is_json_context()) {
484 open_json_object("port_range");
485 print_uint(PRINT_JSON
, "low", NULL
, ntohs(r
->low
));
486 print_uint(PRINT_JSON
, "high", NULL
, ntohs(r
->high
));
489 fprintf(f
, "srcport %u %u ",
490 ntohs(r
->low
), ntohs(r
->high
));
494 if (tb
[IFLA_VXLAN_PORT
])
495 print_uint(PRINT_ANY
,
498 rta_getattr_be16(tb
[IFLA_VXLAN_PORT
]));
500 if (tb
[IFLA_VXLAN_LEARNING
]) {
501 __u8 learning
= rta_getattr_u8(tb
[IFLA_VXLAN_LEARNING
]);
503 print_bool(PRINT_JSON
, "learning", NULL
, learning
);
505 print_bool(PRINT_FP
, NULL
, "nolearning ", true);
508 if (tb
[IFLA_VXLAN_PROXY
] && rta_getattr_u8(tb
[IFLA_VXLAN_PROXY
]))
509 print_bool(PRINT_ANY
, "proxy", "proxy ", true);
511 if (tb
[IFLA_VXLAN_RSC
] && rta_getattr_u8(tb
[IFLA_VXLAN_RSC
]))
512 print_bool(PRINT_ANY
, "rsc", "rsc ", true);
514 if (tb
[IFLA_VXLAN_L2MISS
] && rta_getattr_u8(tb
[IFLA_VXLAN_L2MISS
]))
515 print_bool(PRINT_ANY
, "l2miss", "l2miss ", true);
517 if (tb
[IFLA_VXLAN_L3MISS
] && rta_getattr_u8(tb
[IFLA_VXLAN_L3MISS
]))
518 print_bool(PRINT_ANY
, "l3miss", "l3miss ", true);
520 if (tb
[IFLA_VXLAN_TOS
] &&
521 (tos
= rta_getattr_u8(tb
[IFLA_VXLAN_TOS
]))) {
522 if (is_json_context()) {
523 print_0xhex(PRINT_JSON
, "tos", "%#x", tos
);
526 fprintf(f
, "tos %s ", "inherit");
528 fprintf(f
, "tos %#x ", tos
);
532 if (tb
[IFLA_VXLAN_TTL
]) {
533 __u8 ttl
= rta_getattr_u8(tb
[IFLA_VXLAN_TTL
]);
536 print_int(PRINT_ANY
, "ttl", "ttl %d ", ttl
);
538 print_int(PRINT_JSON
, "ttl", NULL
, ttl
);
541 if (tb
[IFLA_VXLAN_LABEL
]) {
542 __u32 label
= rta_getattr_u32(tb
[IFLA_VXLAN_LABEL
]);
545 print_0xhex(PRINT_ANY
,
551 if (tb
[IFLA_VXLAN_AGEING
]) {
552 __u32 age
= rta_getattr_u32(tb
[IFLA_VXLAN_AGEING
]);
555 print_uint(PRINT_ANY
, "ageing", "ageing none ", 0);
557 print_uint(PRINT_ANY
, "ageing", "ageing %u ", age
);
560 if (tb
[IFLA_VXLAN_LIMIT
] &&
561 ((maxaddr
= rta_getattr_u32(tb
[IFLA_VXLAN_LIMIT
])) != 0))
562 print_uint(PRINT_ANY
, "limit", "maxaddr %u ", maxaddr
);
564 if (tb
[IFLA_VXLAN_UDP_CSUM
]) {
565 __u8 udp_csum
= rta_getattr_u8(tb
[IFLA_VXLAN_UDP_CSUM
]);
567 if (is_json_context()) {
568 print_bool(PRINT_ANY
, "udp_csum", NULL
, udp_csum
);
572 fputs("udpcsum ", f
);
576 if (tb
[IFLA_VXLAN_UDP_ZERO_CSUM6_TX
]) {
577 __u8 csum6
= rta_getattr_u8(tb
[IFLA_VXLAN_UDP_ZERO_CSUM6_TX
]);
579 if (is_json_context()) {
580 print_bool(PRINT_ANY
,
581 "udp_zero_csum6_tx", NULL
, csum6
);
585 fputs("udp6zerocsumtx ", f
);
589 if (tb
[IFLA_VXLAN_UDP_ZERO_CSUM6_RX
]) {
590 __u8 csum6
= rta_getattr_u8(tb
[IFLA_VXLAN_UDP_ZERO_CSUM6_RX
]);
592 if (is_json_context()) {
593 print_bool(PRINT_ANY
,
600 fputs("udp6zerocsumrx ", f
);
604 if (tb
[IFLA_VXLAN_REMCSUM_TX
] &&
605 rta_getattr_u8(tb
[IFLA_VXLAN_REMCSUM_TX
]))
606 print_bool(PRINT_ANY
, "remcsum_tx", "remcsumtx ", true);
608 if (tb
[IFLA_VXLAN_REMCSUM_RX
] &&
609 rta_getattr_u8(tb
[IFLA_VXLAN_REMCSUM_RX
]))
610 print_bool(PRINT_ANY
, "remcsum_rx", "remcsumrx ", true);
612 if (tb
[IFLA_VXLAN_COLLECT_METADATA
] &&
613 rta_getattr_u8(tb
[IFLA_VXLAN_COLLECT_METADATA
]))
614 print_bool(PRINT_ANY
, "collect_metadata", "external ", true);
616 if (tb
[IFLA_VXLAN_GBP
])
617 print_bool(PRINT_ANY
, "gbp", "gbp ", true);
618 if (tb
[IFLA_VXLAN_GPE
])
619 print_bool(PRINT_ANY
, "gpe", "gpe ", true);
622 static void vxlan_print_help(struct link_util
*lu
, int argc
, char **argv
,
628 struct link_util vxlan_link_util
= {
630 .maxattr
= IFLA_VXLAN_MAX
,
631 .parse_opt
= vxlan_parse_opt
,
632 .print_opt
= vxlan_print_opt
,
633 .print_help
= vxlan_print_help
,