aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r--sys/net/if_loop.c35
1 files changed, 27 insertions, 8 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 40492d421843..163712a66fd1 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)if_loop.c 7.13 (Berkeley) 4/26/91
- * $Id: if_loop.c,v 1.2 1993/10/16 17:43:19 rgrimes Exp $
+ * $Id: if_loop.c,v 1.6 1993/12/20 19:31:29 wollman Exp $
*/
/*
@@ -44,6 +44,7 @@
#include "socket.h"
#include "errno.h"
#include "ioctl.h"
+#include "kernel.h"
#include "../net/if.h"
#include "../net/if_types.h"
@@ -71,17 +72,24 @@
#include "bpfilter.h"
#if NBPFILTER > 0
-#include <sys/time.h>
-#include <net/bpf.h>
+#include "sys/time.h"
+#include "net/bpf.h"
static caddr_t lo_bpf;
#endif
+#ifdef TINY_LOMTU
#define LOMTU (1024+512)
+#else /* reasonable MTU */
+#define LOMTU 65535 /* maximum MTU for IP */
+#endif /* reasonable MTU */
struct ifnet loif;
-int looutput(), loioctl();
+int looutput(struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *);
+int loioctl(struct ifnet *, int, caddr_t);
+void lortrequest(int, struct rtentry *, struct sockaddr *);
-loattach()
+void
+loattach(void)
{
register struct ifnet *ifp = &loif;
@@ -99,6 +107,9 @@ loattach()
#endif
}
+TEXT_SET(pseudo_set, loattach);
+
+int
looutput(ifp, m, dst, rt)
struct ifnet *ifp;
register struct mbuf *m;
@@ -179,18 +190,26 @@ looutput(ifp, m, dst, rt)
}
/* ARGSUSED */
+void
lortrequest(cmd, rt, sa)
-struct rtentry *rt;
-struct sockaddr *sa;
+ int cmd;
+ struct rtentry *rt;
+ struct sockaddr *sa;
{
- if (rt)
+ if (rt) {
+#ifdef DEBUG
+ printf("lo0: lortrequest: setting route MTU to %u\n",
+ LOMTU);
+#endif
rt->rt_rmx.rmx_mtu = LOMTU;
+ }
}
/*
* Process an ioctl request.
*/
/* ARGSUSED */
+int
loioctl(ifp, cmd, data)
register struct ifnet *ifp;
int cmd;