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
613bceea
Commit
613bceea
authored
8 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
netdev2_tap: return actual byte number on read request
parent
c3faf49d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cpu/native/include/cpu_conf.h
+0
-5
0 additions, 5 deletions
cpu/native/include/cpu_conf.h
cpu/native/netdev2_tap/netdev2_tap.c
+5
-3
5 additions, 3 deletions
cpu/native/netdev2_tap/netdev2_tap.c
with
5 additions
and
8 deletions
cpu/native/include/cpu_conf.h
+
0
−
5
View file @
613bceea
...
...
@@ -55,11 +55,6 @@ extern "C" {
*/
#define NATIVE_ETH_PROTO 0x1234
#if (defined(GNRC_PKTBUF_SIZE)) && (GNRC_PKTBUF_SIZE < 2048)
# undef GNRC_PKTBUF_SIZE
# define GNRC_PKTBUF_SIZE (2048)
#endif
#ifdef __cplusplus
}
#endif
...
...
This diff is collapsed.
Click to expand it.
cpu/native/netdev2_tap/netdev2_tap.c
+
5
−
3
View file @
613bceea
...
...
@@ -215,6 +215,8 @@ static int _recv(netdev2_t *netdev2, void *buf, size_t len, void *info)
(
void
)
info
;
if
(
!
buf
)
{
int
waiting_bytes
;
if
(
len
>
0
)
{
/* no memory available in pktbuf, discarding the frame */
DEBUG
(
"netdev2_tap: discarding the frame
\n
"
);
...
...
@@ -234,9 +236,9 @@ static int _recv(netdev2_t *netdev2, void *buf, size_t len, void *info)
_continue_reading
(
dev
);
}
/*
no way of figuring out packet size without racey buffering,
* so we return the maximum possible size */
return
ETHERNET_FRAME_LEN
;
/*
get number of waiting bytes at dev->tap_fd */
real_ioctl
(
dev
->
tap_fd
,
FIONREAD
,
&
waiting_bytes
);
return
waiting_bytes
;
}
int
nread
=
real_read
(
dev
->
tap_fd
,
buf
,
len
);
...
...
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