Commit graph

801 commits

Author SHA1 Message Date
Ralf Ramsauer 52c4940523 Warn, warn warn.
iodine does not seem to follow any styling guidelines (mixture of
different function prototypes, ...).  So let's introduce some.  This
will improve overall code quality and readability.

Additionally, warnings will improve code quality as well. Let's turn on
very pedantic warnings, and fix everything where the compiler barks
back.

Introduce the following function definition scheme:
  type function_name(type name, type1 name1 ...)
  {
  }
This allows us to copy and paste the definition to the declaration by
selecting one single line.

Furthermore, limit line length to 80 characters.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 21:30:01 -08:00
Ralf Ramsauer ccc49f16f7 util: add missing #includes
Detected by activating stronger warnings. If include is missing,
prototypes might diverge.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 14:23:02 -08:00
Ralf Ramsauer ac6db12ddb iodine, iodined: print intentional help to stdout
Like other unix tools: don't print application output, if the user asks
intentionally for help.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 10:39:38 -08:00
Ralf Ramsauer f8f87e3a54 iodine: remove spurious newline
Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 10:39:38 -08:00
Ralf Ramsauer 84ded018cf iodine: add usage for -4 and -6 command line arguments
Those arguments were introduced, but not documented.

Fixes: 619ede5d ("Add options to force IP version for client DNS traffic")
Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 10:39:28 -08:00
Ralf Ramsauer 5fd0874aba iodine: improve help output format
Analogously to the patch for iodined before:
  - remove redundant fprint calls
  - maximum character width: 80 characters (improved readability)
  - add additional newlines

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Ralf Ramsauer 43dad946c6 common: no need for \n in check_superuser
warnx adds the \n for us.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Ralf Ramsauer b884bfecfb iodined: improve usage() readability
Best readability is at 80 characters maximum per line.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Ralf Ramsauer 829a822de3 iodined: improve help output format
Standardise output format:
  - remove redundant fprint calls
  - maximum character width: 80 characters (improved readability)
  - add additional newlines

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Ralf Ramsauer fe0dbccbc5 iodine/iodined: get rid of redundant local __progname definition
Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Ralf Ramsauer 2efa4dfb35 iodine: consolidate help() and usage()
This avoids redundancies.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Ralf Ramsauer 1c86bf347f iodine/iodined: do not print usage if no superuser
There is no value in printing the usage in this case, as the usage
doesn't give the user any hint on how to solve this issue.

Furthermore, replace the Windows implementation with an empty inline
function, which will result in no code.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Ralf Ramsauer c83d2ae03c client: constify test patterns
There is no reason, why those patterns should not be const.

Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Ralf Ramsauer 77dd915ad5 Documentation: remove trailing whitespaces
Signed-off-by: Ralf Ramsauer <ralf@ramses-pyramidenbau.de>
2017-03-11 02:17:27 -08:00
Jes Bodi Klinke 68443abd60 Fixed non-standard passing of va_list into functions declared with ... 2016-11-29 11:10:38 -08:00
Erik Ekman 52e9b3479f Merge pull request #23 from jovial/master
Fix -4 and -6 flags
2016-11-23 10:10:19 +01:00
Will Szumski 1ad7c05b92 Do not validate the autodetected IPs of additional address families when using -4 (IPV4 only) and -6 (IPv6 only) flags 2016-11-23 01:00:11 +00:00
Erik Ekman 8e15a73a77 Merge pull request #20 from lexa/master
Add support for socket activation by ipv6 socket
2016-05-17 18:00:04 +02:00
Aleksei Fedotov 2edb879845 Listen on two different sockets for ipv6 and ipv4
Option BindIPv6Only is needed to restrict ipv6 to sending IPv6 packets
only, without it IPv6 socket can be used to send and receive packet to
and from an IPv6 address or an IPv4-mapped IPv6 address.
2016-05-11 00:20:30 +03:00
Aleksei Fedotov 4987aa536d Add support for socket activation by ipv6 socket
iodined may accept ipv4 and ipv6 sockets via systemd socket activation,
we need to figure out type of sockets.
2016-05-10 14:09:21 +03:00
Erik Ekman 36df8dc16b Merge pull request #19 from hardfalcon/master
Fix compilation with systemd>=230 and systemd versions without compat-libs
2016-05-02 17:51:02 +02:00
Pascal Ernster 7b1df75e3a Fix compilation with systemd>=230 and for older systemd versions without compat-libs 2016-04-30 18:27:15 +02:00
Erik Ekman 482d005d11 Add notice about NDIS6 tap driver 2015-09-29 10:02:19 +02:00
Erik Ekman 9c8a941729 Fix make command for old android 2015-08-07 09:54:49 +02:00
Erik Ekman a8a5fbbf0d Second attempt at PIE binary for new android
Github PR #14
2015-08-05 20:04:03 +02:00
Erik Ekman e5843a9143 Use english locale for date in latest-file 2015-08-05 19:54:09 +02:00
Erik Ekman c269a00344 Add support for Android L
Build position-indepent executables, required for Android L (5.0+)
They also work with kitkat.

