Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
bcc
Commits
febb97e1
Commit
febb97e1
authored
Jun 09, 2015
by
4ast
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #43 from iovisor/dext-fix
Fix for >32B bpf_pkt_dext calls
parents
dff16eb3
56e51634
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/cc/export/helpers.h
src/cc/export/helpers.h
+4
-2
No files found.
src/cc/export/helpers.h
View file @
febb97e1
...
...
@@ -147,7 +147,7 @@ static inline unsigned __int128 bpf_hton128(unsigned __int128 val) {
}
static
inline
u64
load_dword
(
void
*
skb
,
u64
off
)
{
return
((
u64
)
load_word
(
skb
,
off
)
<<
4
)
|
load_word
(
skb
,
off
+
4
);
return
((
u64
)
load_word
(
skb
,
off
)
<<
32
)
|
load_word
(
skb
,
off
+
4
);
}
void
bpf_store_byte
(
void
*
skb
,
u64
off
,
u64
val
)
asm
(
"llvm.bpf.store.byte"
);
...
...
@@ -179,8 +179,10 @@ u64 bpf_dext_pkt(void *pkt, u64 off, u64 bofs, u64 bsz) {
return
load_word
(
pkt
,
off
);
}
else
if
(
bofs
+
bsz
<=
32
)
{
return
load_word
(
pkt
,
off
)
>>
(
32
-
(
bofs
+
bsz
))
&
MASK
(
bsz
);
}
else
if
(
bofs
==
0
&&
bsz
==
64
)
{
return
load_dword
(
pkt
,
off
);
}
else
if
(
bofs
+
bsz
<=
64
)
{
return
bpf_ntohll
(
load_dword
(
pkt
,
off
)
)
>>
(
64
-
(
bofs
+
bsz
))
&
MASK
(
bsz
);
return
load_dword
(
pkt
,
off
)
>>
(
64
-
(
bofs
+
bsz
))
&
MASK
(
bsz
);
}
return
0
;
}
...
...
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