summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-11-26 13:42:09 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-11-26 13:42:09 +0100
commita712dbc42369b44556bf11e2c53e7cad8f476c13 (patch)
treee81112728d435e89ca944926d729ef7bb37e025d
parent6ebd855150dbea53e2762f7e4433d344888f06f0 (diff)
sync libmachdev/net.c
-rw-r--r--libmachdev/net.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/libmachdev/net.c b/libmachdev/net.c
index 53edcd0a..7ddf95d9 100644
--- a/libmachdev/net.c
+++ b/libmachdev/net.c
@@ -104,8 +104,6 @@ static struct net_data *nd_head;
extern struct device_emulation_ops linux_net_emulation_ops;
-static int print_packet_size = 1;
-
static mach_msg_type_t header_type =
{
MACH_MSG_TYPE_BYTE,
@@ -230,16 +228,11 @@ netif_rx_handle (char *data, int len, struct net_device *dev)
struct packet_header *ph;
struct net_data *nd;
- if (print_packet_size)
- printf ("netif_rx: length %d\n", len);
-
nd = search_nd(dev);
assert (nd);
/* Allocate a kernel message buffer. */
- net_msg = malloc (sizeof (*net_msg));
- if (!net_msg)
- return;
+ net_msg = alloca (sizeof *net_msg);
pack_size = len - sizeof (struct ethhdr);
/* remember message sizes must be rounded up */
@@ -264,7 +257,6 @@ netif_rx_handle (char *data, int len, struct net_device *dev)
net_msg->packet_type = packet_type;
net_msg->net_rcv_msg_packet_count = ph->length;
deliver_msg (net_msg, &nd->ifnet.port_list);
- free (net_msg);
}
/* Mach device interface routines. */