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
34509a9a
Commit
34509a9a
authored
9 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
UDP should use dev=NULL if the address in the lookup is INADDR_ANY
parent
75346a4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net/udp/udp_finddev.c
+28
-0
28 additions, 0 deletions
net/udp/udp_finddev.c
with
28 additions
and
0 deletions
net/udp/udp_finddev.c
+
28
−
0
View file @
34509a9a
...
...
@@ -79,6 +79,19 @@ FAR struct net_driver_s *udp_find_ipv4_device(FAR struct udp_conn_s *conn,
#ifdef CONFIG_NETDEV_MULTINIC
FAR
struct
net_driver_s
*
dev
;
/* Return NULL if the address is INADDR_ANY. In this case, there is
* there may be multiple devices that can provide data so the exceptional
* events from any particular device are not important.
*
* Of course, it would be a problem if this is the remote address of
* sendto().
*/
if
(
ipv4addr
==
INADDR_ANY
)
{
return
NULL
;
}
/* There are multiple network devices. We need to select the device that
* is going to route the UDP packet based on the provided IP address.
*/
...
...
@@ -86,6 +99,8 @@ FAR struct net_driver_s *udp_find_ipv4_device(FAR struct udp_conn_s *conn,
return
netdev_findby_ipv4addr
(
conn
->
u
.
ipv4
.
laddr
,
ipv4addr
);
#else
/* Return NULL if the address is IN6ADDR_ANY */
/* There is only a single network device... the one at the head of the
* g_netdevices list.
*/
...
...
@@ -116,6 +131,19 @@ FAR struct net_driver_s *udp_find_ipv6_device(FAR struct udp_conn_s *conn,
#ifdef CONFIG_NETDEV_MULTINIC
FAR
struct
net_driver_s
*
dev
;
/* Return NULL if the address is IN6ADDR_ANY. In this case, there is
* there may be multiple devices that can provide data so the exceptional
* events from any particular device are not important.
*
* Of course, it would be a problem if this is the remote address of
* sendto().
*/
if
(
net_ipv4addr_cmp
(
conn
->
u
.
ipv4
.
laddr
,
g_ipv4_allzeroaddr
))
{
return
NULL
;
}
/* There are multiple network devices. We need to select the device that
* is going to route the UDP packet based on the provided IP address.
*/
...
...
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