/[smeserver]/rpms/ipsvd/sme9/tcpsvd_keepalive.patch
ViewVC logotype

Annotation of /rpms/ipsvd/sme9/tcpsvd_keepalive.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Thu Apr 24 02:44:16 2014 UTC (10 years, 7 months ago) by wellsi
Branch: MAIN
CVS Tags: ipsvd-0_12_1-6_el6_sme
Changes since 1.1: +16 -28 lines
* Wed Dec 25 2013 Charlie Brady <charlieb@e-smith.com> 0.12.1-06
- Add option to tcpsvd to set socket keepalive. Code provided by Chris Maltby.
  [SME: 8084]

1 wellsi 1.2 diff -ru -I '\$Id:' net.old/ipsvd-0.12.1/src/socket_bind.c net/ipsvd-0.12.1/src/socket_bind.c
2     --- net.old/ipsvd-0.12.1/src/socket_bind.c 2006-02-04 14:16:48.000000000 -0500
3     +++ net/ipsvd-0.12.1/src/socket_bind.c 2013-12-26 15:47:25.166952124 -0500
4     @@ -31,3 +31,9 @@
5 charliebrady 1.1 size -= (size >> 5);
6     }
7     }
8     +
9     +int socket_keepalive(int s)
10     +{
11     + int opt = 1;
12     + return setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,&opt,sizeof opt);
13     +}
14 wellsi 1.2 diff -ru -I '\$Id:' net.old/ipsvd-0.12.1/src/socket.h net/ipsvd-0.12.1/src/socket.h
15     --- net.old/ipsvd-0.12.1/src/socket.h 2006-02-04 14:16:48.000000000 -0500
16     +++ net/ipsvd-0.12.1/src/socket.h 2013-12-26 15:47:25.167952137 -0500
17     @@ -18,5 +18,6 @@
18 charliebrady 1.1 extern int socket_remote4(int,char *,uint16 *);
19    
20     extern void socket_tryreservein(int,int);
21     +extern int socket_keepalive(int);
22    
23     #endif
24 wellsi 1.2 diff -ru -I '\$Id:' net.old/ipsvd-0.12.1/src/tcpsvd.c net/ipsvd-0.12.1/src/tcpsvd.c
25     --- net.old/ipsvd-0.12.1/src/tcpsvd.c 2006-02-04 14:16:47.000000000 -0500
26     +++ net/ipsvd-0.12.1/src/tcpsvd.c 2013-12-26 15:48:10.644538719 -0500
27     @@ -32,9 +32,9 @@
28 charliebrady 1.1 #endif
29    
30     #ifdef SSLSVD
31     -#define USAGE " [-Ehpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] [-U ssluser] [-/ root] [-Z cert] [-K key] host port prog"
32     +#define USAGE " [-Ehkpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] [-U ssluser] [-/ root] [-Z cert] [-K key] host port prog"
33     #else
34     -#define USAGE " [-Ehpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] host port prog"
35     +#define USAGE " [-Ehkpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] host port prog"
36     #endif
37    
38     #define VERSION "$Id: tcpsvd.c,v 1.24 2006/02/03 19:30:24 pape Exp $"
39 wellsi 1.2 @@ -54,6 +54,7 @@
40 charliebrady 1.1 unsigned long cnum =0;
41     unsigned long cmax =30;
42     unsigned long timeout =0;
43     +unsigned int keepalive =0;
44    
45     unsigned int ucspi =1;
46     const char *instructs =0;
47 wellsi 1.2 @@ -241,6 +242,8 @@
48 charliebrady 1.1 else run =prog;
49     if ((fd_move(0, c) == -1) || (fd_copy(1, 0) == -1))
50     drop("unable to set filedescriptor");
51     + if (keepalive)
52     + socket_keepalive(0);
53     sig_uncatch(sig_term);
54     sig_uncatch(sig_pipe);
55     sig_uncatch(sig_child);
56 wellsi 1.2 @@ -271,10 +274,10 @@
57 charliebrady 1.1
58     #ifdef SSLSVD
59     while ((opt =getopt(argc, (const char **)argv,
60     - "c:C:i:x:u:l:Eb:hpt:vVU:/:Z:K:")) != opteof) {
61     + "c:C:i:x:u:l:Eb:hkpt:vVU:/:Z:K:")) != opteof) {
62     #else
63     while ((opt =getopt(argc, (const char **)argv,
64     - "c:C:i:x:u:l:Eb:hpt:vV")) != opteof) {
65     + "c:C:i:x:u:l:Eb:hpkt:vV")) != opteof) {
66     #endif
67     switch(opt) {
68     case 'c': scan_ulong(optarg, &cmax); if (cmax < 1) usage(); break;
69 wellsi 1.2 @@ -297,6 +300,7 @@
70 charliebrady 1.1 case 'E': ucspi =0; break;
71     case 'b': scan_ulong(optarg, &backlog); break;
72     case 'h': lookuphost =1; break;
73     + case 'k': keepalive =1; break;
74     case 'p': lookuphost =1; paranoid =1; break;
75     case 't': scan_ulong(optarg, &timeout); break;
76     case 'v': ++verbose; break;

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed