From c2d9ed99316f26de2d57d9798eee50034114540b Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 19 Oct 2018 12:55:16 +0200 Subject: libxtables: prefix exported new functions for etherdb lookups To avoid symbol pollution, place them under the xt_ and xtables_ prefix name. Fixes: 31f1434dfe37 ("libxtables: Integrate getethertype.c from xtables core") Reported-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso Acked-by: Phil Sutter --- libxtables/getethertype.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'libxtables') diff --git a/libxtables/getethertype.c b/libxtables/getethertype.c index 027ef4ad..a4c1407c 100644 --- a/libxtables/getethertype.c +++ b/libxtables/getethertype.c @@ -49,20 +49,20 @@ static FILE *etherf = NULL; static char line[BUFSIZ + 1]; -static struct ethertypeent et_ent; +static struct xt_ethertypeent et_ent; static char *ethertype_aliases[MAXALIASES]; static int ethertype_stayopen; -void setethertypeent(int f) +static void setethertypeent(int f) { if (etherf == NULL) - etherf = fopen(_PATH_ETHERTYPES, "r"); + etherf = fopen(_XT_PATH_ETHERTYPES, "r"); else rewind(etherf); ethertype_stayopen |= f; } -void endethertypeent(void) +static void endethertypeent(void) { if (etherf) { fclose(etherf); @@ -71,14 +71,15 @@ void endethertypeent(void) ethertype_stayopen = 0; } -struct ethertypeent *getethertypeent(void) + +static struct xt_ethertypeent *getethertypeent(void) { char *e; char *endptr; register char *cp, **q; if (etherf == NULL - && (etherf = fopen(_PATH_ETHERTYPES, "r")) == NULL) { + && (etherf = fopen(_XT_PATH_ETHERTYPES, "r")) == NULL) { return (NULL); } @@ -127,10 +128,9 @@ again: return (&et_ent); } - -struct ethertypeent *getethertypebyname(const char *name) +struct xt_ethertypeent *xtables_getethertypebyname(const char *name) { - register struct ethertypeent *e; + register struct xt_ethertypeent *e; register char **cp; setethertypeent(ethertype_stayopen); @@ -147,9 +147,9 @@ found: return (e); } -struct ethertypeent *getethertypebynumber(int type) +struct xt_ethertypeent *xtables_getethertypebynumber(int type) { - register struct ethertypeent *e; + register struct xt_ethertypeent *e; setethertypeent(ethertype_stayopen); while ((e = getethertypeent()) != NULL) -- cgit v1.2.3