diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2011-08-03 00:01:31 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2011-08-03 00:01:31 +0000 |
commit | 1b55600e5f7bcce676aba246dae1eadb3fed6777 (patch) | |
tree | ead9610d2eb28f8eb3dd30eb94e939fb9e962a21 /sys/net | |
parent | 732d513c041ef6c045b4b9076e63a39fdb359c8f (diff) |
someone (*cough*henning*cough*) made pf_state.state_flags a u_int16_t
without growing it in pfsync_state too.
to keep the wire format compat this uses some of the pad bytes to send
all the state flags on the wire as well as maintaining the old state_flags
field. after 5.0 we'll deprecate the original field and only use the new
one.
discussed with mcbride and deraadt and based on a diff from deraadt.
tested against an "old" pfsync locally.
ok mcbride@ henning@ deraadt@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_pfsync.c | 7 | ||||
-rw-r--r-- | sys/net/pfvar.h | 7 |
2 files changed, 9 insertions, 5 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index 7c951659c36..f8525bc8354 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.166 2011/08/02 13:13:57 mcbride Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.167 2011/08/03 00:01:30 dlg Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -449,7 +449,9 @@ pfsync_state_export(struct pfsync_state *sp, struct pf_state *st) sp->direction = st->direction; sp->log = st->log; sp->timeout = st->timeout; + /* XXX replace state_flags post 5.0 */ sp->state_flags = st->state_flags; + sp->all_state_flags = htons(st->state_flags); if (!SLIST_EMPTY(&st->src_nodes)) sp->sync_flags |= PFSYNC_FLAG_SRCNODE; @@ -580,7 +582,8 @@ pfsync_state_import(struct pfsync_state *sp, int flags) st->direction = sp->direction; st->log = sp->log; st->timeout = sp->timeout; - st->state_flags = sp->state_flags; + /* XXX replace state_flags post 5.0 */ + st->state_flags = sp->state_flags | ntohs(sp->all_state_flags); st->max_mss = ntohs(sp->max_mss); st->min_ttl = sp->min_ttl; st->set_tos = sp->set_tos; diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 00bb367130c..eb0a887b96d 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.342 2011/08/02 13:13:57 mcbride Exp $ */ +/* $OpenBSD: pfvar.h,v 1.343 2011/08/03 00:01:30 dlg Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -903,13 +903,14 @@ struct pfsync_state { u_int8_t proto; u_int8_t direction; u_int8_t log; - u_int8_t state_flags; + u_int8_t state_flags; /* XXX remove after 5.0 */ u_int8_t timeout; u_int8_t sync_flags; u_int8_t updates; u_int8_t min_ttl; u_int8_t set_tos; - u_int8_t pad[4]; + u_int16_t all_state_flags; + u_int8_t pad[2]; } __packed; #define PFSYNC_FLAG_SRCNODE 0x04 |