Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni Pellerano committed Jul 17, 2011
1 parent 0cfeaeb commit 611a03e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/janus.c
Expand Up @@ -436,12 +436,15 @@ void JANUS_Bootstrap(void)
memcpy(netif_send_hdr, mac, ETH_ALEN);
memcpy(&netif_recv_hdr[ETH_ALEN], mac, ETH_ALEN);

memcpy(macpkt, netif_send_hdr, ETH_HLEN);
*(uint16_t *)&netif_send_hdr[2 * ETH_ALEN] = htons(ETH_P_IP);
*(uint16_t *)&netif_recv_hdr[2 * ETH_ALEN] = htons(ETH_P_IP);

macpkt = malloc(ETH_HLEN + atoi(str[STR_NET_MTU]));
if (macpkt == NULL)
runtime_exception("unable to allocate memory for the datalink packet buffer");

memcpy(macpkt, netif_send_hdr, ETH_HLEN);

pbufs = pbufs_malloc(conf.pqueue_len, atoi(str[STR_NET_MTU]));
if (pbufs == NULL)
runtime_exception("unable to allocate memory for packet buffers");
Expand Down

0 comments on commit 611a03e

Please sign in to comment.