Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/736?usp=email

to review the following change.


Change subject: Minor fix on ifconfig parameter warning
......................................................................

Minor fix on ifconfig parameter warning

Handle the case of tun device and subnet topology in
ifconfig_sanity_check(). Emit a warning if the second parameter of
ifconfig doesn't look like a netmask.

Change-Id: I2f55eabd0e950edc3fbcd08b257257cf9ed9c8d8
Signed-off-by: Ralf Lici <r...@mandelbit.com>
---
M src/openvpn/tun.c
1 file changed, 5 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/36/736/1

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index ce3d882..875f558 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -510,20 +510,21 @@
 {
     struct gc_arena gc = gc_new();
     const bool looks_like_netmask = ((addr & 0xFF000000) == 0xFF000000);
-    if (tun)
+    if (tun && (topology == TOP_NET30 || topology == TOP_P2P))
     {
-        if (looks_like_netmask && (topology == TOP_NET30 || topology == 
TOP_P2P))
+        if (looks_like_netmask)
         {
             msg(M_WARN, "WARNING: Since you are using --dev tun with a 
point-to-point topology, the second argument to --ifconfig must be an IP 
address.  You are using something (%s) that looks more like a netmask. %s",
                 print_in_addr_t(addr, 0, &gc),
                 ifconfig_warn_how_to_silence);
         }
     }
-    else /* tap */
+    else /* tap or tun with subnet topology */
     {
         if (!looks_like_netmask)
         {
-            msg(M_WARN, "WARNING: Since you are using --dev tap, the second 
argument to --ifconfig must be a netmask, for example something like 
255.255.255.0. %s",
+            msg(M_WARN, "WARNING: Since you are using --dev %s, the second 
argument to --ifconfig must be a netmask, for example something like 
255.255.255.0. %s",
+                tun ? "tun with a subnet topology" : "tap",
                 ifconfig_warn_how_to_silence);
         }
     }

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/736?usp=email
To unsubscribe, or for help writing mail filters, visit 
http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2f55eabd0e950edc3fbcd08b257257cf9ed9c8d8
Gerrit-Change-Number: 736
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <r...@mandelbit.com>
Gerrit-Reviewer: flichtenheld <fr...@lichtenheld.com>
Gerrit-Reviewer: plaisthos <arne-open...@rfc2549.org>
Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net>
Gerrit-Attention: plaisthos <arne-open...@rfc2549.org>
Gerrit-Attention: flichtenheld <fr...@lichtenheld.com>
Gerrit-MessageType: newchange
_______________________________________________
Openvpn-devel mailing list
Openvpn-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to