check in temporary version with compatibility hacks
[unix-history] / usr / src / sys / net / if_loop.c
index 61e0d80..5ca5118 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)if_loop.c   7.12 (Berkeley) %G%
+ *     @(#)if_loop.c   7.13 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #include "../netiso/iso_var.h"
 #endif
 
 #include "../netiso/iso_var.h"
 #endif
 
-#ifdef CCITT
-#include "../netccitt/x25.h"
-#include "../netccitt/hdlc.h"
-#include "../netccitt/hd_var.h"
-#endif
-
 #define        LOMTU   (1024+512)
 
 struct ifnet loif;
 #define        LOMTU   (1024+512)
 
 struct ifnet loif;
@@ -85,7 +79,6 @@ looutput(ifp, m, dst, rt)
                m_freem(m);
                return (rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
        }
                m_freem(m);
                return (rt->rt_flags & RTF_HOST ? EHOSTUNREACH : ENETUNREACH);
        }
-       s = splimp();
        ifp->if_opackets++;
        ifp->if_obytes += m->m_pkthdr.len;
        switch (dst->sa_family) {
        ifp->if_opackets++;
        ifp->if_obytes += m->m_pkthdr.len;
        switch (dst->sa_family) {
@@ -107,20 +100,14 @@ looutput(ifp, m, dst, rt)
                ifq = &clnlintrq;
                isr = NETISR_ISO;
                break;
                ifq = &clnlintrq;
                isr = NETISR_ISO;
                break;
-#endif
-#ifdef CCITT
-       case AF_CCITT:
-               ifq = &hdintrq;
-               isr = NETISR_CCITT;
-               break;
 #endif
        default:
 #endif
        default:
-               splx(s);
                printf("lo%d: can't handle af%d\n", ifp->if_unit,
                        dst->sa_family);
                m_freem(m);
                return (EAFNOSUPPORT);
        }
                printf("lo%d: can't handle af%d\n", ifp->if_unit,
                        dst->sa_family);
                m_freem(m);
                return (EAFNOSUPPORT);
        }
+       s = splimp();
        if (IF_QFULL(ifq)) {
                IF_DROP(ifq);
                m_freem(m);
        if (IF_QFULL(ifq)) {
                IF_DROP(ifq);
                m_freem(m);
@@ -135,6 +122,15 @@ looutput(ifp, m, dst, rt)
        return (0);
 }
 
        return (0);
 }
 
+/* ARGSUSED */
+lortrequest(cmd, rt, sa)
+struct rtentry *rt;
+struct sockaddr *sa;
+{
+       if (rt)
+               rt->rt_rmx.rmx_mtu = LOMTU;
+}
+
 /*
  * Process an ioctl request.
  */
 /*
  * Process an ioctl request.
  */
@@ -144,15 +140,16 @@ loioctl(ifp, cmd, data)
        int cmd;
        caddr_t data;
 {
        int cmd;
        caddr_t data;
 {
+       register struct ifaddr *ifa;
        int error = 0;
 
        switch (cmd) {
 
        int error = 0;
 
        switch (cmd) {
 
-#ifdef CCITT
-       case SIOCSIFCONF_X25:
-#endif
        case SIOCSIFADDR:
                ifp->if_flags |= IFF_UP;
        case SIOCSIFADDR:
                ifp->if_flags |= IFF_UP;
+               ifa = (struct ifaddr *)data;
+               if (ifa != 0 && ifa->ifa_addr->sa_family == AF_ISO)
+                       ifa->ifa_rtrequest = lortrequest;
                /*
                 * Everything else is done at a higher level.
                 */
                /*
                 * Everything else is done at a higher level.
                 */