Date: Fri, 15 Mar 2013 12:55:31 +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: r248324 - in head/sys: compat/ndis net netinet netpfil/pf Message-ID: <201303151255.r2FCtVea016460@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Fri Mar 15 12:55:30 2013 New Revision: 248324 URL: http://svnweb.freebsd.org/changeset/base/248324 Log: Use m_get/m_gethdr instead of compat macros. Sponsored by: Nginx, Inc. Modified: head/sys/compat/ndis/kern_ndis.c head/sys/net/bridgestp.c head/sys/net/if_gre.c head/sys/netinet/ip_carp.c head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_options.c head/sys/netinet/ip_output.c head/sys/netinet/tcp_subr.c head/sys/netpfil/pf/pf.c Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/compat/ndis/kern_ndis.c Fri Mar 15 12:55:30 2013 (r248324) @@ -656,13 +656,9 @@ ndis_ptom(m0, p) for (buf = priv->npp_head; buf != NULL; buf = buf->mdl_next) { if (buf == priv->npp_head) -#ifdef MT_HEADER - MGETHDR(m, M_NOWAIT, MT_HEADER); -#else - MGETHDR(m, M_NOWAIT, MT_DATA); -#endif + m = m_gethdr(M_NOWAIT, MT_DATA); else - MGET(m, M_NOWAIT, MT_DATA); + m = m_get(M_NOWAIT, MT_DATA); if (m == NULL) { m_freem(*m0); *m0 = NULL; Modified: head/sys/net/bridgestp.c ============================================================================== --- head/sys/net/bridgestp.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/net/bridgestp.c Fri Mar 15 12:55:30 2013 (r248324) @@ -234,7 +234,7 @@ bstp_transmit_tcn(struct bstp_state *bs, if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - MGETHDR(m, M_NOWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return; @@ -348,7 +348,7 @@ bstp_send_bpdu(struct bstp_state *bs, st if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - MGETHDR(m, M_NOWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) return; Modified: head/sys/net/if_gre.c ============================================================================== --- head/sys/net/if_gre.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/net/if_gre.c Fri Mar 15 12:55:30 2013 (r248324) @@ -384,8 +384,7 @@ gre_output(struct ifnet *ifp, struct mbu mob_h.hcrc = gre_in_cksum((u_int16_t *)&mob_h, msiz); if ((m->m_data - msiz) < m->m_pktdat) { - /* need new mbuf */ - MGETHDR(m0, M_NOWAIT, MT_DATA); + m0 = m_gethdr(M_NOWAIT, MT_DATA); if (m0 == NULL) { _IF_DROP(&ifp->if_snd); m_freem(m); Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/netinet/ip_carp.c Fri Mar 15 12:55:30 2013 (r248324) @@ -764,7 +764,7 @@ carp_send_ad_locked(struct carp_softc *s if (sc->sc_naddrs) { struct ip *ip; - MGETHDR(m, M_NOWAIT, MT_HEADER); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { CARPSTATS_INC(carps_onomem); goto resched; @@ -832,7 +832,7 @@ carp_send_ad_locked(struct carp_softc *s if (sc->sc_naddrs6) { struct ip6_hdr *ip6; - MGETHDR(m, M_NOWAIT, MT_HEADER); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { CARPSTATS_INC(carps_onomem); goto resched; Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/netinet/ip_input.c Fri Mar 15 12:55:30 2013 (r248324) @@ -1406,7 +1406,7 @@ ip_forward(struct mbuf *m, int srcrt) * assume exclusive access to the IP header in `m', so any * data in a cluster may change before we reach icmp_error(). */ - MGETHDR(mcopy, M_NOWAIT, m->m_type); + mcopy = m_gethdr(M_NOWAIT, m->m_type); if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) { /* * It's probably ok if the pkthdr dup fails (because Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/netinet/ip_mroute.c Fri Mar 15 12:55:30 2013 (r248324) @@ -2083,13 +2083,12 @@ bw_upcalls_send(void) * Allocate a new mbuf, initialize it with the header and * the payload for the pending calls. */ - MGETHDR(m, M_NOWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { log(LOG_WARNING, "bw_upcalls_send: cannot allocate mbuf\n"); return; } - m->m_len = m->m_pkthdr.len = 0; m_copyback(m, 0, sizeof(struct igmpmsg), (caddr_t)&igmpmsg); m_copyback(m, sizeof(struct igmpmsg), len, (caddr_t)&V_bw_upcalls[0]); @@ -2430,7 +2429,7 @@ pim_register_send_upcall(struct ip *ip, /* * Add a new mbuf with an upcall header */ - MGETHDR(mb_first, M_NOWAIT, MT_DATA); + mb_first = m_gethdr(M_NOWAIT, MT_DATA); if (mb_first == NULL) { m_freem(mb_copy); return ENOBUFS; @@ -2488,7 +2487,7 @@ pim_register_send_rp(struct ip *ip, stru /* * Add a new mbuf with the encapsulating header */ - MGETHDR(mb_first, M_NOWAIT, MT_DATA); + mb_first = m_gethdr(M_NOWAIT, MT_DATA); if (mb_first == NULL) { m_freem(mb_copy); return ENOBUFS; Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/netinet/ip_options.c Fri Mar 15 12:55:30 2013 (r248324) @@ -495,7 +495,7 @@ ip_insertoptions(struct mbuf *m, struct if (p->ipopt_dst.s_addr) ip->ip_dst = p->ipopt_dst; if (m->m_flags & M_EXT || m->m_data - optlen < m->m_pktdat) { - MGETHDR(n, M_NOWAIT, MT_DATA); + n = m_gethdr(M_NOWAIT, MT_DATA); if (n == NULL) { *phlen = 0; return (m); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/netinet/ip_output.c Fri Mar 15 12:55:30 2013 (r248324) @@ -784,7 +784,7 @@ smart_frag_failure: struct mbuf *m; int mhlen = sizeof (struct ip); - MGETHDR(m, M_NOWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; IPSTAT_INC(ips_odropped); @@ -951,7 +951,7 @@ ip_ctloutput(struct socket *so, struct s error = EMSGSIZE; break; } - MGET(m, sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA); + m = m_get(sopt->sopt_td ? M_WAITOK : M_NOWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; break; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/netinet/tcp_subr.c Fri Mar 15 12:55:30 2013 (r248324) @@ -1860,7 +1860,7 @@ ipsec_hdrsiz_tcp(struct tcpcb *tp) if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL)) return (0); - MGETHDR(m, M_NOWAIT, MT_DATA); + m = m_gethdr(M_NOWAIT, MT_DATA); if (!m) return (0); Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Mar 15 12:53:53 2013 (r248323) +++ head/sys/netpfil/pf/pf.c Fri Mar 15 12:55:30 2013 (r248324) @@ -2168,7 +2168,7 @@ pf_send_tcp(struct mbuf *replyto, const pfse = malloc(sizeof(*pfse), M_PFTEMP, M_NOWAIT); if (pfse == NULL) return; - m = m_gethdr(M_NOWAIT, MT_HEADER); + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { free(pfse, M_PFTEMP); return;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303151255.r2FCtVea016460>