mark state of working kernel before var. length sockaddrs
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Thu, 13 Oct 1988 06:41:20 +0000 (22:41 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Thu, 13 Oct 1988 06:41:20 +0000 (22:41 -0800)
SCCS-vsn: sys/net/route.c 7.5
SCCS-vsn: sys/net/if_loop.c 7.5
SCCS-vsn: sys/net/if.h 7.4
SCCS-vsn: sys/net/if_sl.c 7.10
SCCS-vsn: sys/net/if_ethersubr.c 7.1

usr/src/sys/net/if.h
usr/src/sys/net/if_ethersubr.c
usr/src/sys/net/if_loop.c
usr/src/sys/net/if_sl.c
usr/src/sys/net/route.c

index 2cda3ce..19e5b6f 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)if.h        7.3 (Berkeley) %G%
+ *     @(#)if.h        7.4 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -64,7 +64,9 @@ struct ifnet {
        } if_snd;                       /* output queue */
 /* procedure handles */
        int     (*if_init)();           /* init routine */
        } if_snd;                       /* output queue */
 /* procedure handles */
        int     (*if_init)();           /* init routine */
-       int     (*if_output)();         /* output routine */
+       int     (*if_output)();         /* output routine (enqueue) */
+       int     (*if_start)();          /* initiate output routine */
+       int     (*if_done)();           /* output complete routine */
        int     (*if_ioctl)();          /* ioctl routine */
        int     (*if_reset)();          /* bus reset routine */
        int     (*if_watchdog)();       /* timer routine */
        int     (*if_ioctl)();          /* ioctl routine */
        int     (*if_reset)();          /* bus reset routine */
        int     (*if_watchdog)();       /* timer routine */
