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
4bfaf7ba
Commit
4bfaf7ba
authored
Jul 03, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch-spec: fix offset for eth header
parent
4792348d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
main-loop.c
arch-spec/main-loop.c
+7
-3
No files found.
arch-spec/main-loop.c
View file @
4bfaf7ba
...
...
@@ -14,6 +14,10 @@ void spec_main_loop(struct pp_instance *ppi)
{
int
i
,
delay_ms
;
const
int
eth_ofst
=
sizeof
(
struct
spec_ethhdr
);
/*pp_diag_verbosity = 1;*/
/* SPEC is raw ethernet by default */
NP
(
ppi
)
->
proto_ofst
=
eth_ofst
;
/*
* The main loop here is polling every ms. While we are not
* doing anything else but the protocol, this allows extra stuff
...
...
@@ -39,8 +43,8 @@ void spec_main_loop(struct pp_instance *ppi)
if
(
0
)
{
int
j
;
pp_printf
(
"recvd: %i
\n
"
,
i
);
for
(
j
=
0
;
j
<
i
;
j
++
)
{
pp_printf
(
"%02x "
,
packet
[
j
]);
for
(
j
=
0
;
j
<
i
-
eth_ofst
;
j
++
)
{
pp_printf
(
"%02x "
,
packet
[
j
+
eth_ofst
]);
if
(
(
j
+
1
)
%
16
==
0
)
pp_printf
(
"
\n
"
);
}
...
...
@@ -50,6 +54,6 @@ void spec_main_loop(struct pp_instance *ppi)
if
(((
struct
spec_ethhdr
*
)
packet
)
->
h_proto
!=
htons
(
PP_ETHERTYPE
))
continue
;
delay_ms
=
pp_state_machine
(
ppi
,
packet
+
sizeof
(
struct
spec_ethhdr
),
i
);
delay_ms
=
pp_state_machine
(
ppi
,
packet
+
eth_ofst
,
i
-
eth_ofst
);
}
}
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