Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Dec 2019 02:38:48 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r355795 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet
Message-ID:  <201912160238.xBG2cmiG020101@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cy
Date: Mon Dec 16 02:38:47 2019
New Revision: 355795
URL: https://svnweb.freebsd.org/changeset/base/355795

Log:
  MFC r355670:
  
  Rather than pass the address of the packet information control block to
  ipf_pcksum6(), directly pass the adddress of the mbuf to it. This reduces
  one pointer dereference. ipf_pcksum6() doesn't use the packet information
  control block except to obtain the mbuf address.

Modified:
  stable/12/sys/contrib/ipfilter/netinet/fil.c
  stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sys/contrib/ipfilter/netinet/fil.c
  stable/11/sys/contrib/ipfilter/netinet/ip_fil.h
  stable/11/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c
==============================================================================
--- stable/12/sys/contrib/ipfilter/netinet/fil.c	Mon Dec 16 02:05:44 2019	(r355794)
+++ stable/12/sys/contrib/ipfilter/netinet/fil.c	Mon Dec 16 02:38:47 2019	(r355795)
@@ -3436,7 +3436,7 @@ fr_cksum(fin, ip, l4proto, l4hdr)
 		ip6 = (ip6_t *)ip;
 		off = ((caddr_t)ip6 - m->m_data) + sizeof(struct ip6_hdr);
 		int len = ntohs(ip6->ip6_plen) - (off - sizeof(*ip6));
-		return(ipf_pcksum6(fin, ip6, off, len));
+		return(ipf_pcksum6(m, ip6, off, len));
 	} else {
 		return 0xffff;
 	}

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil.h
==============================================================================
--- stable/12/sys/contrib/ipfilter/netinet/ip_fil.h	Mon Dec 16 02:05:44 2019	(r355794)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_fil.h	Mon Dec 16 02:38:47 2019	(r355795)
@@ -1840,7 +1840,7 @@ extern	int		ipf_matchicmpqueryreply __P((int, icmpinfo
 extern	u_32_t		ipf_newisn __P((fr_info_t *));
 extern	u_int		ipf_pcksum __P((fr_info_t *, int, u_int));
 #ifdef	USE_INET6
-extern	u_int		ipf_pcksum6 __P((fr_info_t *, ip6_t *,
+extern	u_int		ipf_pcksum6 __P((struct mbuf *, ip6_t *,
 						u_int32_t, u_int32_t));
 #endif
 extern	void		ipf_rule_expire __P((ipf_main_softc_t *));

Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==============================================================================
--- stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Mon Dec 16 02:05:44 2019	(r355794)
+++ stable/12/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c	Mon Dec 16 02:38:47 2019	(r355795)
@@ -1454,17 +1454,15 @@ ipf_pcksum(fin, hlen, sum)
 
 #ifdef	USE_INET6
 u_int
-ipf_pcksum6(fin, ip6, off, len)
-	fr_info_t *fin;
+ipf_pcksum6(m, ip6, off, len)
+	struct mbuf *m;
 	ip6_t *ip6;
 	u_int32_t off;
 	u_int32_t len;
 {
 #ifdef	_KERNEL
-	struct mbuf *m;
 	int sum;
 
-	m = fin->fin_m;
 	if (m->m_len < sizeof(struct ip6_hdr)) {
 		return 0xffff;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912160238.xBG2cmiG020101>