summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-06-23 22:52:52 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-06-23 22:52:52 +0000
commitf64beeda600e5f902b1b2e0a4fff2da4afc8cd48 (patch)
treed3f00423b81adeba52333856913f945b59f3d363
parentd1c4681a41ebee11901ef30b928d94f1ccbb82d6 (diff)
Add ether_input_mbuf to help us remove the ether_header from
ether_input; all drivers should start migrating to this. Discussed with jason@, deraadt@ more or les ok'ed.
-rw-r--r--sys/net/if.h3
-rw-r--r--sys/net/if_ethersubr.c18
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/net/if.h b/sys/net/if.h
index 6f03764cd5f..0bf2b61588f 100644
--- a/sys/net/if.h
+++ b/sys/net/if.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.h,v 1.27 2001/06/15 03:38:33 itojun Exp $ */
+/* $OpenBSD: if.h,v 1.28 2001/06/23 22:52:51 fgsch Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@@ -423,6 +423,7 @@ int if_index;
void ether_ifattach __P((struct ifnet *));
void ether_ifdetach __P((struct ifnet *));
int ether_ioctl __P((struct ifnet *, struct arpcom *, u_long, caddr_t));
+void ether_input_mbuf __P((struct ifnet *, struct mbuf *));
void ether_input __P((struct ifnet *, struct ether_header *, struct mbuf *));
int ether_output __P((struct ifnet *,
struct mbuf *, struct sockaddr *, struct rtentry *));
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index f35a31b9efc..bc745071289 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.49 2001/06/23 06:20:35 angelos Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.50 2001/06/23 22:52:51 fgsch Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -586,6 +586,22 @@ bad:
}
/*
+ * Temporary function to migrate while
+ * removing ether_header * from ether_input().
+ */
+void
+ether_input_mbuf(ifp, m)
+ struct ifnet *ifp;
+ struct mbuf *m;
+{
+ struct ether_header *eh;
+
+ eh = mtod(m, struct ether_header *);
+ m_adj(m, ETHER_HDR_LEN);
+ ether_input(ifp, eh, m);
+}
+
+/*
* Process a received Ethernet packet;
* the packet is in the mbuf chain m without
* the ether header, which is provided separately.