Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dist/ipf/netinet Don't drop fragments that are smalled t...



details:   https://anonhg.NetBSD.org/src/rev/ee3f564bcb29
branches:  trunk
changeset: 582854:ee3f564bcb29
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jul 09 14:51:11 2005 +0000

description:
Don't drop fragments that are smalled than the ip header size. From skd

diffstat:

 sys/dist/ipf/netinet/fil.c |  18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (60 lines):

diff -r 365cf80ad6e7 -r ee3f564bcb29 sys/dist/ipf/netinet/fil.c
--- a/sys/dist/ipf/netinet/fil.c        Sat Jul 09 14:15:11 2005 +0000
+++ b/sys/dist/ipf/netinet/fil.c        Sat Jul 09 14:51:11 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fil.c,v 1.16 2005/06/11 12:31:40 darrenr Exp $ */
+/*     $NetBSD: fil.c,v 1.17 2005/07/09 14:51:11 christos Exp $        */
 
 /*
  * Copyright (C) 1993-2003 by Darren Reed.
@@ -135,7 +135,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.16 2005/06/11 12:31:40 darrenr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.17 2005/07/09 14:51:11 christos Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c        1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 2.243.2.57 2005/03/28 10:47:50 darrenr Exp";
@@ -886,7 +886,7 @@
        int minicmpsz = sizeof(struct icmp);
        icmphdr_t *icmp;
 
-       if (frpr_pullup(fin, ICMPERR_ICMPHLEN) == -1)
+       if (fin->fin_off == 0 && frpr_pullup(fin, ICMPERR_ICMPHLEN) == -1)
                return;
 
        fr_checkv4sum(fin);
@@ -1171,7 +1171,7 @@
 static INLINE void frpr_esp(fin)
 fr_info_t *fin;
 {
-       if (frpr_pullup(fin, 8) == -1)
+       if (fin->fin_off == 0 && frpr_pullup(fin, 8) == -1)
                return;
 
        if (fin->fin_v == 4)
@@ -1195,7 +1195,7 @@
 {
        grehdr_t *gre;
 
-       if (frpr_pullup(fin, sizeof(grehdr_t)) == -1)
+       if (fin->fin_off == 0 && frpr_pullup(fin, sizeof(grehdr_t)) == -1)
                return;
 
        if (fin->fin_v == 4)
@@ -1204,9 +1204,11 @@
        else if (fin->fin_v == 6)
                frpr_short6(fin, sizeof(grehdr_t));
 #endif
-       gre = fin->fin_dp;
-       if (GRE_REV(gre->gr_flags) == 1)
-               fin->fin_data[0] = gre->gr_call;
+       if (fin->fin_off == 0 ) {
+               gre = fin->fin_dp;
+               if (GRE_REV(gre->gr_flags) == 1)
+                       fin->fin_data[0] = gre->gr_call;
+        }
 }
 
 



Home | Main Index | Thread Index | Old Index