lint
[unix-history] / usr / src / sys / netinet / ip_output.c
index 887de1d..ee21021 100644 (file)
@@ -1,15 +1,15 @@
-/*     ip_output.c     1.33    82/06/12        */
+/*     ip_output.c     1.40    82/10/20        */
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
-#include "../h/mtpr.h"
+#include "../vax/mtpr.h"
 #include "../h/socket.h"
 #include "../h/socketvar.h"
 #include "../h/socket.h"
 #include "../h/socketvar.h"
-#include "../net/in.h"
-#include "../net/in_systm.h"
+#include "../netinet/in.h"
+#include "../netinet/in_systm.h"
 #include "../net/if.h"
 #include "../net/if.h"
-#include "../net/ip.h"
-#include "../net/ip_var.h"
+#include "../netinet/ip.h"
+#include "../netinet/ip_var.h"
 #include "../net/route.h"
 #include <errno.h>
 
 #include "../net/route.h"
 #include <errno.h>
 
@@ -27,7 +27,6 @@ ip_output(m, opt, ro, allowbroadcast)
        struct route iproute;
        struct sockaddr *dst;
 
        struct route iproute;
        struct sockaddr *dst;
 
-COUNT(IP_OUTPUT);
        if (opt)                                /* XXX */
                (void) m_free(opt);             /* XXX */
        /*
        if (opt)                                /* XXX */
                (void) m_free(opt);             /* XXX */
        /*
@@ -54,7 +53,7 @@ COUNT(IP_OUTPUT);
                 */
                if (ro == &routetoif) {
                        /* check ifp is AF_INET??? */
                 */
                if (ro == &routetoif) {
                        /* check ifp is AF_INET??? */
-                       ifp = if_ifonnetof(ip->ip_dst.s_net);
+                       ifp = if_ifonnetof(in_netof(ip->ip_dst));
                        if (ifp == 0)
                                goto unreachable;
                        goto gotif;
                        if (ifp == 0)
                                goto unreachable;
                        goto gotif;
@@ -93,7 +92,7 @@ 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
+#if vax || pdp11 || ns16032
                ip->ip_len = htons((u_short)ip->ip_len);
                ip->ip_off = htons((u_short)ip->ip_off);
 #endif
                ip->ip_len = htons((u_short)ip->ip_len);
                ip->ip_off = htons((u_short)ip->ip_off);
 #endif
@@ -148,7 +147,7 @@ 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
+#if vax || pdp11 || ns16032
                mhip->ip_len = htons((u_short)mhip->ip_len);
 #endif
                mh->m_next = m_copy(m, off, len);
                mhip->ip_len = htons((u_short)mhip->ip_len);
 #endif
                mh->m_next = m_copy(m, off, len);
@@ -157,7 +156,7 @@ gotif:
                        error = ENOBUFS;        /* ??? */
                        goto bad;
                }
                        error = ENOBUFS;        /* ??? */
                        goto bad;
                }
-#if vax
+#if vax || pdp11 || ns16032
                mhip->ip_off = htons((u_short)mhip->ip_off);
 #endif
                mhip->ip_sum = 0;
                mhip->ip_off = htons((u_short)mhip->ip_off);
 #endif
                mhip->ip_sum = 0;
@@ -193,7 +192,6 @@ ip_optcopy(ip, jp, off)
        register u_char *cp, *dp;
        int opt, optlen, cnt;
 
        register u_char *cp, *dp;
        int opt, optlen, cnt;
 
-COUNT(IP_OPTCOPY);
        cp = (u_char *)(ip + 1);
        dp = (u_char *)(jp + 1);
        cnt = (ip->ip_hl << 2) - sizeof (struct ip);
        cp = (u_char *)(ip + 1);
        dp = (u_char *)(jp + 1);
        cnt = (ip->ip_hl << 2) - sizeof (struct ip);