]> git.proxmox.com Git - mirror_frr.git/commitdiff
bfdd: keep source information for single hop
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Mon, 8 Jul 2019 18:56:56 +0000 (15:56 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 9 Jul 2019 12:49:45 +0000 (09:49 -0300)
Add source address to northbound when creating sessions with this
information. It is not possible to change source address after the
session was created, but we should be able to set it to make IPv6 work.

Spotted by Philippe Guibert.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
bfdd/bfdd_cli.c

index c2c3040ebcd0ae16b8cc29cdf218f2db13744161..acb1801cc431f471808de29285b2185967000569 100644 (file)
@@ -108,8 +108,8 @@ DEFPY_NOSH(
        VRF_NAME_STR)
 {
        int ret, slen;
-       char xpath[XPATH_MAXLEN];
        char source_str[INET6_ADDRSTRLEN];
+       char xpath[XPATH_MAXLEN], xpath_srcaddr[XPATH_MAXLEN + 32];
 
        if (multihop)
                snprintf(source_str, sizeof(source_str), "[source-addr='%s']",
@@ -134,6 +134,12 @@ DEFPY_NOSH(
                         VRF_DEFAULT_NAME);
 
        nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
+       if (multihop == NULL && local_address_str != NULL) {
+               snprintf(xpath_srcaddr, sizeof(xpath_srcaddr),
+                        "%s/source-addr", xpath);
+               nb_cli_enqueue_change(vty, xpath_srcaddr, NB_OP_MODIFY,
+                                     local_address_str);
+       }
 
        /* Apply settings immediately. */
        ret = nb_cli_apply_changes(vty, NULL);