diff --git a/src/npfctl/npf_build.c b/src/npfctl/npf_build.c index c1fb377a..e14d5790 100644 --- a/src/npfctl/npf_build.c +++ b/src/npfctl/npf_build.c @@ -178,12 +178,12 @@ npfctl_table_getbyname(nl_config_t *ncf, const char *name) } unsigned -npfctl_table_getid(nl_config_t *ncf, const char *name) +npfctl_table_getid(const char *name) { unsigned tid = (unsigned)-1; nl_table_t *tl; - tl = npfctl_table_getbyname(ncf, name); + tl = npfctl_table_getbyname(npf_conf, name); if (tl != NULL) { tid = npf_table_getid(tl); } @@ -969,7 +969,7 @@ npfctl_ifnet_table(const char *ifname) snprintf(tname, sizeof(tname), NPF_IFNET_TABLE_PREF "%s", ifname); - tid = npfctl_table_getid(npf_conf, tname); + tid = npfctl_table_getid(tname); if (tid == (unsigned)-1) { tid = npfctl_tid_counter++; tl = npf_table_create(tname, tid, NPF_TABLE_IFADDR); diff --git a/src/npfctl/npf_data.c b/src/npfctl/npf_data.c index af76ddcf..e21bedcc 100644 --- a/src/npfctl/npf_data.c +++ b/src/npfctl/npf_data.c @@ -258,10 +258,8 @@ npfvar_t * npfctl_parse_table_id(const char *name) { u_int tid; - nl_config_t *ncf; - ncf = npfctl_config_ref(); - tid = npfctl_table_getid(ncf, name); + tid = npfctl_table_getid(name); if (tid == (unsigned)-1) { yyerror("table '%s' is not defined", name); return NULL; diff --git a/src/npfctl/npfctl.h b/src/npfctl/npfctl.h index e9703de9..cc5b3003 100644 --- a/src/npfctl/npfctl.h +++ b/src/npfctl/npfctl.h @@ -118,7 +118,7 @@ char * npfctl_print_addrmask(int, const char *, const npf_addr_t *, npf_netmask_t); void npfctl_note_interface(const char *); nl_table_t * npfctl_table_getbyname(nl_config_t *, const char *); -unsigned npfctl_table_getid(nl_config_t *, const char *); +unsigned npfctl_table_getid(const char *); const char * npfctl_table_getname(nl_config_t *, unsigned, bool *); int npfctl_protono(const char *); in_port_t npfctl_portno(const char *);