1 |
angelos 08/04/27 14:54:53 |
2 |
|
3 |
Added: oidentd-2.0.8-masquerading.patch |
4 |
Log: |
5 |
Added a patch for masquerading on Linux 2.6.21 |
6 |
(Portage version: 2.1.5_rc6) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 net-misc/oidentd/files/oidentd-2.0.8-masquerading.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/oidentd/files/oidentd-2.0.8-masquerading.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/oidentd/files/oidentd-2.0.8-masquerading.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: oidentd-2.0.8-masquerading.patch |
15 |
=================================================================== |
16 |
--- oidentd.orig/src/kernel/linux.c 2006-05-22 06:58:53.000000000 +0300 |
17 |
+++ oidentd-2.0.8/src/kernel/linux.c 2007-07-11 21:28:56.000000000 +0300 |
18 |
@@ -48,6 +48,7 @@ |
19 |
#define CFILE6 "/proc/net/tcp6" |
20 |
#define MASQFILE "/proc/net/ip_masquerade" |
21 |
#define CONNTRACK "/proc/net/ip_conntrack" |
22 |
+#define NFCONNTRACK "/proc/net/nf_conntrack" |
23 |
|
24 |
static int netlink_sock; |
25 |
extern struct sockaddr_storage proxy; |
26 |
@@ -82,7 +83,15 @@ |
27 |
debug("fopen: %s: %s", CONNTRACK, strerror(errno)); |
28 |
return false; |
29 |
} |
30 |
- masq_fp = fopen("/dev/null", "r"); |
31 |
+ |
32 |
+ masq_fp = fopen(NFCONNTRACK, "r"); |
33 |
+ if (masq_fp == NULL) { |
34 |
+ if (errno != ENOENT) { |
35 |
+ debug("fopen: %s: %s", NFCONNTRACK, strerror(errno)); |
36 |
+ return false; |
37 |
+ } |
38 |
+ masq_fp = fopen("/dev/null", "r"); |
39 |
+ } |
40 |
} |
41 |
|
42 |
netfilter = true; |
43 |
@@ -367,6 +376,15 @@ |
44 |
&nport_temp, &mport_temp); |
45 |
} |
46 |
|
47 |
+ if (ret != 21) { |
48 |
+ ret = sscanf(buf, |
49 |
+ "%*15s %*d %15s %*d %*d ESTABLISHED src=%d.%d.%d.%d dst=%d.%d.%d.%d sport=%d dport=%d packets=%*d bytes=%*d src=%d.%d.%d.%d dst=%d.%d.%d.%d sport=%d dport=%d", |
50 |
+ proto, &l1, &l2, &l3, &l4, &r1, &r2, &r3, &r4, |
51 |
+ &masq_lport_temp, &masq_fport_temp, |
52 |
+ &nl1, &nl2, &nl3, &nl4, &nr1, &nr2, &nr3, &nr4, |
53 |
+ &nport_temp, &mport_temp); |
54 |
+ } |
55 |
+ |
56 |
if (ret != 21) |
57 |
continue; |
58 |
|
59 |
|
60 |
|
61 |
|
62 |
-- |
63 |
gentoo-commits@l.g.o mailing list |