Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/raw_ip.c,v retrieving revision 1.100 retrieving revision 1.100.6.2 diff -u -p -r1.100 -r1.100.6.2 --- src/sys/netinet/raw_ip.c 2007/09/19 04:33:43 1.100 +++ src/sys/netinet/raw_ip.c 2007/12/27 00:46:31 1.100.6.2 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.100 2007/09/19 04:33:43 dyoung Exp $ */ +/* $NetBSD: raw_ip.c,v 1.100.6.2 2007/12/27 00:46:31 mjf Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -61,7 +61,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.100 2007/09/19 04:33:43 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.100.6.2 2007/12/27 00:46:31 mjf Exp $"); #include "opt_inet.h" #include "opt_ipsec.h" @@ -358,7 +358,7 @@ rip_output(struct mbuf *m, ...) } HTONS(ip->ip_len); HTONS(ip->ip_off); - if (ip->ip_id == 0) + if (ip->ip_id == 0 && m->m_pkthdr.len >= IP_MINFRAGSIZE) ip->ip_id = ip_newid(); opts = NULL; /* XXX prevent ip_output from overwriting header fields */ @@ -384,7 +384,7 @@ rip_ctloutput(int op, struct socket *so, *m = m_intopt(so, (inp->inp_flags & INP_NOHEADER) ? 1 : 0); return 0; - } else if (*m == NULL || (*m)->m_len < sizeof(int)) + } else if (*m == NULL || (*m)->m_len != sizeof(int)) error = EINVAL; else if (*mtod(*m, int *)) { inp->inp_flags &= ~INP_HDRINCL; @@ -400,7 +400,7 @@ rip_ctloutput(int op, struct socket *so, case PRCO_SETOPT: switch (optname) { case IP_HDRINCL: - if (*m == NULL || (*m)->m_len < sizeof(int)) + if (*m == NULL || (*m)->m_len != sizeof(int)) error = EINVAL; else if (*mtod(*m, int *)) inp->inp_flags |= INP_HDRINCL;