in_addr_t instead of struct in_addr

This commit is contained in:
Thomas Bernard 2020-10-22 23:20:50 +02:00
parent 6b2070c6e9
commit 92ff8a6a7e
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
3 changed files with 4 additions and 4 deletions

View File

@ -265,7 +265,7 @@ check_upnp_rule_against_permissions(const struct upnpperm * permary,
void
get_permitted_ext_ports(uint32_t * allowed,
const struct upnpperm * permary, int n_perms,
struct in_addr address, u_short iport)
in_addr_t addr, u_short iport)
{
int i, j;
@ -274,7 +274,7 @@ get_permitted_ext_ports(uint32_t * allowed,
for (i = n_perms - 1; i >= 0; i--)
{
if( (address.s_addr & permary[i].mask.s_addr)
if( (addr & permary[i].mask.s_addr)
!= (permary[i].address.s_addr & permary[i].mask.s_addr) )
continue;
if( (iport < permary[i].iport_min) || (permary[i].iport_max < iport))

View File

@ -51,7 +51,7 @@ check_upnp_rule_against_permissions(const struct upnpperm * permary,
void
get_permitted_ext_ports(uint32_t * allowed,
const struct upnpperm * permary, int n_perms,
struct in_addr address, u_short iport);
in_addr_t addr, u_short iport);
#ifdef USE_MINIUPNPDCTL
void

View File

@ -685,7 +685,7 @@ AddAnyPortMapping(struct upnphttp * h, const char * action, const char * ns)
syslog(LOG_ERR, "inet_aton(%s) FAILED", int_ip);
}
get_permitted_ext_ports(allowed_eports, upnppermlist, num_upnpperm,
address, iport);
address.s_addr, iport);
eport_above = eport_below = eport;
for(;;) {
/* loop invariant