diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2003-12-26 00:34:02 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2003-12-26 00:34:02 +0000 |
commit | a7d6f4d5ddac2334d4168baac2d984912c7a6552 (patch) | |
tree | b569533078399cdbbc1a28d95b0b636aa96dc852 | |
parent | e99ea62a478df4a827bdc40aaaa0447d418ca642 (diff) |
In the mrt state machine one state was forgotten. This caused the parent
process to quit it a fatal buf_close error message.
Noticed and reported by jakob@
OK henning@
-rw-r--r-- | usr.sbin/bgpd/mrt.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/mrt.c b/usr.sbin/bgpd/mrt.c index d863fae0db8..d1d730b63c7 100644 --- a/usr.sbin/bgpd/mrt.c +++ b/usr.sbin/bgpd/mrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mrt.c,v 1.11 2003/12/25 17:35:53 henning Exp $ */ +/* $OpenBSD: mrt.c,v 1.12 2003/12/26 00:34:01 claudio Exp $ */ /* * Copyright (c) 2003 Claudio Jeker <claudio@openbsd.org> @@ -283,7 +283,14 @@ mrt_state(struct mrtdump_config *m, enum imsg_type type, return (0); } break; - default: + case MRT_STATE_RUNNING: + if (type == IMSG_MRT_END) { + if (m->msgbuf.sock != -1) + close(m->msgbuf.sock); + m->msgbuf.sock = -1; + m->state = MRT_STATE_DONE; + return (0); + } break; } return (1); |