@@ -89,8 +91,11 @@ struct ifnet {
 /* next two not supported now, but reserved: */
 #define        IFF_PROMISC     0x100           /* receive all packets */
 #define        IFF_ALLMULTI    0x200           /* receive all multicast packets */
 /* next two not supported now, but reserved: */
 #define        IFF_PROMISC     0x100           /* receive all packets */
 #define        IFF_ALLMULTI    0x200           /* receive all multicast packets */
+#define        IFF_OACTIVE     0x400           /* transmission in progress */
+#define        IFF_SIMPLEX     0x800           /* can't hear own transmissions */
+
 /* flags set internally only: */
 /* flags set internally only: */
-#define        IFF_CANTCHANGE  (IFF_BROADCAST | IFF_POINTOPOINT | IFF_RUNNING)
+#define        IFF_CANTCHANGE  (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE)
 
 /*
  * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
 
 /*
  * Output queues (ifp->if_snd) and internetwork datagram level (pup level 1)
@@ -116,32 +121,6 @@ struct ifnet {
        (ifq)->ifq_head = (m); \
        (ifq)->ifq_len++; \
 }
        (ifq)->ifq_head = (m); \
        (ifq)->ifq_len++; \
 }
-/*
- * Packets destined for level-1 protocol input routines
- * have a pointer to the receiving interface prepended to the data.
- * IF_DEQUEUEIF extracts and returns this pointer when dequeueing the packet.
- * IF_ADJ should be used otherwise to adjust for its presence.
- */
-#define        IF_ADJ(m) { \
-       (m)->m_off += sizeof(struct ifnet *); \
-       (m)->m_len -= sizeof(struct ifnet *); \
-       if ((m)->m_len == 0) { \
-               struct mbuf *n; \
-               MFREE((m), n); \
-               (m) = n; \
-       } \
-}
-#define        IF_DEQUEUEIF(ifq, m, ifp) { \
-       (m) = (ifq)->ifq_head; \
-       if (m) { \
-               if (((ifq)->ifq_head = (m)->m_act) == 0) \
-                       (ifq)->ifq_tail = 0; \
-               (m)->m_act = 0; \
-               (ifq)->ifq_len--; \
-               (ifp) = *(mtod((m), struct ifnet **)); \
-               IF_ADJ(m); \
-       } \
-}
 #define        IF_DEQUEUE(ifq, m) { \
        (m) = (ifq)->ifq_head; \
        if (m) { \
 #define        IF_DEQUEUE(ifq, m) { \
        (m) = (ifq)->ifq_head; \
        if (m) { \
index a3955e8..7e14d06 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)if_ethersubr.c      1.2 (Berkeley) %G%
+ *     @(#)if_ethersubr.c      7.1 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -30,6 +30,7 @@
 #include "if.h"
 #include "netisr.h"
 #include "route.h"
 #include "if.h"
 #include "netisr.h"
 #include "route.h"
+#include "if_llc.h"
 
 #include "../machine/mtpr.h"
 
 
 #include "../machine/mtpr.h"
 
@@ -45,6 +46,7 @@
 #endif
 
 u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 #endif
 
 u_char etherbroadcastaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+extern struct ifnet loif;
 
 /*
  * Ethernet output routine.
 
 /*
  * Ethernet output routine.
@@ -58,13 +60,14 @@ enoutput(ifp, m0, dst)
        struct mbuf *m0;
        struct sockaddr *dst;
 {
        struct mbuf *m0;
        struct sockaddr *dst;
 {
-       int type, s, error;
+       short type;
+       int s, error = 0;
        u_char edst[6];
        struct in_addr idst;
        register struct mbuf *m = m0;
        u_char edst[6];
        struct in_addr idst;
        register struct mbuf *m = m0;
+       struct mbuf *mcopy = (struct mbuf *)0;
        register struct ether_header *eh;
        register struct ether_header *eh;
-       register int off;
-       int usetrailers;
+       int usetrailers, off;
 #define        ac ((struct arpcom *)ifp)
 
        if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {
 #define        ac ((struct arpcom *)ifp)
 
        if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING)) {
@@ -90,17 +93,49 @@ enoutput(ifp, m0, dst)
                        goto gottrailertype;
                }
                type = ETHERTYPE_IP;
                        goto gottrailertype;
                }
                type = ETHERTYPE_IP;
-               off = 0;
                goto gottype;
 #endif
 #ifdef NS
        case AF_NS:
                type = ETHERTYPE_NS;
                goto gottype;
 #endif
 #ifdef NS
        case AF_NS:
                type = ETHERTYPE_NS;
+               if (!bcmp((caddr_t)edst, (caddr_t)&ns_thishost, sizeof(edst)))
+                       return(looutput(&loif, m, dst));
                bcopy((caddr_t)&(((struct sockaddr_ns *)dst)->sns_addr.x_host),
                bcopy((caddr_t)&(((struct sockaddr_ns *)dst)->sns_addr.x_host),
-               (caddr_t)edst, sizeof (edst));
-               off = 0;
+                   (caddr_t)edst, sizeof (edst));
                goto gottype;
 #endif
                goto gottype;
 #endif
+#ifdef ISO
+       case AF_ISO: {
+               int     ret;
+               ret = clnp_arpresolve(&us->us_ac.ac_if, m, dst, edst);
+               struct llc *l;
+               if (ret <= 0) {
+                       if (ret == -1) {
+                       /* not resolved */
+                               IFDEBUG(D_ETHER)
+                                       printf("unoutput: clnp packet dropped\n");
+                               ENDDEBUG
+                       }
+                       return(0);
+               }
+               M_PREPEND(m, 3, M_DONTWAIT);
+               if (m == NULL) {
+                       m_freem(mm);
+                       return(0);
+               }
+               type = m->m_pkthdr.len;
+               l = mtod(m, struct llc *);
+               l->llc_dsap = l->llc_ssap = LLC_ISO_LSAP;
+               l->llc_control = LLC_UI;
+               IFDEBUG(D_ETHER)
+                       int i;
+                       printf("unoutput: sending pkt to: ");
+                       for (i=0; i<6; i++)
+                               printf("%x ", edst[i] & 0xff);
+                       printf("\n");
+               ENDDEBUG
+               } goto gottype;
+#endif ISO
 
        case AF_UNSPEC:
                eh = (struct ether_header *)dst->sa_data;
 
        case AF_UNSPEC:
                eh = (struct ether_header *)dst->sa_data;
