diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2023-09-24 20:12:42 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2023-09-24 20:14:37 +0200 |
| commit | ee5dd0a0819eb8d1457cd1b58c19c813994511c7 (patch) | |
| tree | ebe8e7936922fdea563e95c408100c2f4c443533 /lib | |
| parent | 1c829fac8e034e9fc7f3ce778b853c9e62c825aa (diff) | |
lib: assert for VTY_PASSFD expectations
Coverity is complaining that vty->state could be VTY_PASSFD here. It
can't, it really shouldn't, and if it actually is then something went
seriously wrong somewhere earlier so assert()ing out is the best thing
to do.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/vty.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2386,9 +2386,14 @@ static void vtysh_read(struct event *thread) * => skip vty_event(VTYSH_READ, vty)! */ return; - } else + } 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" * - other commands in "buf" will be ditched |
