写入只读P3IN

时间:2017-04-06 07:02:15

标签: c contiki

我正在尝试使用quark计算标头压缩后的IPv6数据包哈希值。散列是通过压缩的IPv6报头和有效负载计算的。

This行提到IP数据包最初位于uip_bufuip_len表示uip_buf中内容的长度。

夸克的原型是int quark( u8 *out, const u8 *in, u64 inlen );

我正在致电quark( out, uip_buf, uip_len ); after IPv6 header compression。只有当数据包足够大才能进行分段时,我才会计算哈希值。

我在contiki 3.0中使用z1 motes,cooja模拟器。 我收到了以下问题:

[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - Writing to read-only P3IN
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - 
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) - Stack Trace: number of calls: 13 PC: $07a36
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   permute_u (serial-line.c) called from PC: $07f76 (elapsed: 890)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   permute (local in sicslowpan.c) called from PC: $0806e (elapsed: 49789)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   update (serial-line.c) called from PC: $08150 (elapsed: 70287)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   quark (serial-line.c) called from PC: $0874e (elapsed: 127697)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   output (local in sicslowpan.c) called from PC: $0a288 (elapsed: 247738)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   tcpip_output (serial-line.c) called from PC: $0a3b8 (elapsed: 247750)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   tcpip_ipv6_output (serial-line.c) called from PC: $09ffa (elapsed: 247800)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   uip_icmp6_send (serial-line.c) called from PC: $0c066 (elapsed: 248724)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   dis_output (serial-line.c) called from PC: $0c79c (elapsed: 248786)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   handle_periodic_timer (local in rpl-timers.c) called from PC: $06496 (elapsed: 249098)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   process_thread_ctimer_process (local in ctimer.c) called from PC: $068aa (elapsed: 249237)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   call_process (local in process.c) called from PC: $06a28 (elapsed: 249272)
[java]  INFO [AWT-EventQueue-0] (MessageListUI.java:261) -   process_run (serial-line.c) called from PC: $033f2 (elapsed: 250282)

经过一番搜索,我明白可能的原因可能是:

  1. 函数返回负数或大数。
  2. 数组索引超出范围。
  3. 我确信我的代码中没有这种可能性,但我不知道quark.c中是否存在任何可能性。我只是使用rpl-udp客户端和服务器。我只从客户端发送134字节的数据作为数据。

    在错误弹出之前,Mote输出显示我从代码中打印的值。 uip_len = 116 sizeof(uip_buf) = 1280

    解决错误的任何解决方案或提示?

0 个答案:

没有答案