freebsd-src/contrib/tcp_wrappers/refuse.c
Ed Maste e85ca03254 tcp_wrappers: Use ANSI (c89) function definitions
Although this code is in contrib/ there is no active upstream.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36047

(cherry picked from commit 14f102eacc)
(cherry picked from commit 899becbfcb)
2023-04-05 08:33:11 -04:00

39 lines
902 B
C

/*
* refuse() reports a refused connection, and takes the consequences: in
* case of a datagram-oriented service, the unread datagram is taken from
* the input queue (or inetd would see the same datagram again and again);
* the program is terminated.
*
* Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
*
* $FreeBSD$
*/
#ifndef lint
static char sccsid[] = "@(#) refuse.c 1.5 94/12/28 17:42:39";
#endif
/* System libraries. */
#include <stdio.h>
#include <syslog.h>
/* Local stuff. */
#include "tcpd.h"
/* refuse - refuse request */
void refuse(struct request_info *request)
{
#ifdef INET6
syslog(deny_severity, "refused connect from %s (%s)",
eval_client(request), eval_hostaddr(request->client));
#else
syslog(deny_severity, "refused connect from %s", eval_client(request));
#endif
clean_exit(request);
/* NOTREACHED */
}