Skip to content

Commit

Permalink
Back out unneeded npfctl_table_getid() signature change
Browse files Browse the repository at this point in the history
  • Loading branch information
yazshel committed Aug 22, 2019
1 parent 0af0186 commit d71e851
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/npfctl/npf_build.c
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions src/npfctl/npf_data.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/npfctl/npfctl.h
Expand Up @@ -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 *);
Expand Down

0 comments on commit d71e851

Please sign in to comment.