don't generate icmp message without a copy of the original ip
[unix-history] / usr / src / sys / netinet / raw_ip.c
index e7f442f..24ed7a4 100644 (file)
@@ -1,18 +1,20 @@
-/*     raw_ip.c        4.12    82/06/12        */
+/*     raw_ip.c        4.17    83/02/10        */
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
 #include "../h/socket.h"
 #include "../h/protosw.h"
 #include "../h/socketvar.h"
 
 #include "../h/param.h"
 #include "../h/mbuf.h"
 #include "../h/socket.h"
 #include "../h/protosw.h"
 #include "../h/socketvar.h"
+#include "../h/errno.h"
+
 #include "../net/if.h"
 #include "../net/if.h"
-#include "../net/in.h"
-#include "../net/in_systm.h"
-#include "../net/ip.h"
-#include "../net/ip_var.h"
 #include "../net/raw_cb.h"
 #include "../net/route.h"
 #include "../net/raw_cb.h"
 #include "../net/route.h"
-#include <errno.h>
+
+#include "../netinet/in.h"
+#include "../netinet/in_systm.h"
+#include "../netinet/ip.h"
+#include "../netinet/ip_var.h"
 
 /*
  * Raw interface to IP protocol.
 
 /*
  * Raw interface to IP protocol.
@@ -31,7 +33,6 @@ rip_input(m)
 {
        register struct ip *ip = mtod(m, struct ip *);
 
 {
        register struct ip *ip = mtod(m, struct ip *);
 
-COUNT(RIP_INPUT);
        ripproto.sp_protocol = ip->ip_p;
        ripdst.sin_addr = ip->ip_dst;
        ripsrc.sin_addr = ip->ip_src;
        ripproto.sp_protocol = ip->ip_p;
        ripdst.sin_addr = ip->ip_dst;
        ripsrc.sin_addr = ip->ip_src;
@@ -51,17 +52,15 @@ rip_output(m0, so)
        register struct ip *ip;
        int len = 0, error;
        struct rawcb *rp = sotorawcb(so);
        register struct ip *ip;
        int len = 0, error;
        struct rawcb *rp = sotorawcb(so);
-       struct ifnet *ifp;
        struct sockaddr_in *sin;
 
        struct sockaddr_in *sin;
 
-COUNT(RIP_OUTPUT);
        /*
         * Calculate data length and get an mbuf
         * for IP header.
         */
        for (m = m0; m; m = m->m_next)
                len += m->m_len;
        /*
         * Calculate data length and get an mbuf
         * for IP header.
         */
        for (m = m0; m; m = m->m_next)
                len += m->m_len;
-       m = m_get(M_DONTWAIT);
+       m = m_get(M_DONTWAIT, MT_HEADER);
        if (m == 0) {
                error = ENOBUFS;
                goto bad;
        if (m == 0) {
                error = ENOBUFS;
                goto bad;