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. MFC after: 3 days
This commit is contained in:
parent
55cab13b31
commit
2716484cbc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355670
@ -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;
|
||||
}
|
||||
|
@ -1840,7 +1840,7 @@ extern int ipf_matchicmpqueryreply __P((int, icmpinfo_t *,
|
||||
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 *));
|
||||
|
@ -1456,17 +1456,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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user