summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2008-07-09 14:06:45 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2008-07-09 14:06:45 +0000
commit9615e8c8bcf3c4ae99a33e347222a640415f9c45 (patch)
tree1d99457d3af6dd6c2b64923c47ad1d6599224a2e
parent845351c44038f6476c8452e0d9823e8bc1014dc5 (diff)
only use SOCK_STREAM for TCP in bindany(), otherwise SOCK_DGRAM for UDP.
-rw-r--r--usr.sbin/relayd/relayd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/relayd/relayd.c b/usr.sbin/relayd/relayd.c
index f1588bd5fc3..fad7f12692d 100644
--- a/usr.sbin/relayd/relayd.c
+++ b/usr.sbin/relayd/relayd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relayd.c,v 1.77 2008/06/11 18:21:20 reyk Exp $ */
+/* $OpenBSD: relayd.c,v 1.78 2008/07/09 14:06:44 reyk Exp $ */
/*
* Copyright (c) 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -1181,7 +1181,8 @@ bindany(struct ctl_bindany *bnd)
if (relay_socket_af(&bnd->bnd_ss, bnd->bnd_port) == -1)
goto fail;
- if ((s = socket(bnd->bnd_ss.ss_family, SOCK_STREAM,
+ if ((s = socket(bnd->bnd_ss.ss_family,
+ bnd->bnd_proto == IPPROTO_TCP ? SOCK_STREAM : SOCK_DGRAM,
bnd->bnd_proto)) == -1)
goto fail;
if (setsockopt(s, SOL_SOCKET, SO_BINDANY,