diff options
author | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2001-09-15 16:47:08 +0000 |
---|---|---|
committer | Daniel Hartmeier <dhartmei@cvs.openbsd.org> | 2001-09-15 16:47:08 +0000 |
commit | 0af4527d0c179ab8228c959129941de8b99024a3 (patch) | |
tree | 5c115ea99fb6283b87801243d23a98f67a81a732 /sys/net/pf_norm.c | |
parent | 14ac48495e52c08d3be7f39e376f967ffd490618 (diff) |
Don't use m_pkthdr.rcvif in pflog_packet(), it doesn't work for outgoing
packets and is obviously invalid (and not NULL) for IPv6 packets (hence
crashed). Pass ifp down instead.
sizeof(ih) instead of sizeof(&ih) for pf_pull_hdr() from pf_test6().
Diffstat (limited to 'sys/net/pf_norm.c')
-rw-r--r-- | sys/net/pf_norm.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/net/pf_norm.c b/sys/net/pf_norm.c index b95bf74b33a..630409d7906 100644 --- a/sys/net/pf_norm.c +++ b/sys/net/pf_norm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_norm.c,v 1.11 2001/09/15 03:54:40 frantzen Exp $ */ +/* $OpenBSD: pf_norm.c,v 1.12 2001/09/15 16:47:07 dhartmei Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> @@ -96,16 +96,16 @@ int pf_normalize_tcp(int, struct ifnet *, struct mbuf *, #define DPFPRINTF(x) if (pf_status.debug) printf x #if NPFLOG > 0 -#define PFLOG_PACKET(x,a,b,c,d,e) \ +#define PFLOG_PACKET(i,x,a,b,c,d,e) \ do { \ if (b == AF_INET) { \ HTONS(((struct ip *)x)->ip_len); \ HTONS(((struct ip *)x)->ip_off); \ - pflog_packet(a,b,c,d,e); \ + pflog_packet(i,a,b,c,d,e); \ NTOHS(((struct ip *)x)->ip_len); \ NTOHS(((struct ip *)x)->ip_off); \ } else { \ - pflog_packet(a,b,c,d,e); \ + pflog_packet(i,a,b,c,d,e); \ } \ } while (0) #else @@ -535,7 +535,7 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct ifnet *ifp, u_short *reason) drop: REASON_SET(reason, PFRES_NORM); if (r != NULL && r->log) - PFLOG_PACKET(h, m, AF_INET, dir, *reason, r); + PFLOG_PACKET(ifp, h, m, AF_INET, dir, *reason, r); return (PF_DROP); bad: @@ -547,7 +547,7 @@ pf_normalize_ip(struct mbuf **m0, int dir, struct ifnet *ifp, u_short *reason) REASON_SET(reason, PFRES_FRAG); if (r != NULL && r->log) - PFLOG_PACKET(h, m, AF_INET, dir, *reason, r); + PFLOG_PACKET(ifp, h, m, AF_INET, dir, *reason, r); return (PF_DROP); } @@ -654,6 +654,6 @@ pf_normalize_tcp(int dir, struct ifnet *ifp, struct mbuf *m, int ipoff, tcp_drop: REASON_SET(&reason, PFRES_NORM); if (rm != NULL && rm->log) - PFLOG_PACKET(h, m, AF_INET, dir, reason, rm); + PFLOG_PACKET(ifp, h, m, AF_INET, dir, reason, rm); return (PF_DROP); } |