Merge commit 'crater/master'
[dragonfly.git] / contrib / tcp_wrappers / refuse.c
blob85299c974a5a5cb45e43b1ea5782fc550e1a1b27
1 /*
2 * refuse() reports a refused connection, and takes the consequences: in
3 * case of a datagram-oriented service, the unread datagram is taken from
4 * the input queue (or inetd would see the same datagram again and again);
5 * the program is terminated.
6 *
7 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
9 * $FreeBSD: src/contrib/tcp_wrappers/refuse.c,v 1.2 2000/02/03 10:26:58 shin Exp $
10 * $DragonFly: src/contrib/tcp_wrappers/refuse.c,v 1.2 2003/06/17 04:24:06 dillon Exp $
13 #ifndef lint
14 static char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39";
15 #endif
17 /* System libraries. */
19 #include <stdio.h>
20 #include <syslog.h>
22 /* Local stuff. */
24 #include "tcpd.h"
26 /* refuse - refuse request */
28 void refuse(request)
29 struct request_info *request;
31 #ifdef INET6
32 syslog(deny_severity, "refused connect from %s (%s)",
33 eval_client(request), eval_hostaddr(request->client));
34 #else
35 syslog(deny_severity, "refused connect from %s", eval_client(request));
36 #endif
37 clean_exit(request);
38 /* NOTREACHED */