diff options
author | Hugh Graham <hugh@cvs.openbsd.org> | 2002-06-01 04:06:48 +0000 |
---|---|---|
committer | Hugh Graham <hugh@cvs.openbsd.org> | 2002-06-01 04:06:48 +0000 |
commit | 8909c17f5e622901dbff5415516d4ef37dcd161e (patch) | |
tree | cff8825415c3296e115a478f7cf718824ffd667d | |
parent | 07c63d5a26f57fd906cfae42f625718b0ac5ee27 (diff) |
ECN flag support for pf. Committed in consultation with Daniel.
-rw-r--r-- | sbin/pfctl/parse.y | 4 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_parser.c | 8 | ||||
-rw-r--r-- | sbin/pfctl/pfctl_parser.h | 4 | ||||
-rw-r--r-- | sys/net/pf.c | 6 |
4 files changed, 14 insertions, 8 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 3db48b6259c..1778fddffa1 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.70 2002/05/24 13:48:44 dhartmei Exp $ */ +/* $OpenBSD: parse.y,v 1.71 2002/06/01 04:06:47 hugh Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -812,7 +812,7 @@ flag : STRING { ; flags : /* empty */ { $$.b1 = 0; $$.b2 = 0; } - | FLAGS flag { $$.b1 = $2.b1; $$.b2 = 63; } + | FLAGS flag { $$.b1 = $2.b1; $$.b2 = PF_TH_ALL; } | FLAGS flag "/" flag { $$.b1 = $2.b1; $$.b2 = $4.b1; } | FLAGS "/" flag { $$.b1 = 0; $$.b2 = $3.b1; } ; diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index 14bbc9c603f..e3ae7944cf9 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.c,v 1.74 2002/05/27 10:33:32 dhartmei Exp $ */ +/* $OpenBSD: pfctl_parser.c,v 1.75 2002/06/01 04:06:47 hugh Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -64,7 +64,7 @@ void print_uid (u_int8_t, uid_t, uid_t, const char *); void print_gid (u_int8_t, gid_t, gid_t, const char *); void print_flags (u_int8_t); -char *tcpflags = "FSRPAU"; +char *tcpflags = "FSRPAUEW"; struct icmptypeent icmp_type[] = { { "echoreq", ICMP_ECHO }, @@ -420,7 +420,7 @@ print_flags(u_int8_t f) { int i; - for (i = 0; i < 6; ++i) + for (i = 0; tcpflags[i]; ++i) if (f & (1 << i)) printf("%c", tcpflags[i]); } @@ -882,7 +882,7 @@ parse_flags(char *s) else f |= 1 << (q - tcpflags); } - return (f ? f : 63); + return (f ? f : PF_TH_ALL); } struct hostent * diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 4ad368366d4..29d4b67b759 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfctl_parser.h,v 1.15 2002/03/11 22:22:57 dhartmei Exp $ */ +/* $OpenBSD: pfctl_parser.h,v 1.16 2002/06/01 04:06:47 hugh Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -41,6 +41,8 @@ #define PF_OPT_CLRRULECTRS 0x0020 #define PF_OPT_USEDNS 0x0040 +#define PF_TH_ALL 0xFF + struct pfctl { int dev; int opts; diff --git a/sys/net/pf.c b/sys/net/pf.c index 9cf5cdf201b..6c56439bdc4 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.212 2002/05/31 20:58:25 itojun Exp $ */ +/* $OpenBSD: pf.c,v 1.213 2002/06/01 04:06:47 hugh Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1089,6 +1089,10 @@ pf_print_flags(u_int8_t f) printf("A"); if (f & TH_URG) printf("U"); + if (f & TH_ECE) + printf("E"); + if (f & TH_CWR) + printf("W"); } void |