You can subscribe to this list here.
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(21) |
Nov
(30) |
Dec
(9) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2011 |
Jan
(9) |
Feb
(11) |
Mar
(18) |
Apr
(75) |
May
(28) |
Jun
(9) |
Jul
(8) |
Aug
(21) |
Sep
(8) |
Oct
(12) |
Nov
(21) |
Dec
(15) |
| 2012 |
Jan
(24) |
Feb
(35) |
Mar
(18) |
Apr
(9) |
May
(22) |
Jun
(60) |
Jul
(22) |
Aug
(3) |
Sep
(21) |
Oct
(29) |
Nov
(18) |
Dec
(18) |
| 2013 |
Jan
(11) |
Feb
(21) |
Mar
|
Apr
(2) |
May
(5) |
Jun
(7) |
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(4) |
Nov
|
Dec
(13) |
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(24) |
Jun
(2) |
Jul
(4) |
Aug
(54) |
Sep
(18) |
Oct
(22) |
Nov
(29) |
Dec
(65) |
| 2017 |
Jan
(26) |
Feb
(2) |
Mar
(2) |
Apr
(4) |
May
(25) |
Jun
(6) |
Jul
(6) |
Aug
(18) |
Sep
(14) |
Oct
|
Nov
|
Dec
(4) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
(10) |
Mar
(8) |
Apr
(8) |
May
(7) |
Jun
(15) |
Jul
(15) |
Aug
(11) |
Sep
(10) |
Oct
(21) |
Nov
(25) |
Dec
(10) |
| 2020 |
Jan
(9) |
Feb
(10) |
Mar
(21) |
Apr
(38) |
May
(21) |
Jun
(28) |
Jul
(65) |
Aug
(53) |
Sep
(76) |
Oct
(37) |
Nov
(14) |
Dec
(18) |
| 2021 |
Jan
(26) |
Feb
(14) |
Mar
(33) |
Apr
(59) |
May
(23) |
Jun
(36) |
Jul
(14) |
Aug
(15) |
Sep
(20) |
Oct
(34) |
Nov
(35) |
Dec
(40) |
| 2022 |
Jan
(30) |
Feb
(46) |
Mar
(57) |
Apr
(38) |
May
(49) |
Jun
(27) |
Jul
(34) |
Aug
(83) |
Sep
(29) |
Oct
(28) |
Nov
(66) |
Dec
(116) |
| 2023 |
Jan
(95) |
Feb
(64) |
Mar
(116) |
Apr
(29) |
May
(58) |
Jun
(30) |
Jul
(162) |
Aug
(117) |
Sep
(222) |
Oct
(197) |
Nov
(272) |
Dec
(174) |
| 2024 |
Jan
(156) |
Feb
(182) |
Mar
(220) |
Apr
(150) |
May
(165) |
Jun
(207) |
Jul
(157) |
Aug
(94) |
Sep
(226) |
Oct
(363) |
Nov
(333) |
Dec
(286) |
| 2025 |
Jan
(331) |
Feb
(265) |
Mar
(273) |
Apr
(250) |
May
(277) |
Jun
(504) |
Jul
(394) |
Aug
(497) |
Sep
(552) |
Oct
(601) |
Nov
(500) |
Dec
(296) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenVPN with experimental and new features - which requires a lot of testing".
The branch, bugfix2.1 has been created
at d6b783a8ec505c8e158bd0304c5e195cff5bb8c3 (commit)
- Log -----------------------------------------------------------------
commit d6b783a8ec505c8e158bd0304c5e195cff5bb8c3
Author: David Sommerseth <da...@us...>
Date: Fri Sep 17 17:10:25 2010 +0200
Fixed compiler warnings reported on Ubuntu 10.04
The warnings reported where:
--------------------------------------------------------
misc.c:158: warning: ignoring return value of ‘nice’, declared with attribute warn_unused_result
options.c:4033: warning: format not a string literal and no format arguments
options.c:4043: warning: format not a string literal and no format arguments
options.c:4053: warning: format not a string literal and no format arguments
push.c:182: warning: format not a string literal and no format arguments
push.c:199: warning: format not a string literal and no format arguments
push.c:235: warning: format not a string literal and no format arguments
status.c:171: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result
--------------------------------------------------------
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
Acked-by: Peter Stuge <pe...@st...>
commit 6f1e61b41be52fd0e7f4655ebc3000f63254aede
Author: David Sommerseth <da...@us...>
Date: Wed Aug 18 17:05:09 2010 +0200
More t_client.sh updates - exit with SKIP when we want to skip
Several places we exited with 0 instead of 77 when we want to indicate
that we should skip this test.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit f25fe91a40aa3fad21657f590fd5f5c34d9f64d9
Author: David Sommerseth <da...@us...>
Date: Wed Aug 18 15:00:13 2010 +0200
Test framework improvment - Do not FAIL if t_client.rc is missing
This is to avoid 'make check' fail if this extra test case is not
configured.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit 5086d75d8e8a3ec294cdb4ef5dacc403acc96bac
Author: Gert Doering <ge...@gr...>
Date: Tue Aug 10 12:39:28 2010 +0200
Build t_client.sh by configure at run-time.
This is now built using "configure", knows how to find "ip", "ifconfig" and "netstat" (configure
does the work :-) ), *and* has been tested on Solaris (works!).
extend configure.ac to find "netstat" binary and to chmod +x "t_client.sh"
Signed-off-by: Gert Doering <ge...@gr...>
Acked-by: David Sommerseth <da...@us...>
Signed-off-by: David Sommerseth <da...@us...>
commit 186f9a76fddfd7309fcb0e4a15e3498b37b16838
Author: Gert Doering <ge...@gr...>
Date: Sun Aug 8 21:24:30 2010 +0200
full "VPN client connect" test framework for OpenVPN
Run from "make check" if "t_client.rc" is found in workdir or srcdir
(copy t_client.rc-sample, fill in specifics for your test server)
How does it work?
- you run "sudo make check" (needs root access to configure tun if!)
- t_client.sh reads t_client.rc from current dir or ${srcdir}
- t_client.rc defines a number of "test suffixes" to run (could be
"1" "2" "3" or "p2m", "p2p", "special" or whatever you like), and
for each suffix, there's config variables to specify
- how to call OpenVPN
- which hosts to ping for IPv4 and IPv6 when OpenVPN is up
(and actually before starting OpenVPN - to make the test more
meaningful, I have decided that the test hosts must not ping
before the tests starts)
- which addresses must show up in the output of "ifconfig" after
OpenVPN has started
- all variables except OPENVPN_CONF_<x> are optional
(this should all be fairly obvious from looking at t_client.rc-sample)
- the script wants to connect to a well-defined OpenVPN server that
will assign well-known IPv4 (and IPv6) addresses, have well-defined
pingable addresse, etc. - so you need to setup the test server before
the script is useful for you. (Whether you use certificates or
username/password is up to you, you could even mix and match - run
one test with certs, and one with user/pass against different target
ports... :-) )
[we *could* run a "reference server" somewhere and ship a sample
t_client.rc + cert so that users could use this right away, but I
do not currently have the resources to run such a public server]
- whatever the script does is logged to a newly created directory
below the current directory (openvpn output, ifconfig+route before
starting OpenVPN, while running it, after ending it)
- important: at least on NetBSD and OpenBSD, the script will print
one failure, because the tun0 interface created is not destroyed
after openvpn ends. For OpenBSD, I have changed close_tun() to
do so ("ifconfig tun0 destroy"), for NetBSD I have not yet changed
anything - but I strongly believe that the output of "ifconfig+route"
should be reverted to exactly how it looked like before OpenVPN
was started, so I consider this a bug in the NetBSD-specific bits
of OpenVPN (and will look into this).
- the test framework has been tested on Linux, NetBSD and OpenBSD.
It *should* work fine on FreeBSD and Solaris.
It works on MacOS X (but the output looks funny, because /bin/sh
does not implement "echo -e" - need to add configure trickery)
It will *not* work on Windows yet - I haven't looked into what's
needed to make it work (background processes and signals in mingw
bash?), maybe it's as easy as adding the necessary "ipconfig" and
"netsh" commands to print interface + routing config...
- I have only tested "connect via IPv4 transport, use IPv4+IPv6 payload",
but the framework is generic enough that "connect via IPv6 transport"
should work just fine (just setup OPENVPN_CONF_x accordingly in the
t_client.rc).
- this is neither finished nor pretty, but it helps me a *lot* in
quickly testing whether I broke anything when fiddling system-dependent
code (tun.c, route.c) across multiple build hosts - so I hope this
is going to be fairly useful to Samuli and the buildbot :-)
Signed-off-by: Gert Doering <ge...@gr...>
Acked-by: David Sommerseth <da...@us...>
Signed-off-by: David Sommerseth <da...@us...>
commit 4c91fc83684874fb8f1a2ca061247956fb0fc77f
Author: chantra <ch...@de...>
Date: Fri Jul 16 20:09:07 2010 +0200
Fixes openssl-1.0.0 compilation warning
When compiling against OpenSSL v1.0.0, the following compiler warnings
appears.
ssl.c: In function ‘verify_callback’:
ssl.c:944: warning: passing argument 1 of ‘sk_num’ from incompatible
pointer type
/usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509_REVOKED *’
ssl.c:947: warning: passing argument 1 of ‘sk_value’ from incompatible
pointer type
/usr/include/openssl/stack.h:80: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509_REVOKED *’
ssl.c: In function ‘init_ssl’:
ssl.c:1565: warning: passing argument 1 of ‘sk_num’ from incompatible
pointer type
/usr/include/openssl/stack.h:79: note: expected ‘const struct _STACK *’
but argument is of type ‘struct stack_st_X509 *’
ssl.c: In function ‘print_details’:
ssl.c:1766: warning: assignment discards qualifiers from pointer target type
Trac ticket #5
https://community.openvpn.net/openvpn/ticket/5
Signed-off-by: chantra <ch...@de...>
Acked-by: David Sommerseth <da...@us...>
Signed-off-by: David Sommerseth <da...@us...>
commit a9b5134f78480f903434366478f3918c021b7caa
Author: Gert Doering <ge...@gr...>
Date: Sat Jul 10 11:24:41 2010 +0200
Fix <net/if.h> compile time problems on OpenBSD for good
Previous fix (commit eb973e055bc249948) fixed NetBSD but not OpenBSD
(include <sys/socket.h> *after* <sys/types.h>)
Signed-off-by: Gert Doering <ge...@gr...>
Acked-by: krzee <je...@do...>
Signed-off-by: David Sommerseth <da...@us...>
commit 22ff667e4e7e412db21d9b1642fc92fa670d323d
Author: Gert Doering <ge...@gr...>
Date: Fri Jul 9 10:24:46 2010 +0200
Fix compile problems on NetBSD and OpenBSD
Configure will not find <net/if.h> due to missing <sys/types.h> in the test program,
and thus, tun.c will fail to compile with missing symbol IFF_MULTICAST.
Signed-off-by: Gert Doering <ge...@gr...>
Acked-by: krzee <je...@do...>
Signed-off-by: David Sommerseth <da...@us...>
commit 3a777430493de180d425cebbc9eecde68e7fb6a6
Author: David Sommerseth <da...@us...>
Date: Thu Aug 5 20:51:22 2010 +0200
Fix multiple configured scripts conflicts issue (version 2)
This is a fix for trac ticket #20,
<https://community.openvpn.net/openvpn/ticket/20>
which was started in the sf.net bug tracker:
<http://sourceforge.net/tracker/?func=detail&aid=2078470&group_id=48978&atid=454719>
The implemented solution is to give a warning for each of the different script hooks
available. The last configured script will override any earlier configured scripts,
to ensure that the command line can override the configuration file.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: James Yonan <ja...@op...>
commit 639216502cc474fcc2526598680b2bcdbb35c0a1
Author: Davide Brini <da...@gm...>
Date: Sun May 2 11:07:38 2010 +0200
Exclude ping and control packets from activity
Problem: using --ping and --inactive together partially defeats the
point of using --inactive as periodic ping packets are counted as
activity. Here is the original discussion:
http://article.gmane.org/gmane.network.openvpn.devel/3676
It turns out that "activity" is detected and recorded in two places
in the code, both in forward.c: in process_outgoing_tun() for received
packets, after they've been decrypted and sent to the TUN device; and
in process_outgoing_link(), after they've been encrypted and written
to the network socket.
In the first case we can be sure that packets that get so far are
really due to user activity, whereas in the second case there can be
non-user packets (like OpenVPN's internal ping packets, and TLS control
packets), and those should not be counted as activity as they are not
coming from the user.
So a need arises to detect those control packets and not count them as
activity for the purposes of --inactive. Unfortunately, at that stage
packets are already compressed and encrypted, so it's not possible to
look into them to see what they are. However, there seems to be a
convention in the code that packets whose buffer length in the context_2
structure is 0 should be ignored for certain purposes. TLS control
packets follow that convention already, so this patch makes a small
change in the code that generates the ping packets to set their buffer
length to 0 as well.
Finally, the call to register_activity() in process_outgoing_link() is
made conditional to the buffer length being > 0.
According to my tests, now --inactive behaves correctly according to
the configured parameters (time or time+bytes) even when --ping is
being used.
forward.c:
Call register_activity() in process_outgoing_link() only if the
packet is not a ping or TLS control packet.
openvpn.8:
Updated the description of --inactive to describe the new semantics.
ping.c:
Set c->c2.buf.len = 0 after the ping packet has been generated and
encrypted.
Test routine is described here:
<https://community.openvpn.net/openvpn/wiki/PingInactivePatch?version=6>
Signed-off-by: Davide Brini <da...@gm...>
Acked-by: David Sommerseth <da...@us...>
Signed-off-by: David Sommerseth <da...@us...>
commit b02b609b28199a932da2d07ec61c2fb6b9271363
Author: chantra <ch...@de...>
Date: Fri Jul 30 20:48:50 2010 +0200
Fix errors in openvpn-plugin.h documentation
Just minor updates to comments in openvpn-plugin.h
Signed-off-by: chantra <ch...@de...>
Acked-by: David Sommerseth <da...@us...>
Signed-off-by: David Sommerseth <da...@us...>
commit e0221d9d4d4329918d914ddcce188d0dc7c99357
Author: David Sommerseth <da...@us...>
Date: Sun Jun 13 00:35:55 2010 +0200
Fixed client hang when server don't PUSH (aka the NO_SOUP_FOR_YOU patch)
Solves bug ticket 13
<https://community.openvpn.net/openvpn/ticket/13>
When the client sends PUSH_REQUESTS, it waits until the server sends PUSH_REPLY.
If the server do not have anything to push to the client nothing happens. The
client will then regularly send new PUSH_REQUESTS until it gets an answer, which
results in not completing the connection negotiation.
This patch makes the server send an empty PUSH_REPLY when it has nothing to more
to push to the client.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: James Yonan <ja...@op...>
commit d2ad24c062c0d1870d826ecbb9506f893896f50c
Author: chantra <ch...@de...>
Date: Fri Jun 11 16:23:03 2010 +0200
Handle non standard subnets in PF grammar
Allow subnets for like 192.168.100.8/28 to be understood. A warning
will be logged when subnet is incorrect and is being corrected to what
is assumed to be correct.
Signed-off-by: chantra <ch...@de...>
Acked-by: Gert Doering <ge...@gr...>
Signed-off-by: David Sommerseth <da...@us...>
commit 233105d2c9d1a2c6911342d8249b19310e94c251
Author: David Sommerseth <da...@us...>
Date: Sun May 16 19:42:40 2010 +0200
OCSP_check.sh: new check logic
contrib/OCSP_check/OCSP_check.sh:
I discovered that, quite surprisingly, the exit status of "openssl ocsp"
is 0 even if the certificate status is "revoked". This means that the
logic of the script needs to be rewritten so that it parses the output
returned by the query and explicitly looks for a
"0x<serial number>: good"
line, and exit if either the command has a non-zero exit status, or the
above line is not found.
Doing that portably without bashisms requires some juggling around, so
perhaps the code is slightly less clean now, but it does have many
comments.
Signed-off-by: Davide Brini <da...@gm...>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: David Sommerseth <da...@us...>
commit 6f94529f31cfab709c07d5e012ecc16cc9228d3c
Author: David Sommerseth <da...@us...>
Date: Mon Apr 26 09:50:30 2010 +0200
Avoid repetition of "this config may cache passwords in memory" (v2)
For OpenVPN clients with long living connections, this message is repeated
everytime the connection is renegotiated. This patch removes this behaviour
and will only show this warning once.
Patch ACKed on the developers meeting 2009-04-29.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: James Yonan <ja...@op...>
commit 7d5e26cbb53e2700c966e6b6e815f0c824da8956
Author: Davide Brini <da...@gm...>
Date: Tue Apr 27 12:20:05 2010 +0100
Fix certificate serial number export
contrib/OCSP_check/OCSP_check.sh:
New barebone script to demonstrate how to use $tls_serial_{n}
to perform simple OCSP queries using OpenSSL command line
"openssl ocsp". Minimal sanity checks to fail if user tries to
use it without customizing.
openvpn.8:
Added some notes about $tls_serial_{n} format and usage to the
existing description.
ssl.c:
correctly manage and export serial numbers of any size (as
parsed by OpenSSL) into the environment. Set to empty string
in case of errors, as 0 and negative numbers are all possible
(although illegal) certificate serial numbers. Use an OpenSSL
BIO object to do the job. Conforms to coding style guidelines.
See the discussion at
http://article.gmane.org/gmane.network.openvpn.devel/3588
for more details.
Signed-off-by: Davide Brini <da...@gm...>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: David Sommerseth <da...@us...>
commit 892e64b6b9e08f838add6b32dfdea73d607b36ce
Author: Davide Brini <da...@gm...>
Date: Thu Apr 22 09:50:31 2010 +0200
Fix missing /bin/bash -> /bin/sh
In commit a9c9a89e96dc1e4e843e05ecadc4349b81606b06 the
client.{up,down} scripts where overhauled and bashism was removed.
During that process, a #! change was missing.
Signed-off-by: Davide Brini <da...@gm...>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: David Sommerseth <da...@us...>
commit 5c9f1d2e703d0c8aaaf7254e9f3bd1bf0dddb120
Author: Davide Brini <da...@gm...>
Date: Mon Apr 19 22:41:42 2010 +0200
Enhance contrib/pull-resolv-conf/client.{up,down} scripts
Patch arrived from Davide Brini:
- No more bashisms (AFAICT). Should work with any POSIX-compatible shell
(which means "almost all reasonably recent shells"), though I've only tested
with bash and dash.
- Unnecessary calls to external tools (sed) removed
- Manages multiple DNS and DOMAIN options. Each DNS option becomes a
"nameserver" line in the new resolv.conf (up to a maximum of 3). If there's a
single DOMAIN option, it becomes a "domain" line in resolv.conf; otherwise,
all the domains are listed in a "search" line in resolv.conf (eg "search
foo.com example.net").
- Client.up renames the existing resolv.conf and creates a brand new one;
client.down restores it from the saved copy when the VPN terminates (the usual
rules about running as root apply). This is how Gentoo does that; the old
scripts instead added/removed some lines at the beginning of the file, which
looks a less clean approach to me. The rename approach also dramatically
simplifies and shortens client.down, as you'll see.
- Uses resolvconf if it's available (detected by the presence of
/sbin/resolvconf) rather than writing to resolv.conf directly. Not sure
whether this is a Linux-only thing or other systems use it though.
Script has been smoke tested on Fedora 12 with OpenVPN 2.1.1 without
the resolvconf package , and in addition Debian Lenny with
OpenVPN 2.1_rc11 according to the patch.
Signed-off-by: Davide Brini <da...@gm...>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: David Sommerseth <da...@us...>
commit 8517cba1997f5a08f1461ca90d159fcbe6392b5e
Author: Davide Brini <da...@gm...>
Date: Mon Apr 19 00:23:52 2010 +0200
The man page does not mention that the default value of "mssfix" is 1450.
Signed-off-by: Davide Brini <da...@gm...>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: David Sommerseth <da...@us...>
commit d2bf22af84a1758d6ba281cd22e4ff44a7bb40c6
Author: David Sommerseth <da...@us...>
Date: Sat Apr 17 21:03:06 2010 +0200
Fixed potential NULL pointer issue
If create_temp_file() returns NULL, this strlen() check would cause
a SEGV.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit 50a22f30fc4d89e5cdefc6c8ffb1500fda468000
Author: David Sommerseth <da...@us...>
Date: Sat Apr 17 21:01:20 2010 +0200
Removed no longer needed delete_file() call
Fabian Knittel noticed that this delete_file() calls should have been
removed in commit 5d30273a8741d2c1410bfdbc08b341398bf39b40
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit add7fe05dae7202bb6ccd7301c052c9364bcccae
Author: David Sommerseth <da...@us...>
Date: Fri Apr 16 22:11:59 2010 +0200
Updated the man page to reflect the behavioural change of create_temp_file()
As this function now creates the temp file, it is no longer
'not-yet-created', but 'freshly created'.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit 495e3cec5d15655058cd70983b8a0d65bd403d84
Author: David Sommerseth <da...@us...>
Date: Fri Apr 16 22:09:48 2010 +0200
Renamed all calls to create_temp_filename()
All places where create_temp_filename() was called are now calling
create_temp_file(). Extra checks on the result of create_temp_file()
is added in addition.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit 4e1cc5f6dda22e9ff121d3753066775c25448bcc
Author: David Sommerseth <da...@us...>
Date: Fri Apr 16 22:02:36 2010 +0200
Harden create_temp_filename() (version 2)
By hardening the create_temp_filename() function to check if the generated
filename exists and to create the temp file with only S_IRUSR|S_IWUSR bit
files set before calling the script, it should become even more difficult to
exploit such a scenario.
After a discussion on the mailing list, Fabian Knittel provided an enhanced
version of the inital patch which is added to this patch.
This patch also renames create_temp_filename() to create_temp_file(), as this
patch also creates the temporary file. The function returns the filename of the
created file, or NULL on error.
Signed-off-by: David Sommerseth <da...@us...>
Signed-off-by: Fabian Knittel <fab...@av...>
Acked-by: Gert Doering <ge...@gr...>
commit 41104b4e23aaa17257cadb7f6c4ba1325c025b46
Author: David Sommerseth <da...@us...>
Date: Thu Apr 8 21:18:42 2010 +0200
Make use of counter_type instead of int when counting bytes and network packets
This is in response to a reported Debian bug, where the connection counter overflows.
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576827>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit 886593ac4ae79f4321f6f12fad0a51600e4aca28
Author: Jan Brinkmann <the...@us...>
Date: Sun Feb 28 23:29:29 2010 +0100
The man page needs dash escaping in UTF-8 environments
There was a debian bugreport which was filed in 2005 . It was patched but
it seems that nobody forwarded the patch to the openvpn project itself.
The problem is quite simple:
The dashes for options (the double dashes) are not escaped. This causes
trouble in relationship with utf-8 .
Since the bugreport was closed it was patched within the debian/ubuntu
packages itself. I've attached the patch to get it atleast reviewed by the
openvpn project itself.
See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=296133> for details.
sf.net tracker:
<https://sourceforge.net/tracker/?func=detail&aid=2935611&group_id=48978&atid=454721>
Signed-off-by: David Sommerseth <da...@us...>
Tested-by: Jan Just Keijser <ja...@ni...>
Tested-by: Pavel Shramov <sh...@me...>
Tested-by: Samuli Seppänen <sa...@op...>
commit ff99a3b5fc5f99deddaf1ab85115affec9b9e276
Author: Daniel Johnson <Pro...@us...>
Date: Tue Mar 30 15:54:44 2010 +0200
When I began testing OpenVPN v2.1_rc9 I was having trouble authenticating to the MS Active Directory through auth-pam and Samba. I used the following line in my configs (without the linebreak of course):
plugin /opt/openvpn/openvpn-auth-pam.so
"openvpn login OURDOMAIN+USERNAME password PASSWORD"
Finally I turned on more verbose logging and found that the plugin did
not recognize "USERNAME" as something to replace, because it expected
the string to be surrounded by whitespace. I wrote the following patch
to correct this. I hope you find it useful,
Signed-off-by: David Sommerseth <da...@us...>
commit afa7ddf083bbee1ed0a88a7cea079cd818eb9e70
Author: Alberto Gonzalez Iniesta <ag...@in...>
Date: Tue Mar 16 23:03:10 2010 +0100
Debian patch: Fix spelling in log message
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: David Sommerseth <da...@us...>
commit 86715242cee9d50ca24a522913d1a6b04e0bcc3d
Author: David Sommerseth <da...@us...>
Date: Thu Mar 11 17:28:41 2010 +0100
Fix autotools cross-compiling support
This is a modified version of a patch sent to the sf.net
patch tracker:
<http://sourceforge.net/tracker/?func=detail&aid=2491190&group_id=48978&atid=454721>
After having disucssed this patch on IRC (#openvpn-discussions)
March 4, 2010, it was decided to accept this patch when not modifying
TARGET_* defines through out the code. Further, in a mail comment
Alon Bar-Lev had some other comments of what would be needed to be done.
Mail reference:
<http://thread.gmane.org/gmane.network.openvpn.devel/3176>
This patch has been tested by bootstrapping the code on a RHEL4.6 box.
with the following autotools packages installed:
autoconf-2.59-5
automake-1.9.2-3
libtool-1.5.6-4.EL4.2
It builds cleanly and 'make check' passes.
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: James Yonan <ja...@op...>
Acked-by: Alon Bar-Lev <alo...@gm...>
commit 1e02046b68af74e84eafbfadb6f856195bbbdcb0
Author: David Sommerseth <da...@us...>
Date: Wed Mar 10 11:45:04 2010 +0100
On TARGET_LINUX define _GNU_SOURCE if not defined
This is to include peercred support on hosts where _GNU_SOURCE is not
defined by default. This issue has been found on Gentoo with glibc-2.8.
The solution was discussed on the IRC meeting March 4, 2010
in #openvpn-discussions.
<http://thread.gmane.org/gmane.network.openvpn.devel/3242>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: James Yonan <ja...@op...>
commit 48fe8bb37167b57722d209274626f5f91975c001
Author: Jan Brinkmann <the...@us...>
Date: Sun Feb 28 23:29:29 2010 +0100
The man page needs dash escaping in UTF-8 environments
There was a debian bugreport which was filed in 2005 . It was patched but
it seems that nobody forwarded the patch to the openvpn project itself.
The problem is quite simple:
The dashes for options (the double dashes) are not escaped. This causes
trouble in relationship with utf-8 .
Since the bugreport was closed it was patched within the debian/ubuntu
packages itself. I've attached the patch to get it atleast reviewed by the
openvpn project itself.
See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=296133> for details.
sf.net tracker:
<https://sourceforge.net/tracker/?func=detail&aid=2935611&group_id=48978&atid=454721>
Signed-off-by: David Sommerseth <da...@us...>
Tested-by: Jan Just Keijser <ja...@ni...>
Tested-by: Pavel Shramov <sh...@me...>
Tested-by: Samuli Seppänen <sa...@op...>
commit 2d4e7685cd1a6d8e1eb1befa241b7595809d3b45
Author: Dan Nelson <dn...@us...>
Date: Sun Feb 28 22:09:18 2010 +0100
bash->bourne script cleanup
Many of the scripts in the openvpn source have their shell set to
/bin/bash, but only two use bash features. The attached patch (against
openvpn-2.1_rc9) sets the shell on the rest of the scripts to /bin/sh for
better portability. The only scripts that actually require bash are
contrib/pull-resolv-conf/client.{up,down} ; they use the ${!var} variable
indirection feature.
sf.net tracker:
<https://sourceforge.net/tracker/?func=detail&aid=2040296&group_id=48978&atid=454721>
Discussed on the IRC meeting March 4, 2010 in #openvpn-discussions.
<http://thread.gmane.org/gmane.network.openvpn.devel/3242>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: James Yonan <ja...@op...>
commit 798497ae52d782248cc89fb8bf0e4fcdba98a0d3
Author: Enrico Scholz <enr...@si...>
Date: Sun Feb 28 14:40:57 2010 +0100
Allow 'lport 0' setup for random port binding
I am running a multihomed host where 'local <extip>' must be specified
for proper operation. Unfortunately, this implies 'lport 1194' or
another static port.
This causes problems with stateful firewalls which register the host/port
pairs in the internal connection tracking table. On ungraceful reconnects,
the new TCP connection will have same the host/port pairs but unexpected
sequence numbers. The new connection will be assumed as invalid hence and
be dropped.
It would be nice when local port can be configured to be bound to a
random port number. After reading code,
| else if (streq (p[0], "lport") && p[1])
| ...
| port = atoi (p[1]);
|- if (!legal_ipv4_port (port))
|+ if (port != 0 && !legal_ipv4_port (port))
| {
in options.c seems to be the only required change.
This has been discussed here:
<http://thread.gmane.org/gmane.network.openvpn.user/28622>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit 8528e2b77d19384f9077fe41fd39da58cb761168
Author: Gert Doering <ge...@gr...>
Date: Sun Feb 28 23:09:40 2010 +0100
remove duplicate code in FREEBSD+DRAGONFLY system-dependent ifconfig
(ACKed by Eric F Crist and David Sommerseth)
(cherry picked from commit dd66b12647852e3f1267be70b0fb3b11deedf377)
Signed-off-by: David Sommerseth <da...@us...>
Signed-off-by: Gert Doering <ge...@gr...>
commit adfe37fc84f47f0dfc11b4ad728f314ef76e4ee7
Author: David Sommerseth <da...@us...>
Date: Fri Feb 19 17:32:56 2010 +0100
verb 5 logging wrongly reports received bytes
With --verb 5, openvpn logs a single letter (rwRW) for each package
received or sent. I recently ran into a problem with the tun device on
Linux where the read from that device returned 0. Unfortunately this was
also logged as "r", which made me assume that openvpn had received
something, while it actually hadn't.
(See https://dev.openwrt.org/ticket/6650 for the bug that made me find out
about this problem with openvpn.)
I'm attaching a patch which prevents openvpn from logging "r" or "R" when
it didn't actually read anything. This is against openvpn 2.1-rc20, but
probably still applies to the most recent version.
This patch was received anonymously via the sf.net bug tracker:
<http://sourceforge.net/tracker/?func=detail&atid=454719&aid=2951003&group_id=48978>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
commit 058f3d0b3eade5480b34eaacda673182925bea60
Author: Karl O. Pinc <ko...@me...>
Date: Thu Feb 18 21:30:48 2010 +0100
[PATCH] Change verify-cn so cn is no longer hardcoded in openvpn's config file
This patch should be easy to process.
A resubmission of the patch sent to this list on 04/23/2009.
The patch changes the verify-cn script sample
to be used with --tls-verify so that instead of having
to hardcode a cn to verify in the OpenVPN configuration file
the allowed cns may be written into a separate file.
This makes the process of verifying cns a whole
lot more dynamic, to the point where it is useful
in the real world.
One problem with this patch is that it is backwards
incompatible. I did not bother keeping the original
calling interface as A) it's a sample script, and B) the
original's functionality seems useless
and equalivant functionality is easily available
with the new script.
The problem with the original is that there seems
little point in verifying a client's cn when all
the clients share one cn, as would have to be
the case when the cn is hardcoded into the openvpn
config file.
This patch applies against the testing allmiscs branch,
and should apply against any of the other testing
branches as well.
It works for me. I've tested it throughly but not
used it extensively in production.
Regards,
Karl <ko...@me...>
Signed-off-by: David Sommerseth <da...@us...>
Acked-by: Gert Doering <ge...@gr...>
Acked-by: Eric F Crist <ec...@se...>
commit 9e30f68fc4bf4f81b276b2d4f7092e783d8746d6
Author: David Sommerseth <da...@us...>
Date: Tue Feb 16 22:06:51 2010 +0100
Added mapping files from SVN commit ID to more descriptive commit IDs.
Unfortunately, this will not rewrite the commit history. So all commits
done by james@e7ae566f-a301-0410-adde-c780ea21d3b5 is James Yonans commits.
It was considered to risky to use git tools to rewrite the commit history, as
it could influence those already using this git tree.
-----------------------------------------------------------------------
hooks/post-receive
--
OpenVPN with experimental and new features - which requires a lot of testing
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenVPN with experimental and new features - which requires a lot of testing".
The branch, bugfix2.1 has been deleted
was d3d6d1cbdaca58d7c785ef7898d1134007fbc323
-----------------------------------------------------------------------
d3d6d1cbdaca58d7c785ef7898d1134007fbc323 Fixed compiler warnings reported on Ubuntu 10.04
-----------------------------------------------------------------------
hooks/post-receive
--
OpenVPN with experimental and new features - which requires a lot of testing
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenVPN with experimental and new features - which requires a lot of testing".
The branch, newmaster has been created
at 4713e86979cdcb86e6aef34f555cbecd10a189ab (commit)
- Log -----------------------------------------------------------------
commit 4713e86979cdcb86e6aef34f555cbecd10a189ab
Author: David Sommerseth <da...@us...>
Date: Tue Feb 16 22:06:51 2010 +0100
Added mapping files from SVN commit ID to more descriptive commit IDs.
Unfortunately, this will not rewrite the commit history. So all commits
done by james@e7ae566f-a301-0410-adde-c780ea21d3b5 is James Yonans commits.
It was considered to risky to use git tools to rewrite the commit history, as
it could influence those already using this git tree.
-----------------------------------------------------------------------
hooks/post-receive
--
OpenVPN with experimental and new features - which requires a lot of testing
|
|
From: <ope...@li...> - 2010-10-21 09:29:19
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenVPN with experimental and new features - which requires a lot of testing".
The branch, master has been updated
via d59fa6c1efdc9a12b62decc018164e5c38c98002 (commit)
via b45eeae36b5915180eae4ad70314c97dc8d2dfff (commit)
from 4e1d0729dbf5948fca9b29f237f7bbe0c3d9c18a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit d59fa6c1efdc9a12b62decc018164e5c38c98002
Merge: b45eeae36b5915180eae4ad70314c97dc8d2dfff 4e1d0729dbf5948fca9b29f237f7bbe0c3d9c18a
Author: David Sommerseth <da...@us...>
Date: Thu Oct 21 11:29:03 2010 +0200
Merge remote branch 'origin/master'
commit b45eeae36b5915180eae4ad70314c97dc8d2dfff
Author: David Sommerseth <da...@us...>
Date: Tue Feb 16 22:06:51 2010 +0100
Added mapping files from SVN commit ID to more descriptive commit IDs.
Unfortunately, this will not rewrite the commit history. So all commits
done by james@e7ae566f-a301-0410-adde-c780ea21d3b5 is James Yonans commits.
It was considered to risky to use git tools to rewrite the commit history, as
it could influence those already using this git tree.
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
OpenVPN with experimental and new features - which requires a lot of testing
|
|
From: <ope...@li...> - 2010-10-13 11:13:50
|
Removed even more function which where practically empty and took away
some function arguments which were not used.
Signed-off-by: David Sommerseth <da...@us...>
---
list.c | 11 ++++-------
list.h | 25 ++++---------------------
mtcp.c | 3 ---
mudp.c | 3 ---
multi.c | 25 +++++++++++--------------
pf.c | 2 +-
6 files changed, 20 insertions(+), 49 deletions(-)
diff --git a/list.c b/list.c
index 32c2adf..fb93d0a 100644
--- a/list.c
+++ b/list.c
@@ -165,12 +165,12 @@ hash_add (struct hash *hash, const void *key, void
*value, bool replace)
}
void
-hash_remove_by_value (struct hash *hash, void *value, bool autolock)
+hash_remove_by_value (struct hash *hash, void *value)
{
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (hash, &hi, autolock);
+ hash_iterator_init (hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
if (he->value == value)
@@ -221,7 +221,6 @@ void_ptr_compare_function (const void *key1, const
void *key2)
void
hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket)
{
@@ -233,7 +232,6 @@ hash_iterator_init_range (struct hash *hash,
hi->hash = hash;
hi->elem = NULL;
hi->bucket = NULL;
- hi->autolock = autolock;
hi->last = NULL;
hi->bucket_marked = false;
hi->bucket_index_start = start_bucket;
@@ -243,10 +241,9 @@ hash_iterator_init_range (struct hash *hash,
void
hash_iterator_init (struct hash *hash,
- struct hash_iterator *hi,
- bool autolock)
+ struct hash_iterator *hi)
{
- hash_iterator_init_range (hash, hi, autolock, 0, hash->n_buckets);
+ hash_iterator_init_range (hash, hi, 0, hash->n_buckets);
}
static inline void
diff --git a/list.h b/list.h
index 5cf9127..adde36b 100644
--- a/list.h
+++ b/list.h
@@ -88,7 +88,7 @@ bool hash_remove_fast (struct hash *hash,
const void *key,
uint32_t hv);
-void hash_remove_by_value (struct hash *hash, void *value, bool autolock);
+void hash_remove_by_value (struct hash *hash, void *value);
struct hash_iterator
{
@@ -98,18 +98,16 @@ struct hash_iterator
struct hash_element *elem;
struct hash_element *last;
bool bucket_marked;
- bool autolock;
int bucket_index_start;
int bucket_index_end;
};
void hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket);
-void hash_iterator_init (struct hash *hash, struct hash_iterator *iter,
bool autolock);
+void hash_iterator_init (struct hash *hash, struct hash_iterator *iter);
struct hash_element *hash_iterator_next (struct hash_iterator *hi);
void hash_iterator_delete_element (struct hash_iterator *hi);
void hash_iterator_free (struct hash_iterator *hi);
@@ -147,21 +145,12 @@ hash_bucket (struct hash *hash, uint32_t hv)
return &hash->buckets[hv & hash->mask];
}
-static inline void
-hash_bucket_lock (struct hash_bucket *bucket)
-{
-}
-
-static inline void
-hash_bucket_unlock (struct hash_bucket *bucket)
-{
-}
-
static inline void *
-hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv)
+hash_lookup (struct hash *hash, const void *key)
{
void *ret = NULL;
struct hash_element *he;
+ uint32_t hv = hash_value (hash, key);
struct hash_bucket *bucket = &hash->buckets[hv & hash->mask];
he = hash_lookup_fast (hash, bucket, key, hv);
@@ -171,12 +160,6 @@ hash_lookup_lock (struct hash *hash, const void
*key, uint32_t hv)
return ret;
}
-static inline void *
-hash_lookup (struct hash *hash, const void *key)
-{
- return hash_lookup_lock (hash, key, hash_value (hash, key));
-}
-
/* NOTE: assumes that key is not a duplicate */
static inline void
hash_add_fast (struct hash *hash,
diff --git a/mtcp.c b/mtcp.c
index 6edafbd..314aa44 100644
--- a/mtcp.c
+++ b/mtcp.c
@@ -112,7 +112,6 @@ multi_create_instance_tcp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &mi->real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &mi->real, hv);
if (he)
@@ -128,8 +127,6 @@ multi_create_instance_tcp (struct multi_context *m)
hash_add_fast (hash, bucket, &mi->real, hv, mi);
mi->did_real_hash = true;
-
- hash_bucket_unlock (bucket);
}
#ifdef ENABLE_DEBUG
diff --git a/mudp.c b/mudp.c
index bf4ca3d..a478b29 100644
--- a/mudp.c
+++ b/mudp.c
@@ -51,7 +51,6 @@ multi_get_create_instance_udp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &real, hv);
if (he)
@@ -81,8 +80,6 @@ multi_get_create_instance_udp (struct multi_context *m)
}
}
- hash_bucket_unlock (bucket);
-
#ifdef ENABLE_DEBUG
if (check_debug_level (D_MULTI_DEBUG))
{
diff --git a/multi.c b/multi.c
index 13714f8..f61c5fb 100644
--- a/multi.c
+++ b/multi.c
@@ -146,7 +146,7 @@ multi_reap_range (const struct multi_context *m,
}
dmsg (D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket,
end_bucket);
- hash_iterator_init_range (m->vhash, &hi, true, start_bucket, end_bucket);
+ hash_iterator_init_range (m->vhash, &hi, start_bucket, end_bucket);
while ((he = hash_iterator_next (&hi)) != NULL)
{
struct multi_route *r = (struct multi_route *) he->value;
@@ -587,7 +587,7 @@ multi_uninit (struct multi_context *m)
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -723,7 +723,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "OpenVPN CLIENT LIST");
status_printf (so, "Updated,%s", time_string (0, 0, false,
&gc_top));
status_printf (so, "Common Name,Real Address,Bytes
Received,Bytes Sent,Connected Since");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -744,7 +744,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "ROUTING TABLE");
status_printf (so, "Virtual Address,Common Name,Real
Address,Last Ref");
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -787,7 +787,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0,
false, &gc_top), sep, (unsigned int)now);
status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal
Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected
Since%cConnected Since (time_t)",
sep, sep, sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -810,7 +810,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "HEADER%cROUTING_TABLE%cVirtual
Address%cCommon Name%cReal Address%cLast Ref%cLast Ref (time_t)",
sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -849,7 +849,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
#ifdef PACKET_TRUNCATION_CHECK
{
status_printf (so, "HEADER,ERRORS,Common Name,TUN Read Trunc,TUN
Write Trunc,Pre-encrypt Trunc,Post-decrypt Trunc");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -895,8 +895,6 @@ multi_learn_addr (struct multi_context *m,
struct multi_route *oldroute = NULL;
struct multi_instance *owner = NULL;
- hash_bucket_lock (bucket);
-
/* if route currently exists, get the instance which owns it */
he = hash_lookup_fast (m->vhash, bucket, addr, hv);
if (he)
@@ -966,7 +964,6 @@ multi_learn_addr (struct multi_context *m,
gc_free (&gc);
}
- hash_bucket_unlock (bucket);
return owner;
}
@@ -1130,7 +1127,7 @@ multi_delete_dup (struct multi_context *m, struct
multi_instance *new_mi)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -1776,7 +1773,7 @@ multi_bcast (struct multi_context *m,
printf ("BCAST len=%d\n", BLEN (buf));
#endif
mb = mbuf_alloc_buf (buf);
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
@@ -2470,7 +2467,7 @@ management_callback_kill_by_cn (void *arg, const
char *del_cn)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -2504,7 +2501,7 @@ management_callback_kill_by_addr (void *arg, const
in_addr_t addr, const int por
saddr.sa.sin_port = htons (port);
if (mroute_extract_openvpn_sockaddr (&maddr, &saddr, true))
{
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
diff --git a/pf.c b/pf.c
index aed836e..6b4cba4 100644
--- a/pf.c
+++ b/pf.c
@@ -644,7 +644,7 @@ pf_cn_set_print (const struct pf_cn_set *s, const
int lev)
if (s->hash_table)
{
- hash_iterator_init (s->hash_table, &hi, false);
+ hash_iterator_init (s->hash_table, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct pf_cn *e = (struct pf_cn *)he->value;
--
1.7.2.2
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Openvpn-devel mailing list
Ope...@li...
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
|
|
From: <ope...@li...> - 2010-10-12 17:49:21
|
Removed even more function which where practically empty and took away
some function arguments which were not used.
Signed-off-by: David Sommerseth <da...@us...>
---
list.c | 11 ++++-------
list.h | 25 ++++---------------------
mtcp.c | 3 ---
mudp.c | 3 ---
multi.c | 25 +++++++++++--------------
pf.c | 2 +-
6 files changed, 20 insertions(+), 49 deletions(-)
diff --git a/list.c b/list.c
index 32c2adf..fb93d0a 100644
--- a/list.c
+++ b/list.c
@@ -165,12 +165,12 @@ hash_add (struct hash *hash, const void *key, void
*value, bool replace)
}
void
-hash_remove_by_value (struct hash *hash, void *value, bool autolock)
+hash_remove_by_value (struct hash *hash, void *value)
{
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (hash, &hi, autolock);
+ hash_iterator_init (hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
if (he->value == value)
@@ -221,7 +221,6 @@ void_ptr_compare_function (const void *key1, const
void *key2)
void
hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket)
{
@@ -233,7 +232,6 @@ hash_iterator_init_range (struct hash *hash,
hi->hash = hash;
hi->elem = NULL;
hi->bucket = NULL;
- hi->autolock = autolock;
hi->last = NULL;
hi->bucket_marked = false;
hi->bucket_index_start = start_bucket;
@@ -243,10 +241,9 @@ hash_iterator_init_range (struct hash *hash,
void
hash_iterator_init (struct hash *hash,
- struct hash_iterator *hi,
- bool autolock)
+ struct hash_iterator *hi)
{
- hash_iterator_init_range (hash, hi, autolock, 0, hash->n_buckets);
+ hash_iterator_init_range (hash, hi, 0, hash->n_buckets);
}
static inline void
diff --git a/list.h b/list.h
index 5cf9127..adde36b 100644
--- a/list.h
+++ b/list.h
@@ -88,7 +88,7 @@ bool hash_remove_fast (struct hash *hash,
const void *key,
uint32_t hv);
-void hash_remove_by_value (struct hash *hash, void *value, bool autolock);
+void hash_remove_by_value (struct hash *hash, void *value);
struct hash_iterator
{
@@ -98,18 +98,16 @@ struct hash_iterator
struct hash_element *elem;
struct hash_element *last;
bool bucket_marked;
- bool autolock;
int bucket_index_start;
int bucket_index_end;
};
void hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket);
-void hash_iterator_init (struct hash *hash, struct hash_iterator *iter,
bool autolock);
+void hash_iterator_init (struct hash *hash, struct hash_iterator *iter);
struct hash_element *hash_iterator_next (struct hash_iterator *hi);
void hash_iterator_delete_element (struct hash_iterator *hi);
void hash_iterator_free (struct hash_iterator *hi);
@@ -147,21 +145,12 @@ hash_bucket (struct hash *hash, uint32_t hv)
return &hash->buckets[hv & hash->mask];
}
-static inline void
-hash_bucket_lock (struct hash_bucket *bucket)
-{
-}
-
-static inline void
-hash_bucket_unlock (struct hash_bucket *bucket)
-{
-}
-
static inline void *
-hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv)
+hash_lookup (struct hash *hash, const void *key)
{
void *ret = NULL;
struct hash_element *he;
+ uint32_t hv = hash_value (hash, key);
struct hash_bucket *bucket = &hash->buckets[hv & hash->mask];
he = hash_lookup_fast (hash, bucket, key, hv);
@@ -171,12 +160,6 @@ hash_lookup_lock (struct hash *hash, const void
*key, uint32_t hv)
return ret;
}
-static inline void *
-hash_lookup (struct hash *hash, const void *key)
-{
- return hash_lookup_lock (hash, key, hash_value (hash, key));
-}
-
/* NOTE: assumes that key is not a duplicate */
static inline void
hash_add_fast (struct hash *hash,
diff --git a/mtcp.c b/mtcp.c
index 6edafbd..314aa44 100644
--- a/mtcp.c
+++ b/mtcp.c
@@ -112,7 +112,6 @@ multi_create_instance_tcp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &mi->real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &mi->real, hv);
if (he)
@@ -128,8 +127,6 @@ multi_create_instance_tcp (struct multi_context *m)
hash_add_fast (hash, bucket, &mi->real, hv, mi);
mi->did_real_hash = true;
-
- hash_bucket_unlock (bucket);
}
#ifdef ENABLE_DEBUG
diff --git a/mudp.c b/mudp.c
index bf4ca3d..a478b29 100644
--- a/mudp.c
+++ b/mudp.c
@@ -51,7 +51,6 @@ multi_get_create_instance_udp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &real, hv);
if (he)
@@ -81,8 +80,6 @@ multi_get_create_instance_udp (struct multi_context *m)
}
}
- hash_bucket_unlock (bucket);
-
#ifdef ENABLE_DEBUG
if (check_debug_level (D_MULTI_DEBUG))
{
diff --git a/multi.c b/multi.c
index 13714f8..f61c5fb 100644
--- a/multi.c
+++ b/multi.c
@@ -146,7 +146,7 @@ multi_reap_range (const struct multi_context *m,
}
dmsg (D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket,
end_bucket);
- hash_iterator_init_range (m->vhash, &hi, true, start_bucket, end_bucket);
+ hash_iterator_init_range (m->vhash, &hi, start_bucket, end_bucket);
while ((he = hash_iterator_next (&hi)) != NULL)
{
struct multi_route *r = (struct multi_route *) he->value;
@@ -587,7 +587,7 @@ multi_uninit (struct multi_context *m)
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -723,7 +723,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "OpenVPN CLIENT LIST");
status_printf (so, "Updated,%s", time_string (0, 0, false,
&gc_top));
status_printf (so, "Common Name,Real Address,Bytes
Received,Bytes Sent,Connected Since");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -744,7 +744,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "ROUTING TABLE");
status_printf (so, "Virtual Address,Common Name,Real
Address,Last Ref");
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -787,7 +787,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0,
false, &gc_top), sep, (unsigned int)now);
status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal
Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected
Since%cConnected Since (time_t)",
sep, sep, sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -810,7 +810,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "HEADER%cROUTING_TABLE%cVirtual
Address%cCommon Name%cReal Address%cLast Ref%cLast Ref (time_t)",
sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -849,7 +849,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
#ifdef PACKET_TRUNCATION_CHECK
{
status_printf (so, "HEADER,ERRORS,Common Name,TUN Read Trunc,TUN
Write Trunc,Pre-encrypt Trunc,Post-decrypt Trunc");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -895,8 +895,6 @@ multi_learn_addr (struct multi_context *m,
struct multi_route *oldroute = NULL;
struct multi_instance *owner = NULL;
- hash_bucket_lock (bucket);
-
/* if route currently exists, get the instance which owns it */
he = hash_lookup_fast (m->vhash, bucket, addr, hv);
if (he)
@@ -966,7 +964,6 @@ multi_learn_addr (struct multi_context *m,
gc_free (&gc);
}
- hash_bucket_unlock (bucket);
return owner;
}
@@ -1130,7 +1127,7 @@ multi_delete_dup (struct multi_context *m, struct
multi_instance *new_mi)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -1776,7 +1773,7 @@ multi_bcast (struct multi_context *m,
printf ("BCAST len=%d\n", BLEN (buf));
#endif
mb = mbuf_alloc_buf (buf);
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
@@ -2470,7 +2467,7 @@ management_callback_kill_by_cn (void *arg, const
char *del_cn)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -2504,7 +2501,7 @@ management_callback_kill_by_addr (void *arg, const
in_addr_t addr, const int por
saddr.sa.sin_port = htons (port);
if (mroute_extract_openvpn_sockaddr (&maddr, &saddr, true))
{
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
diff --git a/pf.c b/pf.c
index aed836e..6b4cba4 100644
--- a/pf.c
+++ b/pf.c
@@ -644,7 +644,7 @@ pf_cn_set_print (const struct pf_cn_set *s, const
int lev)
if (s->hash_table)
{
- hash_iterator_init (s->hash_table, &hi, false);
+ hash_iterator_init (s->hash_table, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct pf_cn *e = (struct pf_cn *)he->value;
--
1.7.2.2
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Openvpn-devel mailing list
Ope...@li...
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
|
|
From: <ope...@li...> - 2010-10-12 12:32:54
|
Removed even more function which where practically empty and took away
some function arguments which were not used.
Signed-off-by: David Sommerseth <da...@us...>
---
list.c | 11 ++++-------
list.h | 25 ++++---------------------
mtcp.c | 3 ---
mudp.c | 3 ---
multi.c | 25 +++++++++++--------------
pf.c | 2 +-
6 files changed, 20 insertions(+), 49 deletions(-)
diff --git a/list.c b/list.c
index 32c2adf..fb93d0a 100644
--- a/list.c
+++ b/list.c
@@ -165,12 +165,12 @@ hash_add (struct hash *hash, const void *key, void
*value, bool replace)
}
void
-hash_remove_by_value (struct hash *hash, void *value, bool autolock)
+hash_remove_by_value (struct hash *hash, void *value)
{
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (hash, &hi, autolock);
+ hash_iterator_init (hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
if (he->value == value)
@@ -221,7 +221,6 @@ void_ptr_compare_function (const void *key1, const
void *key2)
void
hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket)
{
@@ -233,7 +232,6 @@ hash_iterator_init_range (struct hash *hash,
hi->hash = hash;
hi->elem = NULL;
hi->bucket = NULL;
- hi->autolock = autolock;
hi->last = NULL;
hi->bucket_marked = false;
hi->bucket_index_start = start_bucket;
@@ -243,10 +241,9 @@ hash_iterator_init_range (struct hash *hash,
void
hash_iterator_init (struct hash *hash,
- struct hash_iterator *hi,
- bool autolock)
+ struct hash_iterator *hi)
{
- hash_iterator_init_range (hash, hi, autolock, 0, hash->n_buckets);
+ hash_iterator_init_range (hash, hi, 0, hash->n_buckets);
}
static inline void
diff --git a/list.h b/list.h
index 5cf9127..adde36b 100644
--- a/list.h
+++ b/list.h
@@ -88,7 +88,7 @@ bool hash_remove_fast (struct hash *hash,
const void *key,
uint32_t hv);
-void hash_remove_by_value (struct hash *hash, void *value, bool autolock);
+void hash_remove_by_value (struct hash *hash, void *value);
struct hash_iterator
{
@@ -98,18 +98,16 @@ struct hash_iterator
struct hash_element *elem;
struct hash_element *last;
bool bucket_marked;
- bool autolock;
int bucket_index_start;
int bucket_index_end;
};
void hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket);
-void hash_iterator_init (struct hash *hash, struct hash_iterator *iter,
bool autolock);
+void hash_iterator_init (struct hash *hash, struct hash_iterator *iter);
struct hash_element *hash_iterator_next (struct hash_iterator *hi);
void hash_iterator_delete_element (struct hash_iterator *hi);
void hash_iterator_free (struct hash_iterator *hi);
@@ -147,21 +145,12 @@ hash_bucket (struct hash *hash, uint32_t hv)
return &hash->buckets[hv & hash->mask];
}
-static inline void
-hash_bucket_lock (struct hash_bucket *bucket)
-{
-}
-
-static inline void
-hash_bucket_unlock (struct hash_bucket *bucket)
-{
-}
-
static inline void *
-hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv)
+hash_lookup (struct hash *hash, const void *key)
{
void *ret = NULL;
struct hash_element *he;
+ uint32_t hv = hash_value (hash, key);
struct hash_bucket *bucket = &hash->buckets[hv & hash->mask];
he = hash_lookup_fast (hash, bucket, key, hv);
@@ -171,12 +160,6 @@ hash_lookup_lock (struct hash *hash, const void
*key, uint32_t hv)
return ret;
}
-static inline void *
-hash_lookup (struct hash *hash, const void *key)
-{
- return hash_lookup_lock (hash, key, hash_value (hash, key));
-}
-
/* NOTE: assumes that key is not a duplicate */
static inline void
hash_add_fast (struct hash *hash,
diff --git a/mtcp.c b/mtcp.c
index 6edafbd..314aa44 100644
--- a/mtcp.c
+++ b/mtcp.c
@@ -112,7 +112,6 @@ multi_create_instance_tcp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &mi->real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &mi->real, hv);
if (he)
@@ -128,8 +127,6 @@ multi_create_instance_tcp (struct multi_context *m)
hash_add_fast (hash, bucket, &mi->real, hv, mi);
mi->did_real_hash = true;
-
- hash_bucket_unlock (bucket);
}
#ifdef ENABLE_DEBUG
diff --git a/mudp.c b/mudp.c
index bf4ca3d..a478b29 100644
--- a/mudp.c
+++ b/mudp.c
@@ -51,7 +51,6 @@ multi_get_create_instance_udp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &real, hv);
if (he)
@@ -81,8 +80,6 @@ multi_get_create_instance_udp (struct multi_context *m)
}
}
- hash_bucket_unlock (bucket);
-
#ifdef ENABLE_DEBUG
if (check_debug_level (D_MULTI_DEBUG))
{
diff --git a/multi.c b/multi.c
index 13714f8..f61c5fb 100644
--- a/multi.c
+++ b/multi.c
@@ -146,7 +146,7 @@ multi_reap_range (const struct multi_context *m,
}
dmsg (D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket,
end_bucket);
- hash_iterator_init_range (m->vhash, &hi, true, start_bucket, end_bucket);
+ hash_iterator_init_range (m->vhash, &hi, start_bucket, end_bucket);
while ((he = hash_iterator_next (&hi)) != NULL)
{
struct multi_route *r = (struct multi_route *) he->value;
@@ -587,7 +587,7 @@ multi_uninit (struct multi_context *m)
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -723,7 +723,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "OpenVPN CLIENT LIST");
status_printf (so, "Updated,%s", time_string (0, 0, false,
&gc_top));
status_printf (so, "Common Name,Real Address,Bytes
Received,Bytes Sent,Connected Since");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -744,7 +744,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "ROUTING TABLE");
status_printf (so, "Virtual Address,Common Name,Real
Address,Last Ref");
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -787,7 +787,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0,
false, &gc_top), sep, (unsigned int)now);
status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal
Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected
Since%cConnected Since (time_t)",
sep, sep, sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -810,7 +810,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "HEADER%cROUTING_TABLE%cVirtual
Address%cCommon Name%cReal Address%cLast Ref%cLast Ref (time_t)",
sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -849,7 +849,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
#ifdef PACKET_TRUNCATION_CHECK
{
status_printf (so, "HEADER,ERRORS,Common Name,TUN Read Trunc,TUN
Write Trunc,Pre-encrypt Trunc,Post-decrypt Trunc");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -895,8 +895,6 @@ multi_learn_addr (struct multi_context *m,
struct multi_route *oldroute = NULL;
struct multi_instance *owner = NULL;
- hash_bucket_lock (bucket);
-
/* if route currently exists, get the instance which owns it */
he = hash_lookup_fast (m->vhash, bucket, addr, hv);
if (he)
@@ -966,7 +964,6 @@ multi_learn_addr (struct multi_context *m,
gc_free (&gc);
}
- hash_bucket_unlock (bucket);
return owner;
}
@@ -1130,7 +1127,7 @@ multi_delete_dup (struct multi_context *m, struct
multi_instance *new_mi)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -1776,7 +1773,7 @@ multi_bcast (struct multi_context *m,
printf ("BCAST len=%d\n", BLEN (buf));
#endif
mb = mbuf_alloc_buf (buf);
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
@@ -2470,7 +2467,7 @@ management_callback_kill_by_cn (void *arg, const
char *del_cn)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -2504,7 +2501,7 @@ management_callback_kill_by_addr (void *arg, const
in_addr_t addr, const int por
saddr.sa.sin_port = htons (port);
if (mroute_extract_openvpn_sockaddr (&maddr, &saddr, true))
{
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
diff --git a/pf.c b/pf.c
index aed836e..6b4cba4 100644
--- a/pf.c
+++ b/pf.c
@@ -644,7 +644,7 @@ pf_cn_set_print (const struct pf_cn_set *s, const
int lev)
if (s->hash_table)
{
- hash_iterator_init (s->hash_table, &hi, false);
+ hash_iterator_init (s->hash_table, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct pf_cn *e = (struct pf_cn *)he->value;
--
1.7.2.2
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Openvpn-devel mailing list
Ope...@li...
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
|
|
From: <ope...@li...> - 2010-10-12 12:30:30
|
Removed even more function which where practically empty and took away
some function arguments which were not used.
Signed-off-by: David Sommerseth <da...@us...>
---
list.c | 11 ++++-------
list.h | 25 ++++---------------------
mtcp.c | 3 ---
mudp.c | 3 ---
multi.c | 25 +++++++++++--------------
pf.c | 2 +-
6 files changed, 20 insertions(+), 49 deletions(-)
diff --git a/list.c b/list.c
index 32c2adf..fb93d0a 100644
--- a/list.c
+++ b/list.c
@@ -165,12 +165,12 @@ hash_add (struct hash *hash, const void *key, void
*value, bool replace)
}
void
-hash_remove_by_value (struct hash *hash, void *value, bool autolock)
+hash_remove_by_value (struct hash *hash, void *value)
{
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (hash, &hi, autolock);
+ hash_iterator_init (hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
if (he->value == value)
@@ -221,7 +221,6 @@ void_ptr_compare_function (const void *key1, const
void *key2)
void
hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket)
{
@@ -233,7 +232,6 @@ hash_iterator_init_range (struct hash *hash,
hi->hash = hash;
hi->elem = NULL;
hi->bucket = NULL;
- hi->autolock = autolock;
hi->last = NULL;
hi->bucket_marked = false;
hi->bucket_index_start = start_bucket;
@@ -243,10 +241,9 @@ hash_iterator_init_range (struct hash *hash,
void
hash_iterator_init (struct hash *hash,
- struct hash_iterator *hi,
- bool autolock)
+ struct hash_iterator *hi)
{
- hash_iterator_init_range (hash, hi, autolock, 0, hash->n_buckets);
+ hash_iterator_init_range (hash, hi, 0, hash->n_buckets);
}
static inline void
diff --git a/list.h b/list.h
index 5cf9127..adde36b 100644
--- a/list.h
+++ b/list.h
@@ -88,7 +88,7 @@ bool hash_remove_fast (struct hash *hash,
const void *key,
uint32_t hv);
-void hash_remove_by_value (struct hash *hash, void *value, bool autolock);
+void hash_remove_by_value (struct hash *hash, void *value);
struct hash_iterator
{
@@ -98,18 +98,16 @@ struct hash_iterator
struct hash_element *elem;
struct hash_element *last;
bool bucket_marked;
- bool autolock;
int bucket_index_start;
int bucket_index_end;
};
void hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket);
-void hash_iterator_init (struct hash *hash, struct hash_iterator *iter,
bool autolock);
+void hash_iterator_init (struct hash *hash, struct hash_iterator *iter);
struct hash_element *hash_iterator_next (struct hash_iterator *hi);
void hash_iterator_delete_element (struct hash_iterator *hi);
void hash_iterator_free (struct hash_iterator *hi);
@@ -147,21 +145,12 @@ hash_bucket (struct hash *hash, uint32_t hv)
return &hash->buckets[hv & hash->mask];
}
-static inline void
-hash_bucket_lock (struct hash_bucket *bucket)
-{
-}
-
-static inline void
-hash_bucket_unlock (struct hash_bucket *bucket)
-{
-}
-
static inline void *
-hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv)
+hash_lookup (struct hash *hash, const void *key)
{
void *ret = NULL;
struct hash_element *he;
+ uint32_t hv = hash_value (hash, key);
struct hash_bucket *bucket = &hash->buckets[hv & hash->mask];
he = hash_lookup_fast (hash, bucket, key, hv);
@@ -171,12 +160,6 @@ hash_lookup_lock (struct hash *hash, const void
*key, uint32_t hv)
return ret;
}
-static inline void *
-hash_lookup (struct hash *hash, const void *key)
-{
- return hash_lookup_lock (hash, key, hash_value (hash, key));
-}
-
/* NOTE: assumes that key is not a duplicate */
static inline void
hash_add_fast (struct hash *hash,
diff --git a/mtcp.c b/mtcp.c
index 6edafbd..314aa44 100644
--- a/mtcp.c
+++ b/mtcp.c
@@ -112,7 +112,6 @@ multi_create_instance_tcp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &mi->real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &mi->real, hv);
if (he)
@@ -128,8 +127,6 @@ multi_create_instance_tcp (struct multi_context *m)
hash_add_fast (hash, bucket, &mi->real, hv, mi);
mi->did_real_hash = true;
-
- hash_bucket_unlock (bucket);
}
#ifdef ENABLE_DEBUG
diff --git a/mudp.c b/mudp.c
index bf4ca3d..a478b29 100644
--- a/mudp.c
+++ b/mudp.c
@@ -51,7 +51,6 @@ multi_get_create_instance_udp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &real, hv);
if (he)
@@ -81,8 +80,6 @@ multi_get_create_instance_udp (struct multi_context *m)
}
}
- hash_bucket_unlock (bucket);
-
#ifdef ENABLE_DEBUG
if (check_debug_level (D_MULTI_DEBUG))
{
diff --git a/multi.c b/multi.c
index 13714f8..f61c5fb 100644
--- a/multi.c
+++ b/multi.c
@@ -146,7 +146,7 @@ multi_reap_range (const struct multi_context *m,
}
dmsg (D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket,
end_bucket);
- hash_iterator_init_range (m->vhash, &hi, true, start_bucket, end_bucket);
+ hash_iterator_init_range (m->vhash, &hi, start_bucket, end_bucket);
while ((he = hash_iterator_next (&hi)) != NULL)
{
struct multi_route *r = (struct multi_route *) he->value;
@@ -587,7 +587,7 @@ multi_uninit (struct multi_context *m)
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -723,7 +723,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "OpenVPN CLIENT LIST");
status_printf (so, "Updated,%s", time_string (0, 0, false,
&gc_top));
status_printf (so, "Common Name,Real Address,Bytes
Received,Bytes Sent,Connected Since");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -744,7 +744,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "ROUTING TABLE");
status_printf (so, "Virtual Address,Common Name,Real
Address,Last Ref");
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -787,7 +787,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0,
false, &gc_top), sep, (unsigned int)now);
status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal
Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected
Since%cConnected Since (time_t)",
sep, sep, sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -810,7 +810,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "HEADER%cROUTING_TABLE%cVirtual
Address%cCommon Name%cReal Address%cLast Ref%cLast Ref (time_t)",
sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -849,7 +849,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
#ifdef PACKET_TRUNCATION_CHECK
{
status_printf (so, "HEADER,ERRORS,Common Name,TUN Read Trunc,TUN
Write Trunc,Pre-encrypt Trunc,Post-decrypt Trunc");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -895,8 +895,6 @@ multi_learn_addr (struct multi_context *m,
struct multi_route *oldroute = NULL;
struct multi_instance *owner = NULL;
- hash_bucket_lock (bucket);
-
/* if route currently exists, get the instance which owns it */
he = hash_lookup_fast (m->vhash, bucket, addr, hv);
if (he)
@@ -966,7 +964,6 @@ multi_learn_addr (struct multi_context *m,
gc_free (&gc);
}
- hash_bucket_unlock (bucket);
return owner;
}
@@ -1130,7 +1127,7 @@ multi_delete_dup (struct multi_context *m, struct
multi_instance *new_mi)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -1776,7 +1773,7 @@ multi_bcast (struct multi_context *m,
printf ("BCAST len=%d\n", BLEN (buf));
#endif
mb = mbuf_alloc_buf (buf);
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
@@ -2470,7 +2467,7 @@ management_callback_kill_by_cn (void *arg, const
char *del_cn)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -2504,7 +2501,7 @@ management_callback_kill_by_addr (void *arg, const
in_addr_t addr, const int por
saddr.sa.sin_port = htons (port);
if (mroute_extract_openvpn_sockaddr (&maddr, &saddr, true))
{
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
diff --git a/pf.c b/pf.c
index aed836e..6b4cba4 100644
--- a/pf.c
+++ b/pf.c
@@ -644,7 +644,7 @@ pf_cn_set_print (const struct pf_cn_set *s, const
int lev)
if (s->hash_table)
{
- hash_iterator_init (s->hash_table, &hi, false);
+ hash_iterator_init (s->hash_table, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct pf_cn *e = (struct pf_cn *)he->value;
--
1.7.2.2
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Openvpn-devel mailing list
Ope...@li...
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
|
|
From: <ope...@li...> - 2010-10-12 12:23:09
|
Removed even more function which where practically empty and took away
some function arguments which were not used.
Signed-off-by: David Sommerseth <da...@us...>
---
list.c | 11 ++++-------
list.h | 25 ++++---------------------
mtcp.c | 3 ---
mudp.c | 3 ---
multi.c | 25 +++++++++++--------------
pf.c | 2 +-
6 files changed, 20 insertions(+), 49 deletions(-)
diff --git a/list.c b/list.c
index 32c2adf..fb93d0a 100644
--- a/list.c
+++ b/list.c
@@ -165,12 +165,12 @@ hash_add (struct hash *hash, const void *key, void
*value, bool replace)
}
void
-hash_remove_by_value (struct hash *hash, void *value, bool autolock)
+hash_remove_by_value (struct hash *hash, void *value)
{
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (hash, &hi, autolock);
+ hash_iterator_init (hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
if (he->value == value)
@@ -221,7 +221,6 @@ void_ptr_compare_function (const void *key1, const
void *key2)
void
hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket)
{
@@ -233,7 +232,6 @@ hash_iterator_init_range (struct hash *hash,
hi->hash = hash;
hi->elem = NULL;
hi->bucket = NULL;
- hi->autolock = autolock;
hi->last = NULL;
hi->bucket_marked = false;
hi->bucket_index_start = start_bucket;
@@ -243,10 +241,9 @@ hash_iterator_init_range (struct hash *hash,
void
hash_iterator_init (struct hash *hash,
- struct hash_iterator *hi,
- bool autolock)
+ struct hash_iterator *hi)
{
- hash_iterator_init_range (hash, hi, autolock, 0, hash->n_buckets);
+ hash_iterator_init_range (hash, hi, 0, hash->n_buckets);
}
static inline void
diff --git a/list.h b/list.h
index 5cf9127..adde36b 100644
--- a/list.h
+++ b/list.h
@@ -88,7 +88,7 @@ bool hash_remove_fast (struct hash *hash,
const void *key,
uint32_t hv);
-void hash_remove_by_value (struct hash *hash, void *value, bool autolock);
+void hash_remove_by_value (struct hash *hash, void *value);
struct hash_iterator
{
@@ -98,18 +98,16 @@ struct hash_iterator
struct hash_element *elem;
struct hash_element *last;
bool bucket_marked;
- bool autolock;
int bucket_index_start;
int bucket_index_end;
};
void hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket);
-void hash_iterator_init (struct hash *hash, struct hash_iterator *iter,
bool autolock);
+void hash_iterator_init (struct hash *hash, struct hash_iterator *iter);
struct hash_element *hash_iterator_next (struct hash_iterator *hi);
void hash_iterator_delete_element (struct hash_iterator *hi);
void hash_iterator_free (struct hash_iterator *hi);
@@ -147,21 +145,12 @@ hash_bucket (struct hash *hash, uint32_t hv)
return &hash->buckets[hv & hash->mask];
}
-static inline void
-hash_bucket_lock (struct hash_bucket *bucket)
-{
-}
-
-static inline void
-hash_bucket_unlock (struct hash_bucket *bucket)
-{
-}
-
static inline void *
-hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv)
+hash_lookup (struct hash *hash, const void *key)
{
void *ret = NULL;
struct hash_element *he;
+ uint32_t hv = hash_value (hash, key);
struct hash_bucket *bucket = &hash->buckets[hv & hash->mask];
he = hash_lookup_fast (hash, bucket, key, hv);
@@ -171,12 +160,6 @@ hash_lookup_lock (struct hash *hash, const void
*key, uint32_t hv)
return ret;
}
-static inline void *
-hash_lookup (struct hash *hash, const void *key)
-{
- return hash_lookup_lock (hash, key, hash_value (hash, key));
-}
-
/* NOTE: assumes that key is not a duplicate */
static inline void
hash_add_fast (struct hash *hash,
diff --git a/mtcp.c b/mtcp.c
index 6edafbd..314aa44 100644
--- a/mtcp.c
+++ b/mtcp.c
@@ -112,7 +112,6 @@ multi_create_instance_tcp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &mi->real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &mi->real, hv);
if (he)
@@ -128,8 +127,6 @@ multi_create_instance_tcp (struct multi_context *m)
hash_add_fast (hash, bucket, &mi->real, hv, mi);
mi->did_real_hash = true;
-
- hash_bucket_unlock (bucket);
}
#ifdef ENABLE_DEBUG
diff --git a/mudp.c b/mudp.c
index bf4ca3d..a478b29 100644
--- a/mudp.c
+++ b/mudp.c
@@ -51,7 +51,6 @@ multi_get_create_instance_udp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &real, hv);
if (he)
@@ -81,8 +80,6 @@ multi_get_create_instance_udp (struct multi_context *m)
}
}
- hash_bucket_unlock (bucket);
-
#ifdef ENABLE_DEBUG
if (check_debug_level (D_MULTI_DEBUG))
{
diff --git a/multi.c b/multi.c
index 13714f8..f61c5fb 100644
--- a/multi.c
+++ b/multi.c
@@ -146,7 +146,7 @@ multi_reap_range (const struct multi_context *m,
}
dmsg (D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket,
end_bucket);
- hash_iterator_init_range (m->vhash, &hi, true, start_bucket, end_bucket);
+ hash_iterator_init_range (m->vhash, &hi, start_bucket, end_bucket);
while ((he = hash_iterator_next (&hi)) != NULL)
{
struct multi_route *r = (struct multi_route *) he->value;
@@ -587,7 +587,7 @@ multi_uninit (struct multi_context *m)
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -723,7 +723,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "OpenVPN CLIENT LIST");
status_printf (so, "Updated,%s", time_string (0, 0, false,
&gc_top));
status_printf (so, "Common Name,Real Address,Bytes
Received,Bytes Sent,Connected Since");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -744,7 +744,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "ROUTING TABLE");
status_printf (so, "Virtual Address,Common Name,Real
Address,Last Ref");
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -787,7 +787,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0,
false, &gc_top), sep, (unsigned int)now);
status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal
Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected
Since%cConnected Since (time_t)",
sep, sep, sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -810,7 +810,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "HEADER%cROUTING_TABLE%cVirtual
Address%cCommon Name%cReal Address%cLast Ref%cLast Ref (time_t)",
sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -849,7 +849,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
#ifdef PACKET_TRUNCATION_CHECK
{
status_printf (so, "HEADER,ERRORS,Common Name,TUN Read Trunc,TUN
Write Trunc,Pre-encrypt Trunc,Post-decrypt Trunc");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -895,8 +895,6 @@ multi_learn_addr (struct multi_context *m,
struct multi_route *oldroute = NULL;
struct multi_instance *owner = NULL;
- hash_bucket_lock (bucket);
-
/* if route currently exists, get the instance which owns it */
he = hash_lookup_fast (m->vhash, bucket, addr, hv);
if (he)
@@ -966,7 +964,6 @@ multi_learn_addr (struct multi_context *m,
gc_free (&gc);
}
- hash_bucket_unlock (bucket);
return owner;
}
@@ -1130,7 +1127,7 @@ multi_delete_dup (struct multi_context *m, struct
multi_instance *new_mi)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -1776,7 +1773,7 @@ multi_bcast (struct multi_context *m,
printf ("BCAST len=%d\n", BLEN (buf));
#endif
mb = mbuf_alloc_buf (buf);
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
@@ -2470,7 +2467,7 @@ management_callback_kill_by_cn (void *arg, const
char *del_cn)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -2504,7 +2501,7 @@ management_callback_kill_by_addr (void *arg, const
in_addr_t addr, const int por
saddr.sa.sin_port = htons (port);
if (mroute_extract_openvpn_sockaddr (&maddr, &saddr, true))
{
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
diff --git a/pf.c b/pf.c
index aed836e..6b4cba4 100644
--- a/pf.c
+++ b/pf.c
@@ -644,7 +644,7 @@ pf_cn_set_print (const struct pf_cn_set *s, const
int lev)
if (s->hash_table)
{
- hash_iterator_init (s->hash_table, &hi, false);
+ hash_iterator_init (s->hash_table, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct pf_cn *e = (struct pf_cn *)he->value;
--
1.7.2.2
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Openvpn-devel mailing list
Ope...@li...
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
|
|
From: <ope...@li...> - 2010-10-12 11:44:15
|
Removed even more function which where practically empty and took away
some function arguments which were not used.
Signed-off-by: David Sommerseth <da...@us...>
---
list.c | 11 ++++-------
list.h | 25 ++++---------------------
mtcp.c | 3 ---
mudp.c | 3 ---
multi.c | 25 +++++++++++--------------
pf.c | 2 +-
6 files changed, 20 insertions(+), 49 deletions(-)
diff --git a/list.c b/list.c
index 32c2adf..fb93d0a 100644
--- a/list.c
+++ b/list.c
@@ -165,12 +165,12 @@ hash_add (struct hash *hash, const void *key, void
*value, bool replace)
}
void
-hash_remove_by_value (struct hash *hash, void *value, bool autolock)
+hash_remove_by_value (struct hash *hash, void *value)
{
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (hash, &hi, autolock);
+ hash_iterator_init (hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
if (he->value == value)
@@ -221,7 +221,6 @@ void_ptr_compare_function (const void *key1, const
void *key2)
void
hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket)
{
@@ -233,7 +232,6 @@ hash_iterator_init_range (struct hash *hash,
hi->hash = hash;
hi->elem = NULL;
hi->bucket = NULL;
- hi->autolock = autolock;
hi->last = NULL;
hi->bucket_marked = false;
hi->bucket_index_start = start_bucket;
@@ -243,10 +241,9 @@ hash_iterator_init_range (struct hash *hash,
void
hash_iterator_init (struct hash *hash,
- struct hash_iterator *hi,
- bool autolock)
+ struct hash_iterator *hi)
{
- hash_iterator_init_range (hash, hi, autolock, 0, hash->n_buckets);
+ hash_iterator_init_range (hash, hi, 0, hash->n_buckets);
}
static inline void
diff --git a/list.h b/list.h
index 5cf9127..adde36b 100644
--- a/list.h
+++ b/list.h
@@ -88,7 +88,7 @@ bool hash_remove_fast (struct hash *hash,
const void *key,
uint32_t hv);
-void hash_remove_by_value (struct hash *hash, void *value, bool autolock);
+void hash_remove_by_value (struct hash *hash, void *value);
struct hash_iterator
{
@@ -98,18 +98,16 @@ struct hash_iterator
struct hash_element *elem;
struct hash_element *last;
bool bucket_marked;
- bool autolock;
int bucket_index_start;
int bucket_index_end;
};
void hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
- bool autolock,
int start_bucket,
int end_bucket);
-void hash_iterator_init (struct hash *hash, struct hash_iterator *iter,
bool autolock);
+void hash_iterator_init (struct hash *hash, struct hash_iterator *iter);
struct hash_element *hash_iterator_next (struct hash_iterator *hi);
void hash_iterator_delete_element (struct hash_iterator *hi);
void hash_iterator_free (struct hash_iterator *hi);
@@ -147,21 +145,12 @@ hash_bucket (struct hash *hash, uint32_t hv)
return &hash->buckets[hv & hash->mask];
}
-static inline void
-hash_bucket_lock (struct hash_bucket *bucket)
-{
-}
-
-static inline void
-hash_bucket_unlock (struct hash_bucket *bucket)
-{
-}
-
static inline void *
-hash_lookup_lock (struct hash *hash, const void *key, uint32_t hv)
+hash_lookup (struct hash *hash, const void *key)
{
void *ret = NULL;
struct hash_element *he;
+ uint32_t hv = hash_value (hash, key);
struct hash_bucket *bucket = &hash->buckets[hv & hash->mask];
he = hash_lookup_fast (hash, bucket, key, hv);
@@ -171,12 +160,6 @@ hash_lookup_lock (struct hash *hash, const void
*key, uint32_t hv)
return ret;
}
-static inline void *
-hash_lookup (struct hash *hash, const void *key)
-{
- return hash_lookup_lock (hash, key, hash_value (hash, key));
-}
-
/* NOTE: assumes that key is not a duplicate */
static inline void
hash_add_fast (struct hash *hash,
diff --git a/mtcp.c b/mtcp.c
index 6edafbd..314aa44 100644
--- a/mtcp.c
+++ b/mtcp.c
@@ -112,7 +112,6 @@ multi_create_instance_tcp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &mi->real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &mi->real, hv);
if (he)
@@ -128,8 +127,6 @@ multi_create_instance_tcp (struct multi_context *m)
hash_add_fast (hash, bucket, &mi->real, hv, mi);
mi->did_real_hash = true;
-
- hash_bucket_unlock (bucket);
}
#ifdef ENABLE_DEBUG
diff --git a/mudp.c b/mudp.c
index bf4ca3d..a478b29 100644
--- a/mudp.c
+++ b/mudp.c
@@ -51,7 +51,6 @@ multi_get_create_instance_udp (struct multi_context *m)
const uint32_t hv = hash_value (hash, &real);
struct hash_bucket *bucket = hash_bucket (hash, hv);
- hash_bucket_lock (bucket);
he = hash_lookup_fast (hash, bucket, &real, hv);
if (he)
@@ -81,8 +80,6 @@ multi_get_create_instance_udp (struct multi_context *m)
}
}
- hash_bucket_unlock (bucket);
-
#ifdef ENABLE_DEBUG
if (check_debug_level (D_MULTI_DEBUG))
{
diff --git a/multi.c b/multi.c
index 13714f8..f61c5fb 100644
--- a/multi.c
+++ b/multi.c
@@ -146,7 +146,7 @@ multi_reap_range (const struct multi_context *m,
}
dmsg (D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket,
end_bucket);
- hash_iterator_init_range (m->vhash, &hi, true, start_bucket, end_bucket);
+ hash_iterator_init_range (m->vhash, &hi, start_bucket, end_bucket);
while ((he = hash_iterator_next (&hi)) != NULL)
{
struct multi_route *r = (struct multi_route *) he->value;
@@ -587,7 +587,7 @@ multi_uninit (struct multi_context *m)
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -723,7 +723,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "OpenVPN CLIENT LIST");
status_printf (so, "Updated,%s", time_string (0, 0, false,
&gc_top));
status_printf (so, "Common Name,Real Address,Bytes
Received,Bytes Sent,Connected Since");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -744,7 +744,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "ROUTING TABLE");
status_printf (so, "Virtual Address,Common Name,Real
Address,Last Ref");
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -787,7 +787,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0,
false, &gc_top), sep, (unsigned int)now);
status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal
Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected
Since%cConnected Since (time_t)",
sep, sep, sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -810,7 +810,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
status_printf (so, "HEADER%cROUTING_TABLE%cVirtual
Address%cCommon Name%cReal Address%cLast Ref%cLast Ref (time_t)",
sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -849,7 +849,7 @@ multi_print_status (struct multi_context *m, struct
status_output *so, const int
#ifdef PACKET_TRUNCATION_CHECK
{
status_printf (so, "HEADER,ERRORS,Common Name,TUN Read Trunc,TUN
Write Trunc,Pre-encrypt Trunc,Post-decrypt Trunc");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -895,8 +895,6 @@ multi_learn_addr (struct multi_context *m,
struct multi_route *oldroute = NULL;
struct multi_instance *owner = NULL;
- hash_bucket_lock (bucket);
-
/* if route currently exists, get the instance which owns it */
he = hash_lookup_fast (m->vhash, bucket, addr, hv);
if (he)
@@ -966,7 +964,6 @@ multi_learn_addr (struct multi_context *m,
gc_free (&gc);
}
- hash_bucket_unlock (bucket);
return owner;
}
@@ -1130,7 +1127,7 @@ multi_delete_dup (struct multi_context *m, struct
multi_instance *new_mi)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *)
he->value;
@@ -1776,7 +1773,7 @@ multi_bcast (struct multi_context *m,
printf ("BCAST len=%d\n", BLEN (buf));
#endif
mb = mbuf_alloc_buf (buf);
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
@@ -2470,7 +2467,7 @@ management_callback_kill_by_cn (void *arg, const
char *del_cn)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -2504,7 +2501,7 @@ management_callback_kill_by_addr (void *arg, const
in_addr_t addr, const int por
saddr.sa.sin_port = htons (port);
if (mroute_extract_openvpn_sockaddr (&maddr, &saddr, true))
{
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
diff --git a/pf.c b/pf.c
index aed836e..6b4cba4 100644
--- a/pf.c
+++ b/pf.c
@@ -644,7 +644,7 @@ pf_cn_set_print (const struct pf_cn_set *s, const
int lev)
if (s->hash_table)
{
- hash_iterator_init (s->hash_table, &hi, false);
+ hash_iterator_init (s->hash_table, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct pf_cn *e = (struct pf_cn *)he->value;
--
1.7.2.2
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Openvpn-devel mailing list
Ope...@li...
https://lists.sourceforge.net/lists/listinfo/openvpn-devel
|