summaryrefslogtreecommitdiffstats
path: root/src/openvpn/tun.c
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2014-12-27 21:59:43 +0100
committerGert Doering <gert@greenie.muc.de>2015-03-08 20:18:25 +0100
commitec2fbf374f018366c18644d271cd4d793d04244b (patch)
treee43d0537b6077d1784d8a4290551988908f053d0 /src/openvpn/tun.c
parente8562d5531277ee4dd7c517ef68e87af077ac948 (diff)
downloadopenvpn-ec2fbf374f018366c18644d271cd4d793d04244b.tar.gz
openvpn-ec2fbf374f018366c18644d271cd4d793d04244b.tar.xz
openvpn-ec2fbf374f018366c18644d271cd4d793d04244b.zip
Remove count_netmask_bits(), convert users to use netmask_to_netbits2()
The previous Linux/iproute2 code converted binary netmasks to string representation (print_in_addr_t()), just to immediately scanf() it back to binary to count bits. netmask_to_netbits2() directly works on the in_addr_t. Signed-off-by: Gert Doering <gert@greenie.muc.de> Acked-by: Steffan Karger <steffan.karger@fox-it.com> Message-Id: <1419713983-16272-1-git-send-email-gert@greenie.muc.de> URL: http://article.gmane.org/gmane.network.openvpn.devel/9360
Diffstat (limited to 'src/openvpn/tun.c')
-rw-r--r--src/openvpn/tun.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index e92edc2..11a6d71 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -722,7 +722,7 @@ do_ifconfig (struct tuntap *tt,
iproute_path,
actual,
ifconfig_local,
- count_netmask_bits(ifconfig_remote_netmask),
+ netmask_to_netbits2(tt->remote_netmask),
ifconfig_broadcast
);
argv_msg (M_INFO, &argv);
@@ -1819,7 +1819,7 @@ close_tun (struct tuntap *tt)
iproute_path,
tt->actual_name,
print_in_addr_t (tt->local, 0, &gc),
- count_netmask_bits(print_in_addr_t (tt->remote_netmask, 0, &gc))
+ netmask_to_netbits2(tt->remote_netmask)
);
}
#else