Add new maketarget "cross-android-old" that builds without PIE
for older versions.

Include both new and old versions in latest-android.zip. Add arm64.

Hopefully solves github PR #14.
2015-08-05 19:36:28 +02:00
Erik Ekman d8bf5cc85b Fix test build after removed test 2015-07-19 10:03:27 +02:00
Erik Ekman f61ed01a3c Remove unused method users_waiting_on_reply() 2015-07-19 09:48:36 +02:00
Erik Ekman 7d915500b7 Drop old mingw 2015-06-30 23:35:35 +02:00
Erik Ekman fc1611fc40 Only accept IPv6 in server IPv6 socket
Set IPV6_V6ONLY flag on server socket. Not all operating systems
support mixing v4/v6 in one socket, so separate them all the time.
2015-06-30 21:58:16 +02:00
Erik Ekman 4d03ee7786 Allow choosing only IPv4 or IPv6 in server
IPv6 might still allow IPv4 since V6_ONLY is not set by the server.
2015-06-30 21:32:21 +02:00
Erik Ekman e7d253b1c1 Fix compile on Darwin (hopefully) 2015-06-28 22:52:33 +02:00
Erik Ekman b4e9148df8 Support raw mode for both IPv4 and IPv6
Read destination address of IP request packet and return it.
Check length in client and use it as IPv4 or v6 depending on length.
2015-06-28 22:41:54 +02:00
Erik Ekman 7a51b22909 Simplify cleanup code 2015-06-28 21:05:23 +02:00
Erik Ekman ec0e3f2e51 Change sockaddr lengths back to signed
They are used to check negative return values.
2015-06-28 20:25:22 +02:00
Erik Ekman 7a117bd71e IPv6 support for DNS traffic in server
Server will by default listen on both IPv4 and IPv6.
No way to only listen on one protocol right now.

Use -L to only listen on a specific v6 address.

IP address to use for raw mode is still IPv4 only.
Use -n on server to make raw mode work from IPv6 clients,
then they will get an IPv4 address from the server for raw mode.

Tunnel data is still IPv4.
2015-06-28 20:01:48 +02:00
Erik Ekman 07c2fd4068 Prepare server code for IPv6 listening socket
Add a struct with multiple dns file descriptors (for IPv4 and IPv6)
and pass this to required areas. Choose which descriptor to use when
sending by looking at the destination address family.
2015-06-28 13:05:17 +02:00
Erik Ekman 3069665646 Speling 2015-06-28 10:36:49 +02:00
Erik Ekman 987a21a0d8 Update manpage 2015-06-27 12:17:13 +02:00
Erik Ekman 69a91d5421 Update changelog 2015-06-27 12:14:34 +02:00
Erik Ekman 582a818f2a Switch external IP service to api.ipify.org
externalip.net seems to have gone away
2015-06-27 12:11:43 +02:00
Erik Ekman 778d29825d Switch to IPv6-ready storage of user IP address 2015-06-27 11:57:39 +02:00
Erik Ekman 5233d1e858 Merge pull request #15 from cpatulea/master
Document utunX.
2015-04-08 09:37:34 +02:00
Catalin Patulea 840155ca9a Document utunX. 2015-04-08 02:59:26 -04:00
Erik Ekman 1f51bab2a3 Update changelog 2015-04-08 08:50:07 +02:00
Erik Ekman 9e105d21d4 Add explanation for tun packet headers 2015-04-08 08:42:05 +02:00
Erik Ekman b559806a8e Merge pull request #12 from cpatulea/master
Support utun devices on Mac OS X.
2015-04-08 08:36:01 +02:00
Catalin Patulea b38b2ca7c5 Clarify that header is for both OPENBSD and DARWIN(utun). 2015-04-08 01:40:19 -04:00
Catalin Patulea 33abc0ca26 Support utun devices on Mac OS X.
As of 10.6, OS X has native tunnel devices. They are implemented as
sockets rather than character devices, but otherwise they appear to
behave the same as Free/OpenBSD tunnels.

'-d utunX' will tell iodine to use a utun device. For backward
compatibility, we'll continue to default to the old tuntap devices for
now.

This is a port of Peter Sagerson <psagers.github@ignorare.net>'s openvpn
commit 43e5016a.
2015-03-14 17:02:08 -04:00