summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 23aa2d1f38..15cc340eb0 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2368,8 +2368,7 @@ static void vtysh_read(struct event *thread)
printf("result: %d\n", ret);
printf("vtysh node: %d\n", vty->node);
#endif /* VTYSH_DEBUG */
-
- if (vty->pass_fd != -1) {
+ if (vty->pass_fd >= 0) {
memset(vty->pass_fd_status, 0, 4);
vty->pass_fd_status[3] = ret;
vty->status = VTY_PASSFD;
@@ -2387,6 +2386,13 @@ static void vtysh_read(struct event *thread)
* => skip vty_event(VTYSH_READ, vty)!
*/
return;
+ } else {
+ assertf(vty->status != VTY_PASSFD,
+ "%p address=%s passfd=%d", vty,
+ vty->address, vty->pass_fd);
+
+ /* normalize other invalid values */
+ vty->pass_fd = -1;
}
/* hack for asynchronous "write integrated"