diff options
-rw-r--r-- | sys/net/pf.c | 8 | ||||
-rw-r--r-- | sys/net/pf_ioctl.c | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index a65574b0150..457f34f8d8d 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.284 2002/12/26 16:21:37 mcbride Exp $ */ +/* $OpenBSD: pf.c,v 1.285 2002/12/27 15:20:30 dhartmei Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1933,6 +1933,7 @@ pf_test_tcp(struct pf_rule **rm, int direction, struct ifnet *ifp, REASON_SET(&reason, PFRES_MEMORY); return (PF_DROP); } + bzero(s, sizeof(*s)); if (rs != NULL) rs->states++; @@ -2178,6 +2179,7 @@ pf_test_udp(struct pf_rule **rm, int direction, struct ifnet *ifp, s = pool_get(&pf_state_pl, PR_NOWAIT); if (s == NULL) return (PF_DROP); + bzero(s, sizeof(*s)); if (rs != NULL) rs->states++; @@ -2424,6 +2426,7 @@ pf_test_icmp(struct pf_rule **rm, int direction, struct ifnet *ifp, s = pool_get(&pf_state_pl, PR_NOWAIT); if (s == NULL) return (PF_DROP); + bzero(s, sizeof(*s)); if (rs != NULL) rs->states++; @@ -2617,6 +2620,7 @@ pf_test_other(struct pf_rule **rm, int direction, struct ifnet *ifp, s = pool_get(&pf_state_pl, PR_NOWAIT); if (s == NULL) return (PF_DROP); + bzero(s, sizeof(*s)); if (rs != NULL) rs->states++; @@ -3869,7 +3873,7 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, } /* Copied from ip_output. */ - if ((u_int16_t)ip->ip_len <= ifp->if_mtu) { + if (ip->ip_len <= ifp->if_mtu) { ip->ip_len = htons((u_int16_t)ip->ip_len); ip->ip_off = htons((u_int16_t)ip->ip_off); if ((ifp->if_capabilities & IFCAP_CSUM_IPv4) && diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index ec8e2456180..bf370b2ec6e 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.31 2002/12/23 13:15:18 mcbride Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.32 2002/12/27 15:20:30 dhartmei Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -891,6 +891,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) bcopy(&ps->state, state, sizeof(struct pf_state)); state->rule.ptr = NULL; state->nat_rule = NULL; + state->rt_ifp = NULL; state->creation = time.tv_sec; state->expire += state->creation; state->packets = 0; |