summaryrefslogtreecommitdiff
path: root/usr.sbin/hoststated
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-02-06 11:21:36 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2007-02-06 11:21:36 +0000
commit8b68956f0026a649b3e16596b9d88c9a41fdf2c9 (patch)
tree1145dcad90b2437771c165c0568e9b938a993a37 /usr.sbin/hoststated
parent132be924b5dfc58c2095c55c13384e7ff4453857 (diff)
fix a bug when enabling a service that has no backup table.
ok reyk@
Diffstat (limited to 'usr.sbin/hoststated')
-rw-r--r--usr.sbin/hoststated/pfe.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/hoststated/pfe.c b/usr.sbin/hoststated/pfe.c
index 2e82cf1e9aa..d02fbce1251 100644
--- a/usr.sbin/hoststated/pfe.c
+++ b/usr.sbin/hoststated/pfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfe.c,v 1.12 2007/02/06 08:46:31 pyr Exp $ */
+/* $OpenBSD: pfe.c,v 1.13 2007/02/06 11:21:35 pyr Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org>
@@ -359,6 +359,8 @@ enable_service(struct ctl_conn *c, struct ctl_id *id)
eid.id = service->table->id;
if (enable_table(c, &eid) == -1)
return (-1);
+ if (service->backup->id == EMPTY_ID)
+ return (0);
eid.id = service->backup->id;
if (enable_table(c, &eid) == -1)
return (-1);