Gentoo Archives: gentoo-commits

From: "Pacho Ramos (pacho)" <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-misc/l7-filter-userspace/files: l7-filter-userspace-0.11-pattern-loading-leak.patch l7-filter-userspace-0.11-map-access-threadsafe.patch l7-filter-userspace-0.11-arm-ppc-getopt-help-fix.patch
Date: Sat, 03 Mar 2012 15:31:57
Message-Id: 20120303153146.35A642004B@flycatcher.gentoo.org
1 pacho 12/03/03 15:31:46
2
3 Added: l7-filter-userspace-0.11-pattern-loading-leak.patch
4 l7-filter-userspace-0.11-map-access-threadsafe.patch
5 l7-filter-userspace-0.11-arm-ppc-getopt-help-fix.patch
6 Log:
7 Include fixes from debian and ppc/arm compatibility, bug #329397 (by Gavin Pryke).
8
9 (Portage version: 2.1.10.49/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.1 net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-pattern-loading-leak.patch
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-pattern-loading-leak.patch?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-pattern-loading-leak.patch?rev=1.1&content-type=text/plain
16
17 Index: l7-filter-userspace-0.11-pattern-loading-leak.patch
18 ===================================================================
19 diff --git a/l7-filter-userspace/trunk/l7-classify.cpp b/l7-filter-userspace/trunk/l7-classify.cpp
20 index 8b5b77e..1c80d4d 100644
21 --- a/l7-filter-userspace/trunk/l7-classify.cpp
22 +++ b/l7-filter-userspace/trunk/l7-classify.cpp
23 @@ -59,6 +59,7 @@ l7_pattern::l7_pattern(string name, string pattern_string, int eflags,
24 cerr << "error compiling " << name << " -- " << pattern_string << endl;
25 exit(1);
26 }
27 + free(preprocessed);
28 }
29
30
31
32 1.1 net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-map-access-threadsafe.patch
33
34 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-map-access-threadsafe.patch?rev=1.1&view=markup
35 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-map-access-threadsafe.patch?rev=1.1&content-type=text/plain
36
37 Index: l7-filter-userspace-0.11-map-access-threadsafe.patch
38 ===================================================================
39 --- l7-filter-userspace-0.11/l7-conntrack.cpp.orig 2009-02-26 21:40:28.000000000 +0000
40 +++ l7-filter-userspace-0.11/l7-conntrack.cpp 2010-07-23 13:03:23.000000000 +0100
41 @@ -195,11 +195,13 @@
42 {
43 nfct_conntrack_free(ct);
44 nfct_close(cth);
45 + pthread_mutex_destroy(&map_mutex);
46 }
47
48 l7_conntrack::l7_conntrack(void* l7_classifier_in)
49 {
50 l7_classifier = (l7_classify *)l7_classifier_in;
51 + pthread_mutex_init(&map_mutex, NULL);
52
53 // Now open a handler that is subscribed to all possible events
54 cth = nfct_open(CONNTRACK, NFCT_ALL_CT_GROUPS);
55 @@ -211,19 +213,27 @@
56
57 l7_connection *l7_conntrack::get_l7_connection(const string key)
58 {
59 - return l7_connections[key];
60 + l7_connection *conn;
61 + pthread_mutex_lock(&map_mutex);
62 + conn = l7_connections[key];
63 + pthread_mutex_unlock(&map_mutex);
64 + return conn;
65 }
66
67 void l7_conntrack::add_l7_connection(l7_connection* connection,
68 const string key)
69 {
70 + pthread_mutex_lock(&map_mutex);
71 l7_connections[key] = connection;
72 + pthread_mutex_unlock(&map_mutex);
73 }
74
75 void l7_conntrack::remove_l7_connection(const string key)
76 {
77 + pthread_mutex_lock(&map_mutex);
78 delete l7_connections[key];
79 l7_connections.erase(l7_connections.find(key));
80 + pthread_mutex_unlock(&map_mutex);
81 }
82
83 void l7_conntrack::start()
84 --- l7-filter-userspace-0.11/l7-conntrack.h.orig 2010-07-23 13:04:49.000000000 +0100
85 +++ l7-filter-userspace-0.11/l7-conntrack.h 2010-07-23 13:05:56.000000000 +0100
86 @@ -52,6 +52,7 @@
87 l7_map l7_connections;
88 struct nfct_conntrack *ct;
89 struct nfct_handle *cth; // the callback
90 + pthread_mutex_t map_mutex;
91
92 public:
93 l7_conntrack(void * foo);
94
95
96
97 1.1 net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-arm-ppc-getopt-help-fix.patch
98
99 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-arm-ppc-getopt-help-fix.patch?rev=1.1&view=markup
100 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/l7-filter-userspace/files/l7-filter-userspace-0.11-arm-ppc-getopt-help-fix.patch?rev=1.1&content-type=text/plain
101
102 Index: l7-filter-userspace-0.11-arm-ppc-getopt-help-fix.patch
103 ===================================================================
104 --- l7-filter-userspace-0.11/l7-filter.cpp.old 2010-07-12 10:43:58.485002456 +0100
105 +++ l7-filter-userspace-0.11/l7-filter.cpp 2010-07-12 11:14:38.825001868 +0100
106 @@ -186,15 +186,11 @@
107 conffilename = "";
108 const char *opts = "f:q:vh?sb:dn:p:m:cz";
109
110 - int done = 0;
111 - while(!done)
112 + int c;
113 + while ((c = getopt (argc, argv, opts)) != -1)
114 {
115 - char c;
116 - switch(c = getopt(argc, argv, opts))
117 + switch(c)
118 {
119 - case -1:
120 - done = 1;
121 - break;
122 case 'f':
123 conffilename = optarg;
124 break;