[riot-notifications] [RIOT-OS/RIOT] gnrc_tcp: allow unknown options (#12298)

Simon Brummer notifications at github.com
Tue Sep 24 19:56:13 CEST 2019


brummer-simon commented on this pull request.



>          }
 
         if (opt_left < TCP_OPTION_LENGTH_MIN || option->length > opt_left) {
-            DEBUG("gnrc_tcp_option.c : _option_parse() : invalid option length\n");
-            return 0;
+            DEBUG("gnrc_tcp_option.c : _option_parse() : Invalid option. Drop Packet.\n");
+            return -1;

The return 0 is part of the buggy behavoir. The condition comes true in cases where an option is either to short or exceeds the given buffer. In both cases the Packet is malformed and has to be dropped in response. -1 is the correct error code there.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12298#discussion_r327754013
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190924/86d74d82/attachment.htm>


More information about the notifications mailing list