<h3>Description</h3>
<p>Sending a UDP packet bigger than 256 bytes to the "examples/nanocoap_server" application causes it to stop responding to requests.</p>
<p>I tested this in native only.</p>
<h3>Steps to reproduce the issue</h3>
<h4>Start the application:</h4>
<pre><code>$ ./dist/tools/tapsetup/tapsetup
$ cd examples/nanocoap_server
$ make
$ make term
/home/jcarrano/source/masterRIOT/examples/nanocoap_server/bin/native/nanocoap_server.elf tap0 
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

main(): This is RIOT! (Version: 2019.04-devel-143-gf9ae375-up-master)
RIOT nanocoap example application
Waiting for address autoconfiguration...
Configured network interfaces:
Iface  5  HWaddr: 0A:0C:BF:83:6E:EC 
          L2-PDU:1500 MTU:1500  HL:64  Source address length: 6
          Link type: wired
          inet6 addr: fe80::80c:bfff:fe83:6eec  scope: local  VAL
          inet6 group: ff02::1
          inet6 group: ff02::1:ff83:6eec

</code></pre>
<h3>Verify the server is up</h3>
<pre><code>$ aiocoap-client 'coap://[fe80::80c:bfff:fe83:6eec%tapbr0]/riot/ver'
This is RIOT (Version: 2019.04-devel-143-gf9ae375-up-master) running on a native board with a native MCU.
(No newline at end of message)
</code></pre>
<h3>Send 256 zeros, no problem</h3>
<pre><code>$ dd if=/dev/zero bs=1 count=256 | netcat -6u -w0 fe80::80c:bfff:fe83:6eec%tapbr0 5683
$ aiocoap-client 'coap://[fe80::80c:bfff:fe83:6eec%tapbr0]/riot/ver'
This is RIOT (Version: 2019.04-devel-143-gf9ae375-up-master) running on a native board with a native MCU.
(No newline at end of message)
</code></pre>
<h3>Send 257 zeros, it breaks</h3>
<pre><code>$ dd if=/dev/zero bs=1 count=257 | netcat -6u -w0 fe80::80c:bfff:fe83:6eec%tapbr0 5683
$ aiocoap-client 'coap://[fe80::80c:bfff:fe83:6eec%tapbr0]/riot/ver'
Traceback (most recent call last):
  File "/home/jcarrano/.local/bin/aiocoap-client", line 11, in <module>
    sys.exit(sync_main())
  File "/home/jcarrano/.local/lib/python3.7/site-packages/aiocoap/cli/client.py", line 223, in sync_main
    asyncio.get_event_loop().run_until_complete(single_request(args))
  File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/home/jcarrano/.local/lib/python3.7/site-packages/aiocoap/cli/client.py", line 149, in single_request
    response_data = yield from requester.response
aiocoap.error.RequestTimedOut
</code></pre>
<h3>Expected results</h3>
<p>The 247-zeros packets should get ignored and the server should still be responsive.</p>
<h3>Actual results</h3>
<p>The server does not crash, but stops responding to coap requests.</p>
<h3>Versions</h3>
<details><summary>./dist/tools/ci/print_toolchain_versions.sh</summary>
<p>
</p><pre><code>Operating System Environment
-----------------------------
       Operating System: "Arch Linux" 
                 Kernel: Linux 4.20.6-arch1-1-ARCH x86_64 unknown

Installed compiler toolchains
-----------------------------
             native gcc: gcc (GCC) 8.2.1 20181127
      arm-none-eabi-gcc: arm-none-eabi-gcc (Arch Repository) 8.2.0
                avr-gcc: missing
       mips-mti-elf-gcc: missing
             msp430-gcc: missing
   riscv-none-embed-gcc: missing
   xtensa-esp32-elf-gcc: missing
   xtensa-lx106-elf-gcc: missing
                  clang: clang version 7.0.1 (tags/RELEASE_701/final)

Installed compiler libs
-----------------------
   arm-none-eabi-newlib: "3.0.0"
    mips-mti-elf-newlib: missing
riscv-none-embed-newlib: missing
xtensa-esp32-elf-newlib: missing
xtensa-lx106-elf-newlib: missing
               avr-libc: missing (missing)

Installed development tools
---------------------------
                  cmake: cmake version 3.13.4
               cppcheck: Cppcheck 1.86
                doxygen: 1.8.15
                 flake8: 3.7.4 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.0) CPython 3.7.2 on Linux
                    git: git version 2.20.1
                   make: GNU Make 4.2.1
                openocd: Open On-Chip Debugger 0.10.0
                 python: Python 3.7.2
                python2: Python 2.7.15
                python3: Python 3.7.2
             coccinelle: missing
</code></pre>
<p></p>
</details>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/issues/10972">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AEn7YDGmB0lMarBVKYFfyZKln0Y9zOdYks5vLV9-gaJpZM4avHyF">mute the thread</a>.<img src="https://github.com/notifications/beacon/AEn7YL_TfPVkam16hYyV9NVtjAhzYs1tks5vLV9-gaJpZM4avHyF.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/RIOT-OS/RIOT","title":"RIOT-OS/RIOT","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/RIOT-OS/RIOT"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"examples/nanocoap_server hangs after \u003e 256 bytes packet (#10972)"}],"action":{"name":"View Issue","url":"https://github.com/RIOT-OS/RIOT/issues/10972"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/issues/10972",
"url": "https://github.com/RIOT-OS/RIOT/issues/10972",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>