Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes several bugs on GNRC network stack #4604

Merged
merged 4 commits into from
Jan 7, 2016

Conversation

Yonezawa-T2
Copy link
Contributor

#4447 for 2015.12-branch

When `gnrc_ndp_node_next_hop_l2addr` cannot resolve L2 address, it creates a
temporary neighbor cache entry with interface `KERNEL_PID_UNDEF` (unless the
interface is already known) to send a neighbor solicitation. When another packet
directed to the same address is going to sent before receiving a neighbor
advertisement, `gnrc_sixlowpan_nd_next_hop_l2addr` gets the temporary neighbor
cache entry and calls `gnrc_ipv6_netif_get` with `KERNEL_PID_UNDEF`, resulting
get a `NULL`. We must check `NULL` before dereference it.

FYI, both `gnrc_ndp_node_next_hop_l2addr` and
`gnrc_sixlowpan_nd_next_hop_l2addr` are enabled when
`gnrc_sixlowpan_border_router_default` module is enabled with `GNRC_NETIF_NUMOF`
is greater than 1:

gnrc_sixlowpan_border_router_default
→ gnrc_ipv6_router_default
→ gnrc_ndp_router (if GNRC_NETIF_NUMOF > 1)
→ gnrc_ndp_node
→ gnrc_ndp_node_next_hop_l2addr is called from _next_hop_l2addr

gnrc_sixlowpan_border_router_default
→ gnrc_sixlowpan_nd_border_router
→ gnrc_sixlowpan_nd_router
→ gnrc_sixlowpan_nd
→ gnrc_sixlowpan_nd_next_hop_l2addr is called from _next_hop_l2addr
When ENABLE_DEBUG is 1, `out` is dereferenced unconditionally, but
`_parse_options` in `gnrc_rpl_control_messages.c` calls it with NULL.

Clarified `out` must not NULL and fixed `_parse_options`.
@miri64 miri64 self-assigned this Jan 7, 2016
@miri64 miri64 added this to the Release 2015.12 milestone Jan 7, 2016
@miri64 miri64 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: network Area: Networking NSTF CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 7, 2016
@miri64
Copy link
Member

miri64 commented Jan 7, 2016

ACK when travis is happy.

miri64 added a commit that referenced this pull request Jan 7, 2016
fixes several bugs on GNRC network stack
@miri64 miri64 merged commit 33ada0c into RIOT-OS:2015.12-branch Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants