commit fix in pr 2772 -- the IP input code was assuming that the

reserved (must be zero) flag must necessarily be zero. We now define
an IP_RF (by analogy to IP_DF and IP_MF) and mask it out when necessary.
This commit is contained in:
perry 1996-09-21 19:44:32 +00:00
parent d8e1329af8
commit 17fcad6b2c
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip.h,v 1.13 1996/09/14 14:40:24 mrg Exp $ */
/* $NetBSD: ip.h,v 1.14 1996/09/21 19:44:32 perry Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@ -61,6 +61,7 @@ struct ip {
int16_t ip_len; /* total length */
u_int16_t ip_id; /* identification */
int16_t ip_off; /* fragment offset field */
#define IP_RF 0x8000 /* reserved flag (must be zero) */
#define IP_DF 0x4000 /* dont fragment flag */
#define IP_MF 0x2000 /* more fragments flag */
#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_input.c,v 1.36 1996/09/14 14:40:26 mrg Exp $ */
/* $NetBSD: ip_input.c,v 1.37 1996/09/21 19:44:33 perry Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1993
@ -364,7 +364,7 @@ ours:
* if the packet was previously fragmented,
* but it's not worth the time; just let them time out.)
*/
if (ip->ip_off &~ IP_DF) {
if (ip->ip_off & ~(IP_DF|IP_RF)) {
if (m->m_flags & M_EXT) { /* XXX */
if ((m = m_pullup(m, sizeof (struct ip))) == 0) {
ipstat.ips_toosmall++;