]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: add an option to zebra command to change default vrf name
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 25 Jul 2018 07:38:56 +0000 (09:38 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 28 Aug 2018 14:23:50 +0000 (16:23 +0200)
There is a possibility to change the default vrf name, using the '-o'
option.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
doc/user/zebra.rst
zebra/main.c

index 8a394928c624dade40a2507e10fad198ea286e31..85f2a7af3eff53b2cb70813c309a06776b813762 100644 (file)
@@ -48,6 +48,13 @@ Besides the common invocation options (:ref:`common-invocation-options`), the
 
    .. seealso:: :ref:`zebra-vrf`
 
+.. option:: -o, --vrfdefaultname
+
+   When *Zebra* starts with this option, the default VRF name is changed to the
+   parameter.
+
+   .. seealso:: :ref:`zebra-vrf`
+
 .. option:: --v6-rr-semantics
 
    The linux kernel is receiving the ability to use the same route
index 5e7c69382fe96284329d2578e8c51a370be683f9..8db1c48f223bde679a58d1b0313a8b8ad4f14c7e 100644 (file)
@@ -99,6 +99,7 @@ struct option longopts[] = {
        {"ecmp", required_argument, NULL, 'e'},
        {"label_socket", no_argument, NULL, 'l'},
        {"retain", no_argument, NULL, 'r'},
+       {"vrfdefaultname", required_argument, NULL, 'o'},
 #ifdef HAVE_NETLINK
        {"vrfwnetns", no_argument, NULL, 'n'},
        {"nl-bufsize", required_argument, NULL, 's'},
@@ -235,7 +236,7 @@ int main(int argc, char **argv)
        frr_preinit(&zebra_di, argc, argv);
 
        frr_opt_add(
-               "bakz:e:l:r"
+               "bakz:e:l:o:r"
 #ifdef HAVE_NETLINK
                "s:n"
 #endif
@@ -254,6 +255,7 @@ int main(int argc, char **argv)
                "  -l, --label_socket    Socket to external label manager\n"
                "  -k, --keep_kernel     Don't delete old routes which were installed by zebra.\n"
                "  -r, --retain          When program terminates, retain added route by zebra.\n"
+               "  -o, --vrfdefaultname  Set default VRF name.\n"
 #ifdef HAVE_NETLINK
                "  -n, --vrfwnetns       Use NetNS as VRF backend\n"
                "  -s, --nl-bufsize      Set netlink receive buffer size\n"
@@ -296,6 +298,9 @@ int main(int argc, char **argv)
                                return 1;
                        }
                        break;
+               case 'o':
+                       vrf_set_default_name(optarg);
+                       break;
                case 'z':
                        zserv_path = optarg;
                        if (!frr_zclient_addr(&dummy, &dummylen, optarg)) {