@@ -125,7 +160,6 @@ gottrailertype:
        m->m_next = m0;
        m = m0->m_next;
        m0->m_next = 0;
        m->m_next = m0;
        m = m0->m_next;
        m0->m_next = 0;
-       m0 = m;
 
 gottype:
        /*
 
 gottype:
        /*
@@ -138,10 +172,15 @@ gottype:
                goto bad;
        }
        eh = mtod(m, struct ether_header *);
                goto bad;
        }
        eh = mtod(m, struct ether_header *);
-       eh->ether_type = htons((u_short)type);
+       type = htons((u_short)type);
+       bcopy((caddr_t)&type,(caddr_t)&eh->ether_type,
+               sizeof(eh->ether_type));
        bcopy((caddr_t)edst, (caddr_t)eh->ether_dhost, sizeof (edst));
        bcopy((caddr_t)ac->ac_enaddr, (caddr_t)eh->ether_shost,
            sizeof(eh->ether_shost));
        bcopy((caddr_t)edst, (caddr_t)eh->ether_dhost, sizeof (edst));
        bcopy((caddr_t)ac->ac_enaddr, (caddr_t)eh->ether_shost,
            sizeof(eh->ether_shost));
+       if (ifp->if_flags & IFF_SIMPLEX && dst->sa_family != AF_UNSPEC &&
+           !bcmp((caddr_t)edst, (caddr_t)etherbroadcastaddr, sizeof (edst)))
+               mcopy = m_copy(m, 0, (int)M_COPYALL);
 
        /*
         * Queue message on interface, and start output if interface
 
        /*
         * Queue message on interface, and start output if interface
@@ -151,17 +190,22 @@ gottype:
        if (IF_QFULL(&ifp->if_snd)) {
                IF_DROP(&ifp->if_snd);
                splx(s);
        if (IF_QFULL(&ifp->if_snd)) {
                IF_DROP(&ifp->if_snd);
                splx(s);
-               m_freem(m);
-               return (ENOBUFS);
+               error = ENOBUFS;
+               goto bad;
        }
        IF_ENQUEUE(&ifp->if_snd, m);
        if ((ifp->if_flags & IFF_OACTIVE) == 0)
        }
        IF_ENQUEUE(&ifp->if_snd, m);
        if ((ifp->if_flags & IFF_OACTIVE) == 0)
-               (*ifp->if_start)(ifp);
+               error = (*ifp->if_start)(ifp);
        splx(s);
        splx(s);
-       return (0);
+       if (mcopy)
+               (void) looutput(&loif, mcopy, dst);
+       return (error);
 
 bad:
 
 bad:
-       m_freem(m0);
+       if (mcopy)
+               m_freem(mcopy);
+       if (m)
+               m_freem(m);
        return (error);
 }
 
        return (error);
 }
 
@@ -176,11 +220,14 @@ en_doproto(ifp, eh, m)
        struct mbuf *m;
 {
        register struct ifqueue *inq;
        struct mbuf *m;
 {
        register struct ifqueue *inq;
+       register struct llc *l;
        int s;
 
        int s;
 
-       if (bcmp((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_shost,
+       if (bcmp((caddr_t)etherbroadcastaddr, (caddr_t)eh->ether_dhost,
            sizeof(etherbroadcastaddr)) == 0)
                m->m_flags |= M_BCAST;
            sizeof(etherbroadcastaddr)) == 0)
                m->m_flags |= M_BCAST;
+       else if (eh->ether_dhost[0] & 1)
+               m->m_flags |= M_MCAST;
 
        switch (eh->ether_type) {
 #ifdef INET
 
        switch (eh->ether_type) {
 #ifdef INET
@@ -201,8 +248,69 @@ en_doproto(ifp, eh, m)
 
 #endif
        default:
 
 #endif
        default:
-               m_freem(m);
-               return;
+               if (eh->ether_type > 1500)
+                       goto dropanyway;
+               l = mtod(m, struct llc *);
+               switch (l->llc_control) {
+               case LLC_UI:
+               /* LLC_UI_P forbidden in class 1 service */
+                   if ((l->llc_dsap == LLC_ISO_LSAP) &&
+                       (l->llc_ssap == LLC_ISO_LSAP)) {
+#ifdef ISO
+                               /* LSAP for ISO */
+                       m->m_data += 3;
+                       m->m_len -= 3;
+                       if (m->m_flags & M_PKTHDR)
+                               m->m_pkthdr.len -= 3;
+                       DEBUGF(undebug & 0x2, printf("clnp packet\n");)
+                       schednetisr(NETISR_CLNP);
+                       inq = &clnlintrq;
+                       if (IF_QFULL(inq)){
+                               DEBUGF(undebug & 0x2, printf(" qfull\n");)
+                               IF_DROP(inq);
+                               m_freem(m);
+                       } else {
+                               IF_ENQUEUE(inq, m);
+                               DEBUGF(undebug & 0x2, printf(" queued\n");)
+                       }
+                       return;
+#endif ISO
+                   }
+                   break;
+               case LLC_XID:
+               case LLC_XID_P:
+                   if(m->m_len < 6)
+                       goto dropanyway;
+                   l->llc_window = 0;
+                   l->llc_fid = 9;
+                   l->llc_class = 1;
+                   l->llc_dsap = l->llc_ssap = 0;
+                   /* Fall through to */
+               case LLC_TEST:
+               case LLC_TEST_P:
+               {
+                   struct sockaddr sa;
+                   register struct ether_header *eh2;
+                   int i;
+                   u_char c = l->llc_dsap;
+                   l->llc_dsap = l->llc_ssap;
+                   l->llc_ssap = c;
+                   sa.sa_family = AF_UNSPEC;
+                   eh2 = (struct ether_header *)sa.sa_data;
+                   for (i = 0; i < 6; i++) {
+                       eh2->ether_shost[i] = c = eh->ether_dhost[i];
+                       eh2->ether_dhost[i] = 
+                               eh->ether_dhost[i] = eh->ether_shost[i];
+                       eh->ether_shost[i] = c;
+                   }
+                   ifp->if_output(ifp, m, &sa);
+                   return;
+               }
+               dropanyway:
+               default:
+                   m_freem(m);
+                   return;
+           }
        }
 
        s = splimp();
        }
 
        s = splimp();
