diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-06-24 20:49:41 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2001-06-24 20:49:41 +0000 |
commit | 2fb3aad89ae820366dcc49e91f6d04c73563c824 (patch) | |
tree | 00d18c689ae09592208e5c2ed5a31232572eac9f /sys/net | |
parent | a78ba2a493d2e43e13412462a92d9e9b932fb81e (diff) |
drop if packet is too short
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/pf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c index 90f5ebdd18c..74a7ef2ce01 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.2 2001/06/24 20:47:37 itojun Exp $ */ +/* $OpenBSD: pf.c,v 1.3 2001/06/24 20:49:40 itojun Exp $ */ /* * Copyright (c) 2001, Daniel Hartmeier @@ -1618,8 +1618,10 @@ pull_hdr(struct ifnet *ifp, struct mbuf **m, struct ip *h, int *action, print_ip(ifp, h); return NULL; } - if (hl + len > (*m)->m_pkthdr.len) + if (hl + len > (*m)->m_pkthdr.len) { + *action = PF_DROP; return NULL; + } m_copydata(*m, hl, len, header); return header; } |