]> git.ipfire.org Git - thirdparty/openvpn.git/commit - src/openvpn/init.c
tun: always pass a valid tt pointer
authorAntonio Quartulli <antonio@openvpn.net>
Wed, 13 Jun 2018 12:28:23 +0000 (20:28 +0800)
committerGert Doering <gert@greenie.muc.de>
Wed, 13 Jun 2018 13:00:00 +0000 (15:00 +0200)
commit0bea472c98dca8b3470ef863fd90a63b6c79fa68
tree30f6fa21de98d6a88b18eb024c2cd5d9023b5910
parent18225f0fd5c45164308d4d66db055a1ad3960887
tun: always pass a valid tt pointer

This patch is a small "logic restyle" which basically moves the
check for "tt != NULL" outside of the various close_tun()
implementations and replaces it with an ASSERT.

This way the check is done only once and the function can rely
on the assumption that "tt" is always valid.

This change is mainly to improve the code style inside close_tun()
implementations by removing one level of indentation.

No functional change is present.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20180613122824.4207-3-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17045.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c
src/openvpn/tun.c