{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10227","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10227/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10227/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10227/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/10227","id":372993104,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MDMzMjQw","number":10227,"title":"gnrc_rpl_srh: cleanup and optimize SRH processing function","user":{"login":"miri64","id":675644,"node_id":"MDQ6VXNlcjY3NTY0NA==","avatar_url":"https://avatars1.githubusercontent.com/u/675644?v=4","gravatar_id":"","url":"https://api.github.com/users/miri64","html_url":"https://github.com/miri64","followers_url":"https://api.github.com/users/miri64/followers","following_url":"https://api.github.com/users/miri64/following{/other_user}","gists_url":"https://api.github.com/users/miri64/gists{/gist_id}","starred_url":"https://api.github.com/users/miri64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miri64/subscriptions","organizations_url":"https://api.github.com/users/miri64/orgs","repos_url":"https://api.github.com/users/miri64/repos","events_url":"https://api.github.com/users/miri64/events{/privacy}","received_events_url":"https://api.github.com/users/miri64/received_events","type":"User","site_admin":false},"labels":[{"id":86443543,"node_id":"MDU6TGFiZWw4NjQ0MzU0Mw==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Area:%20network","name":"Area: network","color":"6600ff","default":false},{"id":214816571,"node_id":"MDU6TGFiZWwyMTQ4MTY1NzE=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/CI:%20ready%20for%20build","name":"CI: ready for build","color":"66ffcc","default":false},{"id":1075449391,"node_id":"MDU6TGFiZWwxMDc1NDQ5Mzkx","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Reviewed:%201-fundamentals","name":"Reviewed: 1-fundamentals","color":"00dd00","default":false},{"id":1075450172,"node_id":"MDU6TGFiZWwxMDc1NDUwMTcy","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Reviewed:%202-code-design","name":"Reviewed: 2-code-design","color":"00dd00","default":false},{"id":122032371,"node_id":"MDU6TGFiZWwxMjIwMzIzNzE=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Type:%20cleanup","name":"Type: cleanup","color":"ffff66","default":false},{"id":23399100,"node_id":"MDU6TGFiZWwyMzM5OTEwMA==","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Type:%20enhancement","name":"Type: enhancement","color":"ffff66","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-23T13:13:20Z","updated_at":"2018-11-27T14:39:40Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/10227","html_url":"https://github.com/RIOT-OS/RIOT/pull/10227","diff_url":"https://github.com/RIOT-OS/RIOT/pull/10227.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/10227.patch"},"body":"### Contribution description\r\nWhile starting preparations I noticed that the processing function for RPL source routing headers in general needs some polishing. This PR provides that some code cleanup and optimizations.\r\n\r\n### Testing procedure\r\nIt can be ensured that the function is still doing the same behavior by using the `tests-rpl_srh` unittests. I also ensured with those on `samr21-xpro` with `ps` that the binary size and stack usage indeed goes down:\r\n\r\n```diff\r\ndiff --git a/tests/unittests/tests-rpl_srh/Makefile.include b/tests/unittests/tests-rpl_srh/Makefile.include\r\nindex 4aa358a..7425e14 100644\r\n--- a/tests/unittests/tests-rpl_srh/Makefile.include\r\n+++ b/tests/unittests/tests-rpl_srh/Makefile.include\r\n@@ -1,3 +1,6 @@\r\n USEMODULE += gnrc_ipv6\r\n USEMODULE += ipv6_addr\r\n USEMODULE += gnrc_rpl_srh\r\n+USEMODULE += ps\r\n+\r\n+CFLAGS += -DDEVELHELP\r\ndiff --git a/tests/unittests/tests-rpl_srh/tests-rpl_srh.c b/tests/unittests/tests-rpl_srh/tests-rpl_srh.c\r\nindex 5bc75a2..f6390c7 100644\r\n--- a/tests/unittests/tests-rpl_srh/tests-rpl_srh.c\r\n+++ b/tests/unittests/tests-rpl_srh/tests-rpl_srh.c\r\n@@ -19,6 +19,7 @@\r\n #include \"net/ipv6/ext.h\"\r\n #include \"net/ipv6/hdr.h\"\r\n #include \"net/gnrc/rpl/srh.h\"\r\n+#include \"ps.h\"\r\n \r\n #include \"unittests-constants.h\"\r\n #include \"tests-rpl_srh.h\"\r\n@@ -120,5 +121,6 @@ Test *tests_rpl_srh_tests(void)\r\n void tests_rpl_srh(void)\r\n {\r\n     TESTS_RUN(tests_rpl_srh_tests());\r\n+    ps();\r\n }\r\n /** @} */\r\n```\r\n\r\n### Issues/PRs references\r\n![PR dependencies](http://page.mi.fu-berlin.de/mlenders/ipv6_rework.svg)"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/442081436","html_url":"https://github.com/RIOT-OS/RIOT/pull/10227#issuecomment-442081436","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/10227","id":442081436,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjA4MTQzNg==","user":{"login":"jia200x","id":1260616,"node_id":"MDQ6VXNlcjEyNjA2MTY=","avatar_url":"https://avatars3.githubusercontent.com/u/1260616?v=4","gravatar_id":"","url":"https://api.github.com/users/jia200x","html_url":"https://github.com/jia200x","followers_url":"https://api.github.com/users/jia200x/followers","following_url":"https://api.github.com/users/jia200x/following{/other_user}","gists_url":"https://api.github.com/users/jia200x/gists{/gist_id}","starred_url":"https://api.github.com/users/jia200x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jia200x/subscriptions","organizations_url":"https://api.github.com/users/jia200x/orgs","repos_url":"https://api.github.com/users/jia200x/repos","events_url":"https://api.github.com/users/jia200x/events{/privacy}","received_events_url":"https://api.github.com/users/jia200x/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T14:39:40Z","updated_at":"2018-11-27T14:39:40Z","author_association":"MEMBER","body":"Tested on `b-l072z-lrwan1`. The size indeed goes down and all tests pass."}}
{"actor":{"display_login":"jia200x"}}