Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
f4grx
NuttX RTOS
Commits
fa3ad468
Commit
fa3ad468
authored
7 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
net/udp: In sendto(), return EHOSTUNREACH if if the network is down.
parent
fef255e5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
net/udp/udp_psock_sendto_buffered.c
+8
-0
8 additions, 0 deletions
net/udp/udp_psock_sendto_buffered.c
net/udp/udp_psock_sendto_unbuffered.c
+9
-0
9 additions, 0 deletions
net/udp/udp_psock_sendto_unbuffered.c
with
17 additions
and
0 deletions
net/udp/udp_psock_sendto_buffered.c
+
8
−
0
View file @
fa3ad468
...
...
@@ -384,6 +384,14 @@ static int sendto_next_transfer(FAR struct socket *psock,
return
-
ENETUNREACH
;
}
/* Make sure that the device is in the UP state */
if
((
dev
->
d_flags
&
IFF_UP
)
==
0
)
{
nwarn
(
"WARNING: device is DOWN
\n
"
);
return
-
EHOSTUNREACH
;
}
/* If this is not the same device that we used in the last call to
* udp_callback_alloc(), then we need to release and reallocate the old
* callback instance.
...
...
This diff is collapsed.
Click to expand it.
net/udp/udp_psock_sendto_unbuffered.c
+
9
−
0
View file @
fa3ad468
...
...
@@ -424,6 +424,15 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf,
goto
errout_with_lock
;
}
/* Make sure that the device is in the UP state */
if
((
dev
->
d_flags
&
IFF_UP
)
==
0
)
{
nwarn
(
"WARNING: device is DOWN
\n
"
);
ret
=
-
EHOSTUNREACH
;
goto
errout_with_lock
;
}
/* Set up the callback in the connection */
state
.
st_cb
=
udp_callback_alloc
(
dev
,
conn
);
...
...
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