summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/contrib/pf/net/pf.c19
-rw-r--r--sys/contrib/pf/net/pf_ioctl.c6
-rw-r--r--sys/contrib/pf/net/pf_norm.c10
3 files changed, 16 insertions, 19 deletions
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index e7f2d11..a49b3f6 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $OpenBSD: pf.c,v 1.433 2004/03/26 22:20:57 dhartmei Exp $ */
+/* $OpenBSD: pf.c,v 1.433.2.1 2004/04/30 21:46:33 brad Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -5188,17 +5188,14 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
if (ifp == NULL)
goto bad;
- mtag = m_tag_find(m0, PACKET_TAG_PF_ROUTED, NULL);
- if (mtag == NULL) {
- struct m_tag *mtag;
-
- mtag = m_tag_get(PACKET_TAG_PF_ROUTED, 0, M_NOWAIT);
- if (mtag == NULL)
- goto bad;
- m_tag_prepend(m0, mtag);
- }
+ if (m_tag_find(m0, PACKET_TAG_PF_ROUTED, NULL) != NULL)
+ goto bad;
+ mtag = m_tag_get(PACKET_TAG_PF_ROUTED, 0, M_NOWAIT);
+ if (mtag == NULL)
+ goto bad;
+ m_tag_prepend(m0, mtag);
- if (oifp != ifp && mtag == NULL) {
+ if (oifp != ifp) {
#ifdef __FreeBSD__
PF_UNLOCK();
if (pf_test(PF_OUT, ifp, &m0) != PF_PASS) {
diff --git a/sys/contrib/pf/net/pf_ioctl.c b/sys/contrib/pf/net/pf_ioctl.c
index bd8cabb..b099d3e 100644
--- a/sys/contrib/pf/net/pf_ioctl.c
+++ b/sys/contrib/pf/net/pf_ioctl.c
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $OpenBSD: pf_ioctl.c,v 1.112 2004/03/22 04:54:18 mcbride Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.112.2.1 2004/04/30 21:43:30 brad Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -117,7 +117,7 @@ int pfopen(struct cdev *, int, int, struct proc *);
int pfclose(struct cdev *, int, int, struct proc *);
#endif
struct pf_pool *pf_get_pool(char *, char *, u_int32_t,
- u_int8_t, u_int8_t, u_int8_t, u_int8_t, u_int8_t);
+ u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t);
int pf_get_ruleset_number(u_int8_t);
void pf_init_ruleset(struct pf_ruleset *);
void pf_mv_pool(struct pf_palist *, struct pf_palist *);
@@ -420,7 +420,7 @@ pfclose(struct cdev *dev, int flags, int fmt, struct proc *p)
struct pf_pool *
pf_get_pool(char *anchorname, char *rulesetname, u_int32_t ticket,
- u_int8_t rule_action, u_int8_t rule_number, u_int8_t r_last,
+ u_int8_t rule_action, u_int32_t rule_number, u_int8_t r_last,
u_int8_t active, u_int8_t check_ticket)
{
struct pf_ruleset *ruleset;
diff --git a/sys/contrib/pf/net/pf_norm.c b/sys/contrib/pf/net/pf_norm.c
index e00a11e..5bd898a 100644
--- a/sys/contrib/pf/net/pf_norm.c
+++ b/sys/contrib/pf/net/pf_norm.c
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $OpenBSD: pf_norm.c,v 1.80 2004/03/09 21:44:41 mcbride Exp $ */
+/* $OpenBSD: pf_norm.c,v 1.80.2.1 2004/04/30 21:46:33 brad Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@@ -1543,8 +1543,8 @@ pf_normalize_tcp_init(struct mbuf *m, int off, struct pf_pdesc *pd,
}
/* FALLTHROUGH */
default:
- hlen -= opt[1];
- opt += opt[1];
+ hlen -= MAX(opt[1], 2);
+ opt += MAX(opt[1], 2);
break;
}
}
@@ -1659,8 +1659,8 @@ pf_normalize_tcp_stateful(struct mbuf *m, int off, struct pf_pdesc *pd,
}
/* FALLTHROUGH */
default:
- hlen -= opt[1];
- opt += opt[1];
+ hlen -= MAX(opt[1], 2);
+ opt += MAX(opt[1], 2);
break;
}
}
OpenPOWER on IntegriCloud