FreeBSD Bugzilla – Attachment 168087 Details for
Bug 207949
net-mgmt/nrpe add listen_queue_size config option [patch]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to net-mgmt/nrpe dir
nrpe.diff (text/plain), 3.86 KB, created by
emikulic
on 2016-03-13 13:47:40 UTC
(
hide
)
Description:
patch to net-mgmt/nrpe dir
Filename:
MIME Type:
Creator:
emikulic
Created:
2016-03-13 13:47:40 UTC
Size:
3.86 KB
patch
obsolete
>diff -Nur nrpe.old/Makefile nrpe/Makefile >--- nrpe.old/Makefile 2016-02-05 07:18:02.000000000 +1100 >+++ nrpe/Makefile 2016-03-14 00:43:14.000000000 +1100 >@@ -3,7 +3,7 @@ > > PORTNAME= nrpe > DISTVERSION= 2.15 >-PORTREVISION= 6 >+PORTREVISION= 7 > CATEGORIES= net-mgmt > MASTER_SITES= SF/nagios/${PORTNAME}-2.x/${PORTNAME}-${PORTVERSION} > >diff -Nur nrpe.old/files/patch-listen_queue_size.diff nrpe/files/patch-listen_queue_size.diff >--- nrpe.old/files/patch-listen_queue_size.diff 1970-01-01 10:00:00.000000000 +1000 >+++ nrpe/files/patch-listen_queue_size.diff 2016-03-14 00:41:27.000000000 +1100 >@@ -0,0 +1,114 @@ >+https://github.com/NagiosEnterprises/nrpe/commit/15fb2cffb3c97ce24e1a60efbbf88133add157f4.patch >+ >+diff --git Changelog Changelog >+index e001957..c254e3b 100644 >+--- Changelog >++++ Changelog >+@@ -2,6 +2,11 @@ >+ NRPE Changelog >+ ************** >+ >++2.16 = xx/xx/xxxx >++----------------- >++ENHANCEMENTS >++- Added listen_queue_size as configuration option (Vadim Antipov, Kaspersky Lab) >++ >+ 2.15 - 09/06/2013 >+ ----------------- >+ - Now compiles on HP-UX (Grant Byers) >+diff --git sample-config/nrpe.cfg.in sample-config/nrpe.cfg.in >+index da6a280..beb81bf 100644 >+--- sample-config/nrpe.cfg.in >++++ sample-config/nrpe.cfg.in >+@@ -45,6 +45,14 @@ server_port=@nrpe_port@ >+ >+ >+ >++# LISTEN QUEUE SIZE >++# Listen queue size (backlog) for serving incoming connections. >++# You may want to increase this value under high load. >++ >++#listen_queue_size=5 >++ >++ >++ >+ # NRPE USER >+ # This determines the effective user that the NRPE daemon should run as. >+ # You can either supply a username or a UID. >+diff --git src/nrpe.c src/nrpe.c >+index 381f0ac..4bc849b 100644 >+--- src/nrpe.c >++++ src/nrpe.c >+@@ -56,6 +56,7 @@ int use_ssl=FALSE; >+ #define NASTY_METACHARS "|`&><'\"\\[]{};" >+ #define howmany(x,y) (((x)+((y)-1))/(y)) >+ #define MAX_LISTEN_SOCKS 16 >++#define DEFAULT_LISTEN_QUEUE_SIZE 5 >+ >+ >+ char *command_name=NULL; >+@@ -98,6 +99,7 @@ int show_version=FALSE; >+ int use_inetd=TRUE; >+ int debug=FALSE; >+ int use_src=FALSE; /* Define parameter for SRC option */ >++int listen_queue_size=DEFAULT_LISTEN_QUEUE_SIZE; >+ >+ >+ void complete_SSL_shutdown( SSL *); >+@@ -598,6 +600,14 @@ int read_config_file(char *filename){ >+ else if(!strcmp(varname,"pid_file")) >+ pid_file=strdup(varvalue); >+ >++ else if(!strcmp(varname,"listen_queue_size")){ >++ listen_queue_size=atoi(varvalue); >++ if(listen_queue_size == 0){ >++ syslog(LOG_ERR,"Invalid listen queue size specified in config file '%s' - Line %d\n",filename,line); >++ return ERROR; >++ } >++ } >++ >+ else if(!strcmp(varname,"log_facility")){ >+ if((get_log_facility(varvalue))==OK){ >+ /* re-open log using new facility */ >+@@ -859,7 +869,7 @@ void create_listener(struct addrinfo *ai) { >+ num_listen_socks++; >+ >+ /* Start listening on the port. */ >+- if (listen(listen_sock, 5) < 0) { >++ if (listen(listen_sock, listen_queue_size) < 0) { >+ syslog(LOG_ERR, "listen on [%s]:%s: %.100s", ntop, strport, >+ strerror(errno)); >+ exit(1); >+@@ -1131,7 +1141,16 @@ void wait_for_connections(void){ >+ >+ /* log info to syslog facility */ >+ if(debug==TRUE) { >+- syslog(LOG_DEBUG,"Connection from %s closed.",ipstr); >++ switch(addr.ss_family) { >++ case AF_INET: >++ syslog(LOG_DEBUG,"Connection from %s closed.", >++ inet_ntoa(nptr->sin_addr)); >++ break; >++ case AF_INET6: >++ syslog(LOG_DEBUG,"Connection from %s closed.", >++ ipstr); >++ break; >++ } >+ } >+ >+ /* close socket prior to exiting */ >+@@ -1276,10 +1295,10 @@ void handle_connection(int sock){ >+ } >+ >+ #ifdef DEBUG >+- fp=fopen("/tmp/packet","w"); >+- if(fp){ >+- fwrite(&receive_packet,1,sizeof(receive_packet),fp); >+- fclose(fp); >++ errfp=fopen("/tmp/packet","w"); >++ if(errfp){ >++ fwrite(&receive_packet,1,sizeof(receive_packet),errfp); >++ fclose(errfp); >+ } >+ #endif >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207949
: 168087