summaryrefslogtreecommitdiffstats
path: root/bfdd
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2019-07-08 20:56:56 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2019-07-09 14:49:45 +0200
commit284062bf1776cf544749c36a57096a138fe4bffb (patch)
treed3dfe395fbe6b3de1d4028129111e437b7159324 /bfdd
parentyang: change single hop `leaf` order (diff)
downloadfrr-284062bf1776cf544749c36a57096a138fe4bffb.tar.xz
frr-284062bf1776cf544749c36a57096a138fe4bffb.zip
bfdd: keep source information for single hop
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>
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfdd_cli.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c
index c2c3040eb..acb1801cc 100644
--- a/bfdd/bfdd_cli.c
+++ b/bfdd/bfdd_cli.c
@@ -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);