iptable.c revision 0c27b3fe77ac1d5094ba3521e8142d9e7973133f
/*
* Copyright (C) 2007-2009, 2013, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <config.h>
/*
* Create a new IP table and the underlying radix structure
*/
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS)
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
}
/*
* Add an IP prefix to an existing IP table
*/
{
}
{
int i;
if (result != ISC_R_SUCCESS) {
return(result);
}
/* If a node already contains data, don't overwrite it */
/* "any" or "none" */
for (i = 0; i < 4; i++) {
: &dns_iptable_neg;
}
} else {
/* any other prefix */
: &dns_iptable_neg;
}
}
return (ISC_R_SUCCESS);
}
/*
* Merge one IP table into another one.
*/
{
int i, max_node = 0;
if (result != ISC_R_SUCCESS)
return(result);
/*
* If we're negating a nested ACL, then we should
* reverse the sense of every node. However, this
* could lead to a negative node in a nested ACL
* becoming a positive match in the parent, which
* could be a security risk. To prevent this, we
* just leave the negative nodes negative.
*/
for (i = 0; i < 4; i++) {
if (!pos) {
}
}
return (ISC_R_SUCCESS);
}
void
}
void
unsigned int refs;
if (refs == 0)
}
static void
}
}