clean up some stuff; map broadcast addresses to interface values
[unix-history] / usr / src / sys / netinet / ip_output.c
index 1f23c20..6b2565f 100644 (file)
@@ -1,4 +1,4 @@
-/*     ip_output.c     1.39    82/10/17        */
+/*     ip_output.c     1.43    83/01/04        */
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
@@ -92,10 +92,8 @@ gotif:
         * If small enough for interface, can just send directly.
         */
        if (ip->ip_len <= ifp->if_mtu) {
         * If small enough for interface, can just send directly.
         */
        if (ip->ip_len <= ifp->if_mtu) {
-#if vax || pdp11 || ns16032
                ip->ip_len = htons((u_short)ip->ip_len);
                ip->ip_off = htons((u_short)ip->ip_off);
                ip->ip_len = htons((u_short)ip->ip_len);
                ip->ip_off = htons((u_short)ip->ip_off);
-#endif
                ip->ip_sum = 0;
                ip->ip_sum = in_cksum(m, hlen);
                error = (*ifp->if_output)(ifp, m, dst);
                ip->ip_sum = 0;
                ip->ip_sum = in_cksum(m, hlen);
                error = (*ifp->if_output)(ifp, m, dst);
@@ -124,7 +122,7 @@ gotif:
        m->m_len -= sizeof (struct ip);
        m->m_off += sizeof (struct ip);
        for (off = 0; off < ip->ip_len-hlen; off += len) {
        m->m_len -= sizeof (struct ip);
        m->m_off += sizeof (struct ip);
        for (off = 0; off < ip->ip_len-hlen; off += len) {
-               struct mbuf *mh = m_get(M_DONTWAIT);
+               struct mbuf *mh = m_get(M_DONTWAIT, MT_HEADER);
                struct ip *mhip;
 
                if (mh == 0) {
                struct ip *mhip;
 
                if (mh == 0) {
@@ -147,18 +145,14 @@ gotif:
                        mhip->ip_off |= IP_MF;
                }
                mhip->ip_len += sizeof (struct ip);
                        mhip->ip_off |= IP_MF;
                }
                mhip->ip_len += sizeof (struct ip);
-#if vax || pdp11 || ns16032
                mhip->ip_len = htons((u_short)mhip->ip_len);
                mhip->ip_len = htons((u_short)mhip->ip_len);
-#endif
                mh->m_next = m_copy(m, off, len);
                if (mh->m_next == 0) {
                        (void) m_free(mh);
                        error = ENOBUFS;        /* ??? */
                        goto bad;
                }
                mh->m_next = m_copy(m, off, len);
                if (mh->m_next == 0) {
                        (void) m_free(mh);
                        error = ENOBUFS;        /* ??? */
                        goto bad;
                }
-#if vax || pdp11 || ns16032
                mhip->ip_off = htons((u_short)mhip->ip_off);
                mhip->ip_off = htons((u_short)mhip->ip_off);
-#endif
                mhip->ip_sum = 0;
                mhip->ip_sum = in_cksum(mh, hlen);
                if (error = (*ifp->if_output)(ifp, mh, dst))
                mhip->ip_sum = 0;
                mhip->ip_sum = in_cksum(mh, hlen);
                if (error = (*ifp->if_output)(ifp, mh, dst))