index efe6794..dca1d80 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)if_loop.c   7.4 (Berkeley) %G%
+ *     @(#)if_loop.c   7.5 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -63,33 +63,31 @@ loattach()
        if_attach(ifp);
 }
 
        if_attach(ifp);
 }
 
-looutput(ifp, m0, dst)
+struct mbuf *Loop_Sanity;
+
+looutput(ifp, m, dst)
        struct ifnet *ifp;
        struct ifnet *ifp;
-       register struct mbuf *m0;
+       register struct mbuf *m;
        struct sockaddr *dst;
 {
        int s;
        register struct ifqueue *ifq;
        struct sockaddr *dst;
 {
        int s;
        register struct ifqueue *ifq;
-       struct mbuf *m;
-
-       /*
-        * Place interface pointer before the data
-        * for the receiving protocol.
-        */
-       if (m0->m_off <= MMAXOFF &&
-           m0->m_off >= MMINOFF + sizeof(struct ifnet *)) {
-               m0->m_off -= sizeof(struct ifnet *);
-               m0->m_len += sizeof(struct ifnet *);
-       } else {
-               MGET(m, M_DONTWAIT, MT_HEADER);
-               if (m == (struct mbuf *)0)
-                       return (ENOBUFS);
-               m->m_off = MMINOFF;
-               m->m_len = sizeof(struct ifnet *);
-               m->m_next = m0;
-               m0 = m;
-       }
-       *(mtod(m0, struct ifnet **)) = ifp;
+
+       if ((m->m_flags & M_PKTHDR) == 0)
+               panic("looutput no HDR");
+       m->m_pkthdr.rcvif = ifp;
+
+{struct mbuf *mm; int mlen = 0;
+for (mm = m; m; m = m->m_next) /* XXX debugging code -- sklwoer */
+    mlen += m->m_len;
+m = mm;
+if (mlen != m->m_pkthdr.len) {
+       if (Loop_Sanity)
+               m_freem(Loop_Sanity);
+       Loop_Sanity = m_copy(m, 0, M_COPYALL);
+}
+}
+
        s = splimp();
        ifp->if_opackets++;
        switch (dst->sa_family) {
        s = splimp();
        ifp->if_opackets++;
        switch (dst->sa_family) {
@@ -99,11 +97,11 @@ looutput(ifp, m0, dst)
                ifq = &ipintrq;
                if (IF_QFULL(ifq)) {
                        IF_DROP(ifq);
                ifq = &ipintrq;
                if (IF_QFULL(ifq)) {
                        IF_DROP(ifq);
-                       m_freem(m0);
+                       m_freem(m);
                        splx(s);
                        return (ENOBUFS);
                }
                        splx(s);
                        return (ENOBUFS);
                }
-               IF_ENQUEUE(ifq, m0);
+               IF_ENQUEUE(ifq, m);
                schednetisr(NETISR_IP);
                break;
 #endif
                schednetisr(NETISR_IP);
                break;
 #endif
@@ -112,11 +110,11 @@ looutput(ifp, m0, dst)
                ifq = &nsintrq;
                if (IF_QFULL(ifq)) {
                        IF_DROP(ifq);
                ifq = &nsintrq;
                if (IF_QFULL(ifq)) {
                        IF_DROP(ifq);
-                       m_freem(m0);
+                       m_freem(m);
                        splx(s);
                        return (ENOBUFS);
                }
                        splx(s);
                        return (ENOBUFS);
                }
-               IF_ENQUEUE(ifq, m0);
+               IF_ENQUEUE(ifq, m);
                schednetisr(NETISR_NS);
                break;
 #endif
                schednetisr(NETISR_NS);
                break;
 #endif
@@ -124,7 +122,7 @@ looutput(ifp, m0, dst)
                splx(s);
                printf("lo%d: can't handle af%d\n", ifp->if_unit,
                        dst->sa_family);
                splx(s);
                printf("lo%d: can't handle af%d\n", ifp->if_unit,
                        dst->sa_family);
-               m_freem(m0);
+               m_freem(m);
                return (EAFNOSUPPORT);
        }
        ifp->if_ipackets++;
                return (EAFNOSUPPORT);
        }
        ifp->if_ipackets++;
index 213ab2f..ba9c5c7 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)if_sl.c     7.9 (Berkeley) %G%
+ *     @(#)if_sl.c     7.10 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -355,13 +355,13 @@ slstart(tp)
 slinit(sc)
        register struct sl_softc *sc;
 {
 slinit(sc)
        register struct sl_softc *sc;
 {
-       struct mbuf *p;
+       register caddr_t p;
 
        if (sc->sc_buf == (char *) 0) {
 
        if (sc->sc_buf == (char *) 0) {
-               MCLALLOC(p, 1);
+               MCLALLOC(p, M_WAIT);
                if (p) {
                if (p) {
-                       sc->sc_buf = (char *)p;
-                       sc->sc_mp = sc->sc_buf + sizeof(struct ifnet *);
+                       sc->sc_buf = p;
+                       sc->sc_mp = p;
                } else {
                        printf("sl%d: can't allocate buffer\n", sc - sl_softc);
                        sc->sc_if.if_flags &= ~IFF_UP;
                } else {
                        printf("sl%d: can't allocate buffer\n", sc - sl_softc);
                        sc->sc_if.if_flags &= ~IFF_UP;
@@ -388,48 +388,39 @@ sl_btom(sc, len, ifp)
        cp = sc->sc_buf + sizeof(struct ifnet *);
        mp = &top;
        while (len > 0) {
        cp = sc->sc_buf + sizeof(struct ifnet *);
        mp = &top;
        while (len > 0) {
-               MGET(m, M_DONTWAIT, MT_DATA);
+               if (top == NULL)
+                       MGETHDR(m, M_DONTWAIT, MT_DATA);
+               else
+                       MGET(m, M_DONTWAIT, MT_DATA);
                if ((*mp = m) == NULL) {
                        m_freem(top);
                        return (NULL);
                }
                if ((*mp = m) == NULL) {
                        m_freem(top);
                        return (NULL);
                }
-               if (ifp)
-                       m->m_off += sizeof(ifp);
+               if (top == NULL) {
+                       m->m_pkthdr.rcvif = ifp;
+                       m->m_pkthdr.len = len;
+                       m->m_len = MPLEN;
+               } else
+                       m->m_len = MLEN;
                /*
                /*
-                * If we have at least NBPG bytes,
-                * allocate a new page.  Swap the current buffer page
-                * with the new one.  We depend on having a space
-                * left at the beginning of the buffer
-                * for the interface pointer.
+                * If we have at least MINCLSIZE bytes,
+                * allocate a new page.  Swap the current
+                * buffer page with the new one.
                 */
                 */
-               if (len >= NBPG) {
-                       MCLGET(m);
-                       if (m->m_len == MCLBYTES) {
+               if (len >= MINCLSIZE) {
+                       MCLGET(m, M_DONTWAIT);
+                       if (m->m_flags & M_EXT) {
                                cp = mtod(m, char *);
                                cp = mtod(m, char *);
-                               m->m_off = (int)sc->sc_buf - (int)m;
+                               m->m_data = sc->sc_buf;
                                sc->sc_buf = cp;
                                sc->sc_buf = cp;
-                               if (ifp) {
-                                       m->m_off += sizeof(ifp);
-                                       count = MIN(len,
-                                           MCLBYTES - sizeof(struct ifnet *));
-                               } else
-                                       count = MIN(len, MCLBYTES);
+                               count = MIN(len, MCLBYTES);
                                goto nocopy;
                        }
                }
                                goto nocopy;
                        }
                }
-               if (ifp)
-                       count = MIN(len, MLEN - sizeof(ifp));
-               else
-                       count = MIN(len, MLEN);
+               count = MIN(len, m->m_len);
                bcopy(cp, mtod(m, caddr_t), count);
 nocopy:
                m->m_len = count;
                bcopy(cp, mtod(m, caddr_t), count);
 nocopy:
                m->m_len = count;
-               if (ifp) {
-                       m->m_off -= sizeof(ifp);
-                       m->m_len += sizeof(ifp);
-                       *mtod(m, struct ifnet **) = ifp;
-                       ifp = NULL;
-               }
                cp += count;
                len -= count;
                mp = &m->m_next;
                cp += count;
                len -= count;
                mp = &m->m_next;
index 120d11d..baf35de 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)route.c     7.4 (Berkeley) %G%
+ *     @(#)route.c     7.5 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -312,7 +312,6 @@ rtrequest(req, entry)
                }
                m->m_next = *mfirst;
                *mfirst = m;
                }
                m->m_next = *mfirst;
                *mfirst = m;
-               m->m_off = MMINOFF;
                m->m_len = sizeof (struct rtentry);
                rt = mtod(m, struct rtentry *);
                rt->rt_hash = hash;
                m->m_len = sizeof (struct rtentry);
                rt = mtod(m, struct rtentry *);
                rt->rt_hash = hash;