From: reyk Date: Wed, 16 Jul 2008 15:02:19 +0000 (+0000) Subject: relay_connect() may fail, close the session in the bindany callback X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=40789354a4fd0f28d4f1f9171ca9c1a24bac957f;p=openbsd relay_connect() may fail, close the session in the bindany callback if it does. --- diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c index baa9f697972..21cbc69750e 100644 --- a/usr.sbin/relayd/relay.c +++ b/usr.sbin/relayd/relay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay.c,v 1.93 2008/07/16 14:49:44 reyk Exp $ */ +/* $OpenBSD: relay.c,v 1.94 2008/07/16 15:02:19 reyk Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Reyk Floeter @@ -2178,7 +2178,8 @@ relay_bindany(int fd, short event, void *arg) return; } - relay_connect((struct session *)con); + if (relay_connect((struct session *)con) == -1) + relay_close(con, "session failed"); } int