diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2010-06-27 05:15:21 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2010-06-27 05:15:21 +0000 |
commit | a7281d6ce130e719b58589eec602c192037acbfd (patch) | |
tree | b81901f566e60e43ff667828eb947af60109f447 /usr.sbin | |
parent | a805b6617f74b055b865f91720ddc36e0207e7da (diff) |
fix rtmsg_process to return on an error during processing rather than
continue. fix kr_dispatch_msg so it acts when rtmsg_process fails.
from andrew sallaway based on discussion with claudio@
ok claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ospfd/kroute.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c index d35289d4d64..63889f1d8ce 100644 --- a/usr.sbin/ospfd/kroute.c +++ b/usr.sbin/ospfd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.83 2010/06/23 23:34:02 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.84 2010/06/27 05:15:20 dlg Exp $ */ /* * Copyright (c) 2004 Esben Norby <norby@openbsd.org> @@ -392,7 +392,8 @@ void kr_dispatch_msg(int fd, short event, void *bula) { /* XXX this is stupid */ - dispatch_rtmsg(); + if (dispatch_rtmsg() == -1) + event_loopexit(NULL); } void @@ -1454,8 +1455,7 @@ add: if ((kr = calloc(1, sizeof(struct kroute_node))) == NULL) { log_warn("dispatch calloc"); - rv = -1; - break; + return (-1); } kr->r.prefix.s_addr = prefix.s_addr; @@ -1472,7 +1472,7 @@ add: RTM_DELETE, &kr->r); free(kr); if (rv == -1) - break; + return (-1); } else { if ((label = (struct sockaddr_rtlabel *) rti_info[RTAX_LABEL]) != NULL) { |