From: Michael Tokarev Date: Sun, 24 Oct 2010 11:23:10 +0000 (+0400) Subject: Treat netname="." in a special way. X-Git-Tag: release-1.0.14~38 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=aca70cd3c3fe787e62c618849e43f67b3870ac20 Treat netname="." in a special way. Treat netname "." in a special way as if there was no netname specified. Before, f.e. tincd -n. -k didn't work as it tried to open /var/run/tinc-.pid. Now -n. works as if there was no -n option is specified. Signed-Off-By: Michael Tokarev --- diff --git a/src/tincd.c b/src/tincd.c index a618e63f..3dab9a01 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -221,7 +221,9 @@ static bool parse_options(int argc, char **argv) { break; case 'n': /* net name given */ - netname = xstrdup(optarg); + /* netname "." is special: a "top-level name" */ + netname = strcmp(optarg, ".") != 0 ? + xstrdup(optarg) : NULL; break; case 'o': /* option */