aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2015-01-05 09:58:32 +0000
committerRobert Watson <rwatson@FreeBSD.org>2015-01-05 09:58:32 +0000
commited6a66ca6c2065bc1fed93e00805676a5d3b981e (patch)
tree6f98bf414ddd5e9772757ca1f6016f218ead95f8 /sys/netinet/ip_carp.c
parentcd470fead8828603c75aaa68a28a90df541c13c2 (diff)
downloadsrc-ed6a66ca6c2065bc1fed93e00805676a5d3b981e.tar.gz
src-ed6a66ca6c2065bc1fed93e00805676a5d3b981e.zip
To ease changes to underlying mbuf structure and the mbuf allocator, reduce
the knowledge of mbuf layout, and in particular constants such as M_EXT, MLEN, MHLEN, and so on, in mbuf consumers by unifying various alignment utility functions (M_ALIGN(), MH_ALIGN(), MEXT_ALIGN() in a single M_ALIGN() macro, implemented by a now-inlined m_align() function: - Move m_align() from uipc_mbuf.c to mbuf.h; mark as __inline. - Reimplement M_ALIGN(), MH_ALIGN(), and MEXT_ALIGN() using m_align(). - Update consumers around the tree to simply use M_ALIGN(). This change eliminates a number of cases where mbuf consumers must be aware of whether or not mbufs returned by the allocator use external storage, but also assumptions about the size of the returned mbuf. This will make it easier to introduce changes in how we use external storage, as well as features such as variable-size mbufs. Differential Revision: https://reviews.freebsd.org/D1436 Reviewed by: glebius, trasz, gnn, bz Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=276692
Diffstat (limited to 'sys/netinet/ip_carp.c')
-rw-r--r--sys/netinet/ip_carp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index 72087646edad..97862733bc79 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -840,7 +840,7 @@ carp_send_ad_locked(struct carp_softc *sc)
m->m_pkthdr.len = len;
m->m_pkthdr.rcvif = NULL;
m->m_len = len;
- MH_ALIGN(m, m->m_len);
+ M_ALIGN(m, m->m_len);
m->m_flags |= M_MCAST;
ip = mtod(m, struct ip *);
ip->ip_v = IPVERSION;
@@ -892,7 +892,7 @@ carp_send_ad_locked(struct carp_softc *sc)
m->m_pkthdr.len = len;
m->m_pkthdr.rcvif = NULL;
m->m_len = len;
- MH_ALIGN(m, m->m_len);
+ M_ALIGN(m, m->m_len);
m->m_flags |= M_MCAST;
ip6 = mtod(m, struct ip6_hdr *);
bzero(ip6, sizeof(*ip6));