MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / validate_acl_list

Function validate_acl_list

ffserver.c:1379–1394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1377}
1378
1379static int validate_acl_list(IPAddressACL *in_acl, HTTPContext *c)
1380{
1381 enum IPAddressAction last_action = IP_DENY;
1382 IPAddressACL *acl;
1383 struct in_addr *src = &c->from_addr.sin_addr;
1384 unsigned long src_addr = src->s_addr;
1385
1386 for (acl = in_acl; acl; acl = acl->next) {
1387 if (src_addr >= acl->first.s_addr && src_addr <= acl->last.s_addr)
1388 return (acl->action == IP_ALLOW) ? 1 : 0;
1389 last_action = acl->action;
1390 }
1391
1392 /* Nothing matched, so return not the last action */
1393 return (last_action == IP_DENY) ? 1 : 0;
1394}
1395
1396static int validate_acl(FFStream *stream, HTTPContext *c)
1397{

Callers 1

validate_aclFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected