X-Git-Url: http://git.asterisk.org/gitweb/?p=asterisk%2Fasterisk.git;a=blobdiff_plain;f=main%2Facl.c;h=efbc9d1835b82ee35eac611ffd093c1e849aa004;hp=74d0c096d519c3b0d2c5b27e66beadd419885a58;hb=925ebbb2b31865c80c4d92985b7d6e80dd6dbc4a;hpb=055d82cbce5ad588f4d612c49f56cd76f4c8bab6 diff --git a/main/acl.c b/main/acl.c index 74d0c09..efbc9d1 100644 --- a/main/acl.c +++ b/main/acl.c @@ -70,14 +70,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/lock.h" #include "asterisk/srv.h" -struct ast_ha { - /* Host access rule */ - struct in_addr netaddr; - struct in_addr netmask; - int sense; - struct ast_ha *next; -}; - struct my_ifreq { char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "eth0", "ppp0", etc. */ struct sockaddr_in ifru_addr; @@ -206,12 +198,14 @@ int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin) /* Start optimistic */ int res = AST_SENSE_ALLOW; while (ha) { +#if 0 /* debugging code */ char iabuf[INET_ADDRSTRLEN]; char iabuf2[INET_ADDRSTRLEN]; /* DEBUG */ ast_copy_string(iabuf, ast_inet_ntoa(sin->sin_addr), sizeof(iabuf)); ast_copy_string(iabuf2, ast_inet_ntoa(ha->netaddr), sizeof(iabuf2)); ast_debug(1, "##### Testing %s with %s\n", iabuf, iabuf2); +#endif /* For each rule, if this address and the netmask = the net address apply the current rule */ if ((sin->sin_addr.s_addr & ha->netmask.s_addr) == ha->netaddr.s_addr) @@ -332,7 +326,6 @@ int ast_ouraddrfor(struct in_addr *them, struct in_addr *us) int s; struct sockaddr_in sin; socklen_t slen; - s = socket(PF_INET, SOCK_DGRAM, 0); if (s < 0) { ast_log(LOG_WARNING, "Cannot create socket\n");