summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/vty.c b/lib/vty.c
index fea4c49032..21b3d47b09 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -1810,7 +1810,12 @@ static int vty_accept(struct thread *thread)
set_nonblocking(vty_sock);
set_cloexec(vty_sock);
- sockunion2hostprefix(&su, &p);
+ if (!sockunion2hostprefix(&su, &p)) {
+ close(vty_sock);
+ zlog_info("Vty unable to convert prefix from sockunion %s",
+ sockunion2str(&su, buf, SU_ADDRSTRLEN));
+ return -1;
+ }
/* VTY's accesslist apply. */
if (p.family == AF_INET && vty_accesslist_name) {