Blob Blame History Raw
diff -up openvpn-auth-ldap-auth-ldap-2.0.4/src/auth-ldap.m.remoteAddress openvpn-auth-ldap-auth-ldap-2.0.4/src/auth-ldap.m
--- openvpn-auth-ldap-auth-ldap-2.0.4/src/auth-ldap.m.remoteAddress	2019-10-25 10:19:43.859536411 -0600
+++ openvpn-auth-ldap-auth-ldap-2.0.4/src/auth-ldap.m	2019-10-25 10:22:45.577749257 -0600
@@ -523,8 +523,11 @@ static int handle_client_connect_disconn
     }
 
     if (tableName)
-        if (!pf_client_connect_disconnect(ctx, tableName, remoteAddress, connecting))
-        return OPENVPN_PLUGIN_FUNC_ERROR;
+		if (!remoteAddress) {
+			[TRLog debug: "No remote address supplied to OpenVPN LDAP Plugin (OPENVPN_PLUGIN_CLIENT_CONNECT)."];
+			return OPENVPN_PLUGIN_FUNC_ERROR;
+		} else if (!pf_client_connect_disconnect(ctx, tableName, remoteAddress, connecting))
+            return OPENVPN_PLUGIN_FUNC_ERROR;
 #endif /* HAVE_PF */
 
     return OPENVPN_PLUGIN_FUNC_SUCCESS;
@@ -582,18 +585,10 @@ openvpn_plugin_func_v1(openvpn_plugin_ha
             break;
         /* New connection established */
         case OPENVPN_PLUGIN_CLIENT_CONNECT:
-            if (!remoteAddress) {
-                [TRLog debug: "No remote address supplied to OpenVPN LDAP Plugin (OPENVPN_PLUGIN_CLIENT_CONNECT)."];
-            } else {
-                ret = handle_client_connect_disconnect(ctx, ldap, ldapUser, remoteAddress, YES);
-            }
+            ret = handle_client_connect_disconnect(ctx, ldap, ldapUser, remoteAddress, YES);
             break;
         case OPENVPN_PLUGIN_CLIENT_DISCONNECT:
-            if (!remoteAddress) {
-                [TRLog debug: "No remote address supplied to OpenVPN LDAP Plugin (OPENVPN_PLUGIN_CLIENT_DISCONNECT)."];
-            } else {
-                ret = handle_client_connect_disconnect(ctx, ldap, ldapUser, remoteAddress, NO);
-            }
+            ret = handle_client_connect_disconnect(ctx, ldap, ldapUser, remoteAddress, NO);
             break;
         default:
             [TRLog debug: "Unhandled plugin type in OpenVPN LDAP Plugin (type=%d)", type];