Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
07e328e3
Commit
07e328e3
authored
Jun 15, 2016
by
Davide Ciminaghi
Committed by
Alessandro Rubini
Sep 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fsm: simplify msg header unpacking code
parent
d444b632
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
fsm.c
fsm.c
+11
-9
No files found.
fsm.c
View file @
07e328e3
...
...
@@ -83,20 +83,22 @@ int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen)
(
int
)
ppi
->
last_rcv_time
.
nanoseconds
,
packet
[
0
]
&
0xf
,
pp_msg_names
[
packet
[
0
]
&
0xf
]);
/*
* Discard too short packets
*/
if
(
plen
<
PP_HEADER_LENGTH
)
{
plen
=
0
;
packet
=
NULL
;
}
/*
* Since all ptp frames have the same header, parse it now.
* In case of error continue without a frame, so the current
* ptp state can update ppi->next_delay and return a proper value
*/
if
(
plen
)
{
if
(
plen
>=
PP_HEADER_LENGTH
)
err
=
msg_unpack_header
(
ppi
,
packet
,
plen
);
else
err
=
1
;
if
(
err
)
{
plen
=
0
;
packet
=
NULL
;
}
if
(
plen
&&
msg_unpack_header
(
ppi
,
packet
,
plen
))
{
packet
=
NULL
;
plen
=
0
;
}
state
=
ppi
->
state
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment