]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
vxlan: add support for VXLAN-GPE
authorJiri Benc <jbenc@redhat.com>
Thu, 7 Apr 2016 12:36:29 +0000 (14:36 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 11 Apr 2016 22:15:49 +0000 (22:15 +0000)
Adds support to create a VXLAN-GPE interface.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
ip/iplink_vxlan.c
man/man8/ip-link.8.in

index e9d64b451677b58691b0b62a047ba20980030adc..49a40befa5d587b69ce7d50aa2e20a3f1bcdbcfb 100644 (file)
@@ -31,7 +31,7 @@ static void print_explain(FILE *f)
        fprintf(f, "                 [ ageing SECONDS ] [ maxaddress NUMBER ]\n");
        fprintf(f, "                 [ [no]udpcsum ] [ [no]udp6zerocsumtx ] [ [no]udp6zerocsumrx ]\n");
        fprintf(f, "                 [ [no]remcsumtx ] [ [no]remcsumrx ]\n");
-       fprintf(f, "                 [ [no]external ] [ gbp ]\n");
+       fprintf(f, "                 [ [no]external ] [ gbp ] [ gpe ]\n");
        fprintf(f, "\n");
        fprintf(f, "Where: VNI   := 0-16777215\n");
        fprintf(f, "       ADDR  := { IP_ADDRESS | any }\n");
@@ -79,6 +79,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
        __u8 remcsumrx = 0;
        __u8 metadata = 0;
        __u8 gbp = 0;
+       __u8 gpe = 0;
        int dst_port_set = 0;
        struct ifla_vxlan_port_range range = { 0, 0 };
 
@@ -239,6 +240,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
                        metadata = 0;
                } else if (!matches(*argv, "gbp")) {
                        gbp = 1;
+               } else if (!matches(*argv, "gpe")) {
+                       gpe = 1;
                } else if (matches(*argv, "help") == 0) {
                        explain();
                        return -1;
@@ -267,7 +270,9 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
                return -1;
        }
 
-       if (!dst_port_set) {
+       if (!dst_port_set && gpe) {
+               dstport = 4790;
+       } else if (!dst_port_set) {
                fprintf(stderr, "vxlan: destination port not specified\n"
                        "Will use Linux kernel default (non-standard value)\n");
                fprintf(stderr,
@@ -324,6 +329,8 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
 
        if (gbp)
                addattr_l(n, 1024, IFLA_VXLAN_GBP, NULL, 0);
+       if (gpe)
+               addattr_l(n, 1024, IFLA_VXLAN_GPE, NULL, 0);
 
 
        return 0;
@@ -490,6 +497,8 @@ static void vxlan_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
 
        if (tb[IFLA_VXLAN_GBP])
                fputs("gbp ", f);
+       if (tb[IFLA_VXLAN_GPE])
+               fputs("gpe ", f);
 }
 
 static void vxlan_print_help(struct link_util *lu, int argc, char **argv,
index f677f8c55365eb88165f072c5f6c0b54412b0443..984fb2eb0d63af4bdf2854a4a90b315e285df343 100644 (file)
@@ -425,6 +425,8 @@ the following additional arguments are supported:
 .RI "[no]external "
 ] [
 .B gbp
+] [
+.B gpe
 ]
 
 .in +8
@@ -566,6 +568,13 @@ Example:
 
 .in -4
 
+.sp
+.B gpe
+- enables the Generic Protocol extension (VXLAN-GPE). Currently, this is
+only supported together with the
+.B external
+keyword.
+
 .in -8
 
 .TP