diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2008-07-16 15:02:20 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2008-07-16 15:02:20 +0000 |
commit | 1d8de522c0cd9e758079fade03a68b98a284e4fc (patch) | |
tree | 41755d008a338ff635344b98767e947914157ff5 /usr.sbin | |
parent | 2b537341f180dbb28b96bf1d54c137a77ecff5cb (diff) |
relay_connect() may fail, close the session in the bindany callback
if it does.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/relayd/relay.c | 5 |
1 files changed, 3 insertions, 2 deletions
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 <reyk@openbsd.org> @@ -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 |