Skip to content

Commit 979037f

Browse files
committed
pflog: don't use PF_ as a prefix for #defines.
PF_ is used as a prefix for packet family values, and that may cause a collision between PF_ packet family values, such as PF_DIVERT, and PF_ action valus, such as... PF_DIVERT. Use PFACT_ for action values and PFDIR_ for direction values.
1 parent b50d26f commit 979037f

File tree

1 file changed

+79
-79
lines changed

1 file changed

+79
-79
lines changed

print-pflog.c

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -219,121 +219,121 @@ static const struct tok pf_reasons_other[] = {
219219
/*
220220
* Action values.
221221
*/
222-
#define PF_PASS 0
223-
#define PF_DROP 1
224-
#define PF_SCRUB 2
225-
#define PF_NOSCRUB 3
226-
#define PF_NAT 4
227-
#define PF_NONAT 5
228-
#define PF_BINAT 6
229-
#define PF_NOBINAT 7
230-
#define PF_RDR 8
231-
#define PF_NORDR 9
232-
#define PF_SYNPROXY_DROP 10
222+
#define PFACT_PASS 0
223+
#define PFACT_DROP 1
224+
#define PFACT_SCRUB 2
225+
#define PFACT_NOSCRUB 3
226+
#define PFACT_NAT 4
227+
#define PFACT_NONAT 5
228+
#define PFACT_BINAT 6
229+
#define PFACT_NOBINAT 7
230+
#define PFACT_RDR 8
231+
#define PFACT_NORDR 9
232+
#define PFACT_SYNPROXY_DROP 10
233233

234234
/* FreeBSD and OpenBSD */
235-
#define PF_DEFER 11
235+
#define PFACT_DEFER 11
236236

237237
/* FreeBSD */
238-
#define PF_MATCH 12
238+
#define PFACT_MATCH 12
239239

240240
/* OpenBSD */
241-
#define PF_MATCH 12
242-
#define PF_DIVERT 13
243-
#define PF_RT 14
244-
#define PF_AFRT 15
241+
#define PFACT_MATCH 12
242+
#define PFACT_DIVERT 13
243+
#define PFACT_RT 14
244+
#define PFACT_AFRT 15
245245

246246
/* Darwin */
247-
#define PF_DUMMYNET 11
248-
#define PF_NODUMMYNET 12
249-
#define PF_NAT64 13
250-
#define PF_NONAT64 14
247+
#define PFACT_DUMMYNET 11
248+
#define PFACT_NODUMMYNET 12
249+
#define PFACT_NAT64 13
250+
#define PFACT_NONAT64 14
251251

252252
static const struct tok pf_actions_freebsd[] = {
253-
{ PF_PASS, "pass" },
254-
{ PF_DROP, "block" },
255-
{ PF_SCRUB, "scrub" },
256-
{ PF_NOSCRUB, "noscrub" },
257-
{ PF_NAT, "nat" },
258-
{ PF_NONAT, "nonat" },
259-
{ PF_BINAT, "binat" },
260-
{ PF_NOBINAT, "nobinat" },
261-
{ PF_RDR, "rdr" },
262-
{ PF_NORDR, "nordr" },
263-
{ PF_SYNPROXY_DROP, "synproxy-drop" },
264-
{ PF_DEFER, "defer" },
265-
{ PF_MATCH, "match" },
253+
{ PFACT_PASS, "pass" },
254+
{ PFACT_DROP, "block" },
255+
{ PFACT_SCRUB, "scrub" },
256+
{ PFACT_NOSCRUB, "noscrub" },
257+
{ PFACT_NAT, "nat" },
258+
{ PFACT_NONAT, "nonat" },
259+
{ PFACT_BINAT, "binat" },
260+
{ PFACT_NOBINAT, "nobinat" },
261+
{ PFACT_RDR, "rdr" },
262+
{ PFACT_NORDR, "nordr" },
263+
{ PFACT_SYNPROXY_DROP, "synproxy-drop" },
264+
{ PFACT_DEFER, "defer" },
265+
{ PFACT_MATCH, "match" },
266266
{ 0, NULL }
267267
};
268268

269269
static const struct tok pf_actions_openbsd[] = {
270-
{ PF_PASS, "pass" },
271-
{ PF_DROP, "block" },
272-
{ PF_SCRUB, "scrub" },
273-
{ PF_NOSCRUB, "noscrub" },
274-
{ PF_NAT, "nat" },
275-
{ PF_NONAT, "nonat" },
276-
{ PF_BINAT, "binat" },
277-
{ PF_NOBINAT, "nobinat" },
278-
{ PF_RDR, "rdr" },
279-
{ PF_NORDR, "nordr" },
280-
{ PF_SYNPROXY_DROP, "synproxy-drop" },
281-
{ PF_DEFER, "defer" },
282-
{ PF_MATCH, "match" },
283-
{ PF_DIVERT, "divert" },
284-
{ PF_RT, "rt" },
285-
{ PF_AFRT, "afrt" },
270+
{ PFACT_PASS, "pass" },
271+
{ PFACT_DROP, "block" },
272+
{ PFACT_SCRUB, "scrub" },
273+
{ PFACT_NOSCRUB, "noscrub" },
274+
{ PFACT_NAT, "nat" },
275+
{ PFACT_NONAT, "nonat" },
276+
{ PFACT_BINAT, "binat" },
277+
{ PFACT_NOBINAT, "nobinat" },
278+
{ PFACT_RDR, "rdr" },
279+
{ PFACT_NORDR, "nordr" },
280+
{ PFACT_SYNPROXY_DROP, "synproxy-drop" },
281+
{ PFACT_DEFER, "defer" },
282+
{ PFACT_MATCH, "match" },
283+
{ PFACT_DIVERT, "divert" },
284+
{ PFACT_RT, "rt" },
285+
{ PFACT_AFRT, "afrt" },
286286
{ 0, NULL }
287287
};
288288

289289
static const struct tok pf_actions_darwin[] = {
290-
{ PF_PASS, "pass" },
291-
{ PF_DROP, "block" },
292-
{ PF_SCRUB, "scrub" },
293-
{ PF_NOSCRUB, "noscrub" },
294-
{ PF_NAT, "nat" },
295-
{ PF_NONAT, "nonat" },
296-
{ PF_BINAT, "binat" },
297-
{ PF_NOBINAT, "nobinat" },
298-
{ PF_RDR, "rdr" },
299-
{ PF_NORDR, "nordr" },
300-
{ PF_SYNPROXY_DROP, "synproxy-drop" },
301-
{ PF_DUMMYNET, "dummynet (Darwin)" },
302-
{ PF_NODUMMYNET, "nodummynet (Darwin)" },
303-
{ PF_NAT64, "nat64 (Darwin)" },
304-
{ PF_NONAT64, "nonat64 (Darwin)" },
290+
{ PFACT_PASS, "pass" },
291+
{ PFACT_DROP, "block" },
292+
{ PFACT_SCRUB, "scrub" },
293+
{ PFACT_NOSCRUB, "noscrub" },
294+
{ PFACT_NAT, "nat" },
295+
{ PFACT_NONAT, "nonat" },
296+
{ PFACT_BINAT, "binat" },
297+
{ PFACT_NOBINAT, "nobinat" },
298+
{ PFACT_RDR, "rdr" },
299+
{ PFACT_NORDR, "nordr" },
300+
{ PFACT_SYNPROXY_DROP, "synproxy-drop" },
301+
{ PFACT_DUMMYNET, "dummynet (Darwin)" },
302+
{ PFACT_NODUMMYNET, "nodummynet (Darwin)" },
303+
{ PFACT_NAT64, "nat64 (Darwin)" },
304+
{ PFACT_NONAT64, "nonat64 (Darwin)" },
305305
{ 0, NULL }
306306
};
307307

308308
/*
309309
* Direction values.
310310
*/
311-
#define PF_INOUT 0
312-
#define PF_IN 1
313-
#define PF_OUT 2
311+
#define PFDIR_INOUT 0
312+
#define PFDIR_IN 1
313+
#define PFDIR_OUT 2
314314

315315
/* OpenBSD */
316-
#define PF_FWD 3
316+
#define PFDIR_FWD 3
317317

318318
static const struct tok pf_directions_freebsd[] = {
319-
{ PF_INOUT, "in/out" },
320-
{ PF_IN, "in" },
321-
{ PF_OUT, "out" },
319+
{ PFDIR_INOUT, "in/out" },
320+
{ PFDIR_IN, "in" },
321+
{ PFDIR_OUT, "out" },
322322
{ 0, NULL }
323323
};
324324

325325
static const struct tok pf_directions_openbsd[] = {
326-
{ PF_INOUT, "in/out" },
327-
{ PF_IN, "in" },
328-
{ PF_OUT, "out" },
329-
{ PF_FWD, "fwd" },
326+
{ PFDIR_INOUT, "in/out" },
327+
{ PFDIR_IN, "in" },
328+
{ PFDIR_OUT, "out" },
329+
{ PFDIR_FWD, "fwd" },
330330
{ 0, NULL }
331331
};
332332

333333
static const struct tok pf_directions_other[] = {
334-
{ PF_INOUT, "in/out" },
335-
{ PF_IN, "in" },
336-
{ PF_OUT, "out" },
334+
{ PFDIR_INOUT, "in/out" },
335+
{ PFDIR_IN, "in" },
336+
{ PFDIR_OUT, "out" },
337337
{ 0, NULL }
338338
};
339339

0 commit comments

Comments
 (0)