stats: Make net config optional
To support reporters without network configuration, this commit
introduces the have_net_config flag to provide corresponding error
messages.
Sponsored-by: On-Waves ehf
diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c
index 0911fbb..18ad283 100644
--- a/src/vty/stats_vty.c
+++ b/src/vty/stats_vty.c
@@ -281,18 +281,21 @@
vty_out(vty, " disable%s", VTY_NEWLINE);
- if (srep->dest_addr_str)
- vty_out(vty, " remote-ip %s%s",
- srep->dest_addr_str, VTY_NEWLINE);
- if (srep->dest_port)
- vty_out(vty, " remote-port %d%s",
- srep->dest_port, VTY_NEWLINE);
- if (srep->bind_addr_str)
- vty_out(vty, " local-ip %s%s",
- srep->bind_addr_str, VTY_NEWLINE);
- if (srep->mtu)
- vty_out(vty, " mtu %d%s",
- srep->mtu, VTY_NEWLINE);
+ if (srep->have_net_config) {
+ if (srep->dest_addr_str)
+ vty_out(vty, " remote-ip %s%s",
+ srep->dest_addr_str, VTY_NEWLINE);
+ if (srep->dest_port)
+ vty_out(vty, " remote-port %d%s",
+ srep->dest_port, VTY_NEWLINE);
+ if (srep->bind_addr_str)
+ vty_out(vty, " local-ip %s%s",
+ srep->bind_addr_str, VTY_NEWLINE);
+ if (srep->mtu)
+ vty_out(vty, " mtu %d%s",
+ srep->mtu, VTY_NEWLINE);
+ }
+
if (srep->name_prefix && *srep->name_prefix)
vty_out(vty, " prefix %s%s",
srep->name_prefix, VTY_NEWLINE);