Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
a5c9f959
Commit
a5c9f959
authored
6 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
gnrc_ipv6: use gnrc_pktbuf_reverse_snips()
parent
ac54a2d2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
+7
-18
7 additions, 18 deletions
sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
with
7 additions
and
18 deletions
sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
+
7
−
18
View file @
a5c9f959
...
...
@@ -839,8 +839,6 @@ static void _receive(gnrc_pktsnip_t *pkt)
}
/* TODO: check if receiving interface is router */
else
if
(
--
(
hdr
->
hl
)
>
0
)
{
/* drop packets that *reach* Hop Limit 0 */
gnrc_pktsnip_t
*
reversed_pkt
=
NULL
,
*
ptr
=
pkt
;
DEBUG
(
"ipv6: forward packet to next hop
\n
"
);
/* pkt might not be writable yet, if header was given above */
...
...
@@ -856,23 +854,14 @@ static void _receive(gnrc_pktsnip_t *pkt)
if
(
netif_hdr
!=
NULL
)
{
gnrc_pktbuf_remove_snip
(
pkt
,
netif_hdr
);
}
/* reverse packet snip list order */
while
(
ptr
!=
NULL
)
{
gnrc_pktsnip_t
*
next
;
ptr
=
gnrc_pktbuf_start_write
(
ptr
);
/* duplicate if not already done */
if
(
ptr
==
NULL
)
{
DEBUG
(
"ipv6: unable to get write access to packet: dropping it
\n
"
);
gnrc_pktbuf_release
(
reversed_pkt
);
gnrc_pktbuf_release
(
pkt
);
return
;
}
next
=
ptr
->
next
;
ptr
->
next
=
reversed_pkt
;
reversed_pkt
=
ptr
;
ptr
=
next
;
pkt
=
gnrc_pktbuf_reverse_snips
(
pkt
);
if
(
pkt
!=
NULL
)
{
_send
(
pkt
,
false
);
}
else
{
DEBUG
(
"ipv6: unable to reverse pkt from receive order to send "
"order; dropping it
\n
"
);
}
_send
(
reversed_pkt
,
false
);
return
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment