Skip to contentSkip to conversation

Fixed typo in manpage

PATCH In review Alberto Gonzalez Iniesta 2 participants 2 messages Apr 10, 2010 – Apr 12, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixed typo in manpage

Just a tiny fix.

Signature · 5 lines
Alberto Gonzalez Iniesta    | Formación, consultoría y soporte técnico
agi@(inittab.org|debian.org)| en GNU/Linux y software libre
Encrypted mail preferred    | http://inittab.com

Key fingerprint = 9782 04E7 2B75 405C F5E9  0C81 C514 AF8E 4BA4 01C3
openvpn.8 +1 -1
Index: openvpn-2.1.0/openvpn.8
===================================================================
@@ -916,7 +916,7 @@
 otherwise 0.
 
 The default can be specified by leaving an option blank or setting
-it to "default".
+it to "nil".
 
 The
 .B network
#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

openvpn.8 line 919

Quoted 8 lines · Alberto Gonzalez Iniesta
openvpn.8 +1 -1
@@ -916,7 +916,7 @@
 otherwise 0.
 
 The default can be specified by leaving an option blank or setting
-it to "default".
+it to "nil".

I've been reviewing this. It's good to have docs in sync with the code.
But in this case, it seems that this is not the proper fix.

I did some tests against v2.1.1 which I had handy ... I tested with:

route <network> <netmask> <VPN gw>
route <network> <netmask> <VPN gw> default
route <network> <netmask> <VPN gw> nil
route <network> <netmask> <VPN gw> garbage

On the 'default' case, the following line was executed:
/sbin/ip route add <network>/<netmask> via <VPN gw>

On the 'nil' and 'garbage' cases, this route was setup:
/sbin/ip route add <network>/<netmask> via <VPN gw> metric 0

Which means to me, that 'default' is the proper value to use. On the other hand, the verbose logging uses the 'nil' value in route.c:973 in show_opt(), and the options.c:190 uses 'nil' as help text to the usage screen.

I suggesting not to modify the man page at all. I suggest updating options.c to use 'default' instead of 'nil'. A change in route.c need to be more "clever", as that might give more some unexpected log lines if <network>, <netmask> or <VPN gw> is not set. The show_opt() function is used for all of these values in print_route_option().

I'm suggesting throwing out the show_opt() function and replace it with a macro:

   #define SHOW_OPT(val, nullval) (val ? val : nullval)

This would also be more efficient code than calling a function, and does the same job. The places where the show_opt() function is called, SHOW_OPT() can be used like this:

    SHOW_OPT(ro->network, "nil")
    SHOW_OPT(ro->metric, "default")

This should fix the issue in a better way.

kind regards,

David Sommerseth
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkvDEZcACgkQDC186MBRfrraggCfTQHa7ZhaAwbY8DfNz1+Jgent 4YoAnjX/DnQoPri0Q/Mu7ZBvNBxOnjx1
=YgdK
-----END PGP SIGNATURE-----