Skip to content

Commit

Permalink
Merge pull request #680 from benpicco/fix_crash
Browse files Browse the repository at this point in the history
set up message queues for the IP and UDP thread
  • Loading branch information
Christian Mehlis committed Feb 24, 2014
2 parents f437693 + 4068133 commit 8556403
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sys/net/network_layer/sixlowpan/ip.c
Expand Up @@ -45,7 +45,7 @@ char addr_str[IPV6_MAX_ADDR_STR_LEN];

uint8_t ip_send_buffer[BUFFER_SIZE];
uint8_t buffer[BUFFER_SIZE];
msg_t msg_queue[IP_PKT_RECV_BUF_SIZE];
msg_t ip_msg_queue[IP_PKT_RECV_BUF_SIZE];
ipv6_hdr_t *ipv6_buf;
icmpv6_hdr_t *icmp_buf;
uint8_t *nextheader;
Expand Down Expand Up @@ -269,6 +269,8 @@ void ipv6_process(void)
uint8_t i;
uint16_t packet_length;

msg_init_queue(ip_msg_queue, IP_PKT_RECV_BUF_SIZE);

ipv6_addr_init(&myaddr, 0xabcd, 0x0, 0x0, 0x0, 0x3612, 0x00ff, 0xfe00,
sixlowpan_mac_get_radio_address());

Expand Down
4 changes: 4 additions & 0 deletions sys/net/transport_layer/destiny/udp.c
Expand Up @@ -32,6 +32,8 @@

#include "udp.h"

msg_t udp_msg_queue[UDP_PKT_RECV_BUF_SIZE];

uint16_t udp_csum(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header)
{
uint16_t sum;
Expand All @@ -51,6 +53,8 @@ void udp_packet_handler(void)
socket_internal_t *udp_socket = NULL;
uint16_t chksum;

msg_init_queue(udp_msg_queue, UDP_PKT_RECV_BUF_SIZE);

while (1) {
msg_receive(&m_recv_ip);
ipv6_header = ((ipv6_hdr_t *)m_recv_ip.content.ptr);
Expand Down
1 change: 1 addition & 0 deletions sys/net/transport_layer/destiny/udp.h
Expand Up @@ -22,6 +22,7 @@
#include "destiny/types.h"

#define UDP_STACK_SIZE KERNEL_CONF_STACKSIZE_MAIN
#define UDP_PKT_RECV_BUF_SIZE (64)

uint16_t udp_csum(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header);
void udp_packet_handler(void);
Expand Down

0 comments on commit 8556403

Please sign in to comment.