BOOTP: Move macro define/undef outsite functions

This avoid some Coccinelle warnings:
CPP-DEFINE: inside function, I treat it as comment
CPP-UNDEF: inside function, I treat it as comment

This also makes the code a bit clearer.
This commit is contained in:
Francois-Xavier Le Bail 2018-01-04 17:09:41 +01:00
parent ff1c209392
commit f5eb55fa6d

View File

@ -1061,6 +1061,10 @@ trunc:
ND_PRINT((ndo, "|[rfc1048]"));
}
#define PRINTCMUADDR(m, s) { ND_TCHECK(cmu->m); \
if (cmu->m.s_addr != 0) \
ND_PRINT((ndo, " %s:%s", s, ipaddr_string(ndo, &cmu->m.s_addr))); }
static void
cmu_print(netdissect_options *ndo,
const u_char *bp)
@ -1068,10 +1072,6 @@ cmu_print(netdissect_options *ndo,
const struct cmu_vend *cmu;
uint8_t v_flags;
#define PRINTCMUADDR(m, s) { ND_TCHECK(cmu->m); \
if (cmu->m.s_addr != 0) \
ND_PRINT((ndo, " %s:%s", s, ipaddr_string(ndo, &cmu->m.s_addr))); }
ND_PRINT((ndo, " vend-cmu"));
cmu = (const struct cmu_vend *)bp;
@ -1092,9 +1092,10 @@ cmu_print(netdissect_options *ndo,
trunc:
ND_PRINT((ndo, "%s", tstr));
#undef PRINTCMUADDR
}
#undef PRINTCMUADDR
static char *
client_fqdn_flags(u_int flags)
{