From cf874b345d0f766fb64cf4737e1c85ccc78d2bee Mon Sep 17 00:00:00 2001 From: imp Date: Wed, 19 Feb 2003 05:47:46 +0000 Subject: Back out M_* changes, per decision of the TRB. Approved by: trb --- sys/netinet/if_ether.c | 2 +- sys/netinet/igmp.c | 4 ++-- sys/netinet/in.c | 4 ++-- sys/netinet/in_gif.c | 2 +- sys/netinet/in_pcb.c | 2 +- sys/netinet/ip_divert.c | 2 +- sys/netinet/ip_encap.c | 2 +- sys/netinet/ip_fw.c | 4 ++-- sys/netinet/ip_fw2.c | 4 ++-- sys/netinet/ip_icmp.c | 4 ++-- sys/netinet/ip_input.c | 10 +++++----- sys/netinet/ip_mroute.c | 2 +- sys/netinet/ip_output.c | 10 +++++----- sys/netinet/raw_ip.c | 4 ++-- sys/netinet/tcp_output.c | 6 +++--- sys/netinet/tcp_subr.c | 8 ++++---- sys/netinet/tcp_syncache.c | 4 ++-- sys/netinet/tcp_timewait.c | 8 ++++---- sys/netinet/udp_usrreq.c | 4 ++-- 19 files changed, 43 insertions(+), 43 deletions(-) (limited to 'sys/netinet') diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 4a4d91f..c463bf9 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -309,7 +309,7 @@ arprequest(ifp, sip, tip, enaddr) LLC_UI, 0x00, 0x00, 0x00, 0x08, 0x06 }; u_short ar_hrd; - if ((m = m_gethdr(M_NOWAIT, MT_DATA)) == NULL) + if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) return; m->m_pkthdr.rcvif = (struct ifnet *)0; #ifdef MAC diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index bc5fe11..929d456 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -108,7 +108,7 @@ igmp_init() /* * Construct a Router Alert option to use in outgoing packets */ - MGET(router_alert, M_NOWAIT, MT_DATA); + MGET(router_alert, M_DONTWAIT, MT_DATA); ra = mtod(router_alert, struct ipoption *); ra->ipopt_dst.s_addr = 0; ra->ipopt_list[0] = IPOPT_RA; /* Router Alert Option */ @@ -445,7 +445,7 @@ igmp_sendpkt(inm, type, addr) struct ip *ip; struct ip_moptions imo; - MGETHDR(m, M_NOWAIT, MT_HEADER); + MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == NULL) return; diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 5610491..89c4123 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -268,7 +268,7 @@ in_control(so, cmd, data, ifp, td) return (EADDRNOTAVAIL); if (ia == (struct in_ifaddr *)0) { ia = (struct in_ifaddr *) - malloc(sizeof *ia, M_IFADDR, M_ZERO); + malloc(sizeof *ia, M_IFADDR, M_WAITOK | M_ZERO); if (ia == (struct in_ifaddr *)NULL) return (ENOBUFS); /* @@ -837,7 +837,7 @@ in_addmulti(ap, ifp) return ifma->ifma_protospec; } - /* XXX - if_addmulti does not use N_NOWAIT. Can this really be called + /* XXX - if_addmulti uses M_WAITOK. Can this really be called at interrupt time? If so, need to fix if_addmulti. XXX */ inm = (struct in_multi *)malloc(sizeof(*inm), M_IPMADDR, M_NOWAIT | M_ZERO); diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index 3e996d7..cdf094a 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -167,7 +167,7 @@ in_gif_output(ifp, family, m) ip_ecn_ingress(ECN_NOCARE, &iphdr.ip_tos, &tos); /* prepend new IP header */ - M_PREPEND(m, sizeof(struct ip), M_NOWAIT); + M_PREPEND(m, sizeof(struct ip), M_DONTWAIT); if (m && m->m_len < sizeof(struct ip)) m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index b0a66c6..7f83917 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -660,7 +660,7 @@ in_sockaddr(port, addr_p) struct sockaddr_in *sin; MALLOC(sin, struct sockaddr_in *, sizeof *sin, M_SONAME, - M_ZERO); + M_WAITOK | M_ZERO); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); sin->sin_addr = *addr_p; diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index bd8ea4d..162d7f7 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -489,7 +489,7 @@ div_pcblist(SYSCTL_HANDLER_ARGS) if (error) return error; - inp_list = malloc(n * sizeof *inp_list, M_TEMP, 0); + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); if (inp_list == 0) return ENOMEM; diff --git a/sys/netinet/ip_encap.c b/sys/netinet/ip_encap.c index a547c66..478cdfa 100644 --- a/sys/netinet/ip_encap.c +++ b/sys/netinet/ip_encap.c @@ -487,7 +487,7 @@ encap_fillarg(m, ep) { struct m_tag *tag; - tag = m_tag_get(PACKET_TAG_ENCAP, sizeof (void*), M_NOWAIT); + tag = m_tag_get(PACKET_TAG_ENCAP, sizeof (void*), M_DONTWAIT); if (tag) { *(void**)(tag+1) = ep->arg; m_tag_prepend(m, tag); diff --git a/sys/netinet/ip_fw.c b/sys/netinet/ip_fw.c index b532766..26f4a04 100644 --- a/sys/netinet/ip_fw.c +++ b/sys/netinet/ip_fw.c @@ -875,7 +875,7 @@ add_dyn_rule(struct ipfw_flow_id *id, u_int8_t dyn_type, struct ip_fw *rule) if (ipfw_dyn_v != NULL) free(ipfw_dyn_v, M_IPFW); ipfw_dyn_v = malloc(curr_dyn_buckets * sizeof r, - M_IPFW, M_NOWAIT | M_ZERO); + M_IPFW, M_DONTWAIT | M_ZERO); if (ipfw_dyn_v == NULL) return NULL; /* failed ! */ } @@ -2036,7 +2036,7 @@ ip_fw_ctl(struct sockopt *sopt) * bother filling up the buffer, just jump to the * sooptcopyout. */ - buf = malloc(size, M_TEMP, 0); + buf = malloc(size, M_TEMP, M_WAITOK); if (buf == 0) { splx(s); error = ENOBUFS; diff --git a/sys/netinet/ip_fw2.c b/sys/netinet/ip_fw2.c index e35078f..eabcd67 100644 --- a/sys/netinet/ip_fw2.c +++ b/sys/netinet/ip_fw2.c @@ -1057,7 +1057,7 @@ send_pkt(struct ipfw_flow_id *id, u_int32_t seq, u_int32_t ack, int flags) struct tcphdr *tcp; struct route sro; /* fake route */ - MGETHDR(m, M_NOWAIT, MT_HEADER); + MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == 0) return; m->m_pkthdr.rcvif = (struct ifnet *)0; @@ -2498,7 +2498,7 @@ ipfw_ctl(struct sockopt *sopt) * how much room is needed, do not bother filling up the * buffer, just jump to the sooptcopyout. */ - buf = malloc(size, M_TEMP, 0); + buf = malloc(size, M_TEMP, M_WAITOK); if (buf == 0) { splx(s); error = ENOBUFS; diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index a83dcba..a15ece2 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -163,7 +163,7 @@ icmp_error(n, type, code, dest, destifp) /* * First, formulate icmp message */ - m = m_gethdr(M_NOWAIT, MT_HEADER); + m = m_gethdr(M_DONTWAIT, MT_HEADER); if (m == NULL) goto freeit; #ifdef MAC @@ -656,7 +656,7 @@ match: */ cp = (u_char *) (ip + 1); if ((opts = ip_srcroute()) == 0 && - (opts = m_gethdr(M_NOWAIT, MT_HEADER))) { + (opts = m_gethdr(M_DONTWAIT, MT_HEADER))) { opts->m_len = sizeof(struct in_addr); mtod(opts, struct in_addr *)->s_addr = 0; } diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 1965b02..3e1f8a5 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -834,7 +834,7 @@ found: /* Clone packet if we're doing a 'tee' */ if ((divert_info & IP_FW_PORT_TEE_FLAG) != 0) - clone = m_dup(m, M_NOWAIT); + clone = m_dup(m, M_DONTWAIT); /* Restore packet header fields to original values */ ip->ip_len += hlen; @@ -985,7 +985,7 @@ ip_reass(struct mbuf *m, struct ipqhead *head, struct ipq *fp, * If first fragment to arrive, create a reassembly queue. */ if (fp == 0) { - if ((t = m_get(M_NOWAIT, MT_FTABLE)) == NULL) + if ((t = m_get(M_DONTWAIT, MT_FTABLE)) == NULL) goto dropfrag; fp = mtod(t, struct ipq *); #ifdef MAC @@ -1587,7 +1587,7 @@ ip_srcroute() if (ip_nhops == 0) return ((struct mbuf *)0); - m = m_get(M_NOWAIT, MT_HEADER); + m = m_get(M_DONTWAIT, MT_HEADER); if (m == 0) return ((struct mbuf *)0); @@ -1762,8 +1762,8 @@ ip_forward(struct mbuf *m, int srcrt, struct sockaddr_in *next_hop) * assume exclusive access to the IP header in `m', so any * data in a cluster may change before we reach icmp_error(). */ - MGET(mcopy, M_NOWAIT, m->m_type); - if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_NOWAIT)) { + MGET(mcopy, M_DONTWAIT, m->m_type); + if (mcopy != NULL && !m_dup_pkthdr(mcopy, m, M_DONTWAIT)) { /* * It's probably ok if the pkthdr dup fails (because * the deep copy of the tag chain failed), but for now diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index d48ae3e..3caba6b 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1403,7 +1403,7 @@ encap_send(struct ip *ip, struct vif *vifp, struct mbuf *m) * new mbuf so we can modify it. Try to fill the new * mbuf since if we don't the ethernet driver will. */ - MGETHDR(mb_copy, M_NOWAIT, MT_HEADER); + MGETHDR(mb_copy, M_DONTWAIT, MT_HEADER); if (mb_copy == NULL) return; #ifdef MAC diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index f61f61d..64e58e2 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -802,7 +802,7 @@ spd_done: /* Clone packet if we're doing a 'tee' */ if ((off & IP_FW_PORT_TEE_FLAG) != 0) - clone = m_dup(m, M_NOWAIT); + clone = m_dup(m, M_DONTWAIT); /* * XXX @@ -1108,7 +1108,7 @@ smart_frag_failure: m0 = m; mhlen = sizeof (struct ip); for (; off < (u_short)ip->ip_len; off += len) { - MGETHDR(m, M_NOWAIT, MT_HEADER); + MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == 0) { error = ENOBUFS; ipstat.ips_odropped++; @@ -1274,7 +1274,7 @@ ip_insertoptions(m, opt, phlen) 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_HEADER); + MGETHDR(n, M_DONTWAIT, MT_HEADER); if (n == 0) { *phlen = 0; return (m); @@ -1379,7 +1379,7 @@ ip_ctloutput(so, sopt) error = EMSGSIZE; break; } - MGET(m, sopt->sopt_td ? 0 : M_NOWAIT, MT_HEADER); + MGET(m, sopt->sopt_td ? M_TRYWAIT : M_DONTWAIT, MT_HEADER); if (m == 0) { error = ENOBUFS; break; @@ -1773,7 +1773,7 @@ ip_setmoptions(sopt, imop) * allocate one and initialize to default values. */ imo = (struct ip_moptions*)malloc(sizeof(*imo), M_IPMOPTS, - 0); + M_WAITOK); if (imo == NULL) return (ENOBUFS); diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index 8a90be0..e4e4eb2 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -287,7 +287,7 @@ rip_output(m, so, dst) m_freem(m); return(EMSGSIZE); } - M_PREPEND(m, sizeof(struct ip), 0); + M_PREPEND(m, sizeof(struct ip), M_TRYWAIT); ip = mtod(m, struct ip *); ip->ip_tos = inp->inp_ip_tos; ip->ip_off = 0; @@ -698,7 +698,7 @@ rip_pcblist(SYSCTL_HANDLER_ARGS) if (error) return error; - inp_list = malloc(n * sizeof *inp_list, M_TEMP, 0); + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); if (inp_list == 0) return ENOMEM; diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 2e926d1..34b0d84 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -603,14 +603,14 @@ send: m->m_len += hdrlen; m->m_data -= hdrlen; #else - MGETHDR(m, M_NOWAIT, MT_HEADER); + MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == NULL) { error = ENOBUFS; goto out; } #ifdef INET6 if (MHLEN < hdrlen + max_linkhdr) { - MCLGET(m, M_NOWAIT); + MCLGET(m, M_DONTWAIT); if ((m->m_flags & M_EXT) == 0) { m_freem(m); error = ENOBUFS; @@ -651,7 +651,7 @@ send: else tcpstat.tcps_sndwinup++; - MGETHDR(m, M_NOWAIT, MT_HEADER); + MGETHDR(m, M_DONTWAIT, MT_HEADER); if (m == NULL) { error = ENOBUFS; goto out; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index d12c899..844f279 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -332,7 +332,7 @@ tcp_maketemplate(tp) struct mbuf *m; struct tcptemp *n; - m = m_get(M_NOWAIT, MT_HEADER); + m = m_get(M_DONTWAIT, MT_HEADER); if (m == NULL) return (0); m->m_len = sizeof(struct tcptemp); @@ -412,7 +412,7 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) } } if (m == 0) { - m = m_gethdr(M_NOWAIT, MT_HEADER); + m = m_gethdr(M_DONTWAIT, MT_HEADER); if (m == NULL) return; tlen = 0; @@ -901,7 +901,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error) return error; - inp_list = malloc(n * sizeof *inp_list, M_TEMP, 0); + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); if (inp_list == 0) return ENOMEM; @@ -1495,7 +1495,7 @@ ipsec_hdrsiz_tcp(tp) if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL)) return 0; - MGETHDR(m, M_NOWAIT, MT_DATA); + MGETHDR(m, M_DONTWAIT, MT_DATA); if (!m) return 0; diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index daf6d89..a8b031b 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -247,7 +247,7 @@ syncache_init(void) /* Allocate the hash table. */ MALLOC(tcp_syncache.hashbase, struct syncache_head *, tcp_syncache.hashsize * sizeof(struct syncache_head), - M_SYNCACHE, 0); + M_SYNCACHE, M_WAITOK); /* Initialize the hash buckets. */ for (i = 0; i < tcp_syncache.hashsize; i++) { @@ -1099,7 +1099,7 @@ syncache_respond(sc, m) if (m) m_freem(m); - m = m_gethdr(M_NOWAIT, MT_HEADER); + m = m_gethdr(M_DONTWAIT, MT_HEADER); if (m == NULL) return (ENOBUFS); m->m_data += max_linkhdr; diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index d12c899..844f279 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -332,7 +332,7 @@ tcp_maketemplate(tp) struct mbuf *m; struct tcptemp *n; - m = m_get(M_NOWAIT, MT_HEADER); + m = m_get(M_DONTWAIT, MT_HEADER); if (m == NULL) return (0); m->m_len = sizeof(struct tcptemp); @@ -412,7 +412,7 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) } } if (m == 0) { - m = m_gethdr(M_NOWAIT, MT_HEADER); + m = m_gethdr(M_DONTWAIT, MT_HEADER); if (m == NULL) return; tlen = 0; @@ -901,7 +901,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) if (error) return error; - inp_list = malloc(n * sizeof *inp_list, M_TEMP, 0); + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); if (inp_list == 0) return ENOMEM; @@ -1495,7 +1495,7 @@ ipsec_hdrsiz_tcp(tp) if ((tp == NULL) || ((inp = tp->t_inpcb) == NULL)) return 0; - MGETHDR(m, M_NOWAIT, MT_DATA); + MGETHDR(m, M_DONTWAIT, MT_DATA); if (!m) return 0; diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 7d2a9f3..7c1d8d9 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -585,7 +585,7 @@ udp_pcblist(SYSCTL_HANDLER_ARGS) if (error) return error; - inp_list = malloc(n * sizeof *inp_list, M_TEMP, 0); + inp_list = malloc(n * sizeof *inp_list, M_TEMP, M_WAITOK); if (inp_list == 0) return ENOMEM; @@ -802,7 +802,7 @@ udp_output(inp, m, addr, control, td) * Calculate data length and get a mbuf * for UDP and IP headers. */ - M_PREPEND(m, sizeof(struct udpiphdr), M_NOWAIT); + M_PREPEND(m, sizeof(struct udpiphdr), M_DONTWAIT); if (m == 0) { error = ENOBUFS; goto release; -- cgit v1.1