-/* if_loop.c 4.8 82/03/28 */
+/* if_loop.c 4.15 82/10/13 */
/*
* Loopback interface driver for protocol testing and timing.
#include "../h/systm.h"
#include "../h/mbuf.h"
#include "../h/socket.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/ip.h"
-#include "../net/ip_var.h"
-#include "../h/mtpr.h"
+#include "../net/netisr.h"
+#include "../netinet/ip.h"
+#include "../netinet/ip_var.h"
+#include "../vax/mtpr.h"
+#include "../net/route.h"
+#include <errno.h>
#define LONET 127
#define LOMTU (1024+512)
ifp->if_flags = IFF_UP;
ifp->if_output = looutput;
if_attach(ifp);
+ if_rtinit(ifp, RTF_UP);
}
looutput(ifp, m0, dst)
IF_DROP(ifq);
m_freem(m0);
splx(s);
- return (0);
+ return (ENOBUFS);
}
IF_ENQUEUE(ifq, m0);
schednetisr(NETISR_IP);
printf("lo%d: can't handle af%d\n", ifp->if_unit,
dst->sa_family);
m_freem(m0);
- return (0);
+ return (EAFNOSUPPORT);
}
ifp->if_ipackets++;
splx(s);
- return (1);
+ return (0);
}