]> git.proxmox.com Git - mirror_frr.git/commitdiff
eigrpd: Allow eigrp to set/unset the router-id as a value.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 31 Dec 2018 00:59:52 +0000 (19:59 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 31 Dec 2018 00:59:52 +0000 (19:59 -0500)
This code addition allows eigrp to set/unset the router-id
value.  At this point I am not 100% sure that we do all the necessary
rework when a router-id changes.  But on startup if read in before
a network statement we should be ok.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
eigrpd/eigrp_vty.c

index 7baf7b9f6bc1e56b64f569ff5dcd148b6e3e79ed..f29305e7a3117015726358fe6ef39c946e60b2dd 100644 (file)
@@ -250,29 +250,31 @@ DEFUN (no_router_eigrp,
        return CMD_SUCCESS;
 }
 
-DEFUN (eigrp_router_id,
+DEFPY (eigrp_router_id,
        eigrp_router_id_cmd,
-       "eigrp router-id A.B.C.D",
+       "eigrp router-id A.B.C.D$addr",
        "EIGRP specific commands\n"
        "Router ID for this EIGRP process\n"
        "EIGRP Router-ID in IP address format\n")
 {
-       // struct eigrp *eigrp = vty->index;
-       /*TODO: */
+       VTY_DECLVAR_CONTEXT(eigrp, eigrp);
+
+       eigrp->router_id_static = addr;
 
        return CMD_SUCCESS;
 }
 
-DEFUN (no_eigrp_router_id,
+DEFPY (no_eigrp_router_id,
        no_eigrp_router_id_cmd,
-       "no eigrp router-id A.B.C.D",
+       "no eigrp router-id [A.B.C.D$addr]",
        NO_STR
        "EIGRP specific commands\n"
        "Router ID for this EIGRP process\n"
        "EIGRP Router-ID in IP address format\n")
 {
-       // struct eigrp *eigrp = vty->index;
-       /*TODO: */
+       VTY_DECLVAR_CONTEXT(eigrp, eigrp);
+
+       eigrp->router_id_static.s_addr = 0;
 
        return CMD_SUCCESS;
 }