diff --git a/sys/external/bsd/ipf/netinet/fil.c b/sys/external/bsd/ipf/netinet/fil.c index b74eab8a09b0..33ac88d49c23 100644 --- a/sys/external/bsd/ipf/netinet/fil.c +++ b/sys/external/bsd/ipf/netinet/fil.c @@ -1,4 +1,4 @@ -/* $NetBSD: fil.c,v 1.29.2.2 2019/10/03 17:18:32 martin Exp $ */ +/* $NetBSD: fil.c,v 1.29.2.3 2020/04/12 08:39:42 martin Exp $ */ /* * Copyright (C) 2012 by Darren Reed. @@ -141,7 +141,7 @@ extern struct timeout ipf_slowtimer_ch; #if !defined(lint) #if defined(__NetBSD__) #include -__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.29.2.2 2019/10/03 17:18:32 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.29.2.3 2020/04/12 08:39:42 martin 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 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $"; @@ -1696,7 +1696,7 @@ ipf_pr_ipv4hdr(fr_info_t *fin) fi->fi_p = p; fin->fin_crc = p; fi->fi_tos = ip->ip_tos; - fin->fin_id = ip->ip_id; + fin->fin_id = ntohs(ip->ip_id); off = ntohs(ip->ip_off); /* Get both TTL and protocol */ @@ -1724,11 +1724,10 @@ ipf_pr_ipv4hdr(fr_info_t *fin) */ off &= IP_MF|IP_OFFMASK; if (off != 0) { + int morefrag = off & IP_MF; fi->fi_flx |= FI_FRAG; off &= IP_OFFMASK; if (off != 0) { - int morefrag = off & IP_MF; - if (off == 1 && p == IPPROTO_TCP) { fin->fin_flx |= FI_SHORT; /* RFC 3128 */ DT1(ipf_fi_tcp_frag_off_1, fr_info_t *, fin); diff --git a/sys/external/bsd/ipf/netinet/ip_frag.c b/sys/external/bsd/ipf/netinet/ip_frag.c index 7520a8a32664..f035df461d9e 100644 --- a/sys/external/bsd/ipf/netinet/ip_frag.c +++ b/sys/external/bsd/ipf/netinet/ip_frag.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_frag.c,v 1.7 2018/06/03 10:37:23 maxv Exp $ */ +/* $NetBSD: ip_frag.c,v 1.7.6.1 2020/04/12 08:39:42 martin Exp $ */ /* * Copyright (C) 2012 by Darren Reed. @@ -86,7 +86,7 @@ struct file; #if !defined(lint) #if defined(__NetBSD__) #include -__KERNEL_RCSID(0, "$NetBSD: ip_frag.c,v 1.7 2018/06/03 10:37:23 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_frag.c,v 1.7.6.1 2020/04/12 08:39:42 martin Exp $"); #else static const char sccsid[] = "@(#)ip_frag.c 1.11 3/24/96 (C) 1993-2000 Darren Reed"; static const char rcsid[] = "@(#)Id: ip_frag.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp"; @@ -393,6 +393,7 @@ ipfr_frag_new( } } + memset(&frag, 0, sizeof(frag)); frag.ipfr_v = fin->fin_v; idx = fin->fin_v; frag.ipfr_p = fin->fin_p; @@ -441,6 +442,7 @@ ipfr_frag_new( FBUMPD(ifs_nomem); return NULL; } + memset(fran, 0, sizeof(*fran)); WRITE_ENTER(lock); @@ -478,6 +480,7 @@ ipfr_frag_new( table[idx] = fra; bcopy((char *)&frag.ipfr_ifp, (char *)&fra->ipfr_ifp, IPFR_CMPSZ); fra->ipfr_v = fin->fin_v; + fra->ipfr_p = fin->fin_p; fra->ipfr_ttl = softc->ipf_ticks + softf->ipfr_ttl; fra->ipfr_firstend = frag.ipfr_firstend; @@ -655,6 +658,7 @@ ipf_frag_lookup( * * build up a hash value to index the table with. */ + memset(&frag, 0, sizeof(frag)); frag.ipfr_v = fin->fin_v; idx = fin->fin_v; frag.ipfr_p = fin->fin_p;