Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Dec 2012 14:29:38 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244683 - head/sys/netinet
Message-ID:  <201212251429.qBPETcYh071923@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Dec 25 14:29:38 2012
New Revision: 244683
URL: http://svnweb.freebsd.org/changeset/base/244683

Log:
    Garbage collect carp_cksum().

Modified:
  head/sys/netinet/ip_carp.c

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Tue Dec 25 14:17:09 2012	(r244682)
+++ head/sys/netinet/ip_carp.c	Tue Dec 25 14:29:38 2012	(r244683)
@@ -290,12 +290,6 @@ static struct mtx carp_mtx;
 static struct task carp_sendall_task =
     TASK_INITIALIZER(0, carp_send_ad_all, NULL);
 
-static __inline uint16_t
-carp_cksum(struct mbuf *m, int len)
-{
-	return (in_cksum(m, len));
-}
-
 static void
 carp_hmac_prepare(struct carp_softc *sc)
 {
@@ -478,7 +472,7 @@ carp_input(struct mbuf *m, int hlen)
 
 	/* verify the CARP checksum */
 	m->m_data += iplen;
-	if (carp_cksum(m, len - iplen)) {
+	if (in_cksum(m, len - iplen)) {
 		CARPSTATS_INC(carps_badsum);
 		CARP_DEBUG("%s: checksum failed on %s\n", __func__,
 		    m->m_pkthdr.rcvif->if_xname);
@@ -537,7 +531,7 @@ carp6_input(struct mbuf **mp, int *offp,
 
 	/* verify the CARP checksum */
 	m->m_data += *offp;
-	if (carp_cksum(m, sizeof(*ch))) {
+	if (in_cksum(m, sizeof(*ch))) {
 		CARPSTATS_INC(carps_badsum);
 		CARP_DEBUG("%s: checksum failed, on %s\n", __func__,
 		    m->m_pkthdr.rcvif->if_xname);
@@ -809,7 +803,7 @@ carp_send_ad_locked(struct carp_softc *s
 			goto resched;
 
 		m->m_data += sizeof(*ip);
-		ch_ptr->carp_cksum = carp_cksum(m, len - sizeof(*ip));
+		ch_ptr->carp_cksum = in_cksum(m, len - sizeof(*ip));
 		m->m_data -= sizeof(*ip);
 
 		CARPSTATS_INC(carps_opackets);
@@ -882,7 +876,7 @@ carp_send_ad_locked(struct carp_softc *s
 			goto resched;
 
 		m->m_data += sizeof(*ip6);
-		ch_ptr->carp_cksum = carp_cksum(m, len - sizeof(*ip6));
+		ch_ptr->carp_cksum = in_cksum(m, len - sizeof(*ip6));
 		m->m_data -= sizeof(*ip6);
 
 		CARPSTATS_INC(carps_opackets6);



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