Date: Wed, 30 May 2012 13:51:00 +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: r236310 - head/sys/netinet Message-ID: <201205301351.q4UDp0wZ055460@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Wed May 30 13:51:00 2012 New Revision: 236310 URL: http://svn.freebsd.org/changeset/base/236310 Log: Improve style(9) of bcopy() to and from mbuf tag. Submitted by: bde Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed May 30 13:44:42 2012 (r236309) +++ head/sys/netinet/ip_carp.c Wed May 30 13:51:00 2012 (r236310) @@ -696,7 +696,7 @@ carp_prepare_ad(struct mbuf *m, struct c CARPSTATS_INC(carps_onomem); return (ENOMEM); } - bcopy(&sc, (caddr_t)(mtag + 1), sizeof(struct carp_softc *)); + bcopy(&sc, mtag + 1, sizeof(sc)); m_tag_prepend(m, mtag); return (0); @@ -1066,8 +1066,7 @@ carp_macmatch6(struct ifnet *ifp, struct /* Better a bit than nothing. */ return (LLADDR(&sc->sc_addr)); - bcopy(&sc, (caddr_t)(mtag + 1), - sizeof(struct carp_softc *)); + bcopy(&sc, mtag + 1, sizeof(sc)); m_tag_prepend(m, mtag); return (LLADDR(&sc->sc_addr)); @@ -1391,7 +1390,7 @@ carp_output(struct ifnet *ifp, struct mb if (mtag == NULL) return (0); - bcopy(mtag + 1, &sc, sizeof(struct carp_softc *)); + bcopy(mtag + 1, &sc, sizeof(sc)); /* Set the source MAC address to the Virtual Router MAC Address. */ switch (ifp->if_type) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205301351.q4UDp0wZ055460>