Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/ip_fw_table_algo.c
Show First 20 Lines • Show All 434 Lines • ▼ Show 20 Lines | |||||
* New table | * New table | ||||
*/ | */ | ||||
static int | static int | ||||
ta_init_radix(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti, | ta_init_radix(struct ip_fw_chain *ch, void **ta_state, struct table_info *ti, | ||||
char *data, uint8_t tflags) | char *data, uint8_t tflags) | ||||
{ | { | ||||
struct radix_cfg *cfg; | struct radix_cfg *cfg; | ||||
if (!rn_inithead(&ti->state, OFF_LEN_INET)) | if (!rn_inithead(&ti->state, OFF_LEN_INET, KEY_LEN_INET)) | ||||
return (ENOMEM); | return (ENOMEM); | ||||
if (!rn_inithead(&ti->xstate, OFF_LEN_INET6)) { | if (!rn_inithead(&ti->xstate, OFF_LEN_INET6, KEY_LEN_INET6)) { | ||||
rn_detachhead(&ti->state); | rn_detachhead(&ti->state); | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
cfg = malloc(sizeof(struct radix_cfg), M_IPFW, M_WAITOK | M_ZERO); | cfg = malloc(sizeof(struct radix_cfg), M_IPFW, M_WAITOK | M_ZERO); | ||||
*ta_state = cfg; | *ta_state = cfg; | ||||
ti->lookup = ta_lookup_radix; | ti->lookup = ta_lookup_radix; | ||||
▲ Show 20 Lines • Show All 3,659 Lines • Show Last 20 Lines |