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
de34b965
Commit
de34b965
authored
7 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
SIOCGIFCONF and SIOCGLIFCONF IOCTL commands should only report on network adatpors in the UP state.
parent
abcaedb9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
net/netdev/netdev_ifconf.c
+16
-8
16 additions, 8 deletions
net/netdev/netdev_ifconf.c
with
16 additions
and
8 deletions
net/netdev/netdev_ifconf.c
+
16
−
8
View file @
de34b965
...
...
@@ -81,7 +81,7 @@ struct ifconf_ipv6_info_s
*
* Description:
* Callback from netdev_foreach() that does the real implementation of
* netdev_ipv4_ifconf
* netdev_ipv4_ifconf
().
*
* Parameters:
* dev - The network device for this callback.
...
...
@@ -102,9 +102,12 @@ static int ifconf_ipv4_callback(FAR struct net_driver_s *dev, FAR void *arg)
DEBUGASSERT
(
dev
!=
NULL
&&
info
!=
NULL
&&
info
->
ifc
!=
NULL
);
ifc
=
info
->
ifc
;
/* Check if this adaptor has an IPv4 address assigned */
/* Check if this adaptor has an IPv4 address assigned and is in the UP
* state.
*/
if
(
!
net_ipv4addr_cmp
(
dev
->
d_ipaddr
,
INADDR_ANY
))
if
(
!
net_ipv4addr_cmp
(
dev
->
d_ipaddr
,
INADDR_ANY
)
&&
(
dev
->
d_flags
&
IFF_UP
)
!=
0
)
{
/* Check if we would exceed the buffer space provided by the caller.
* NOTE: A common usage model is:
...
...
@@ -155,7 +158,7 @@ static int ifconf_ipv4_callback(FAR struct net_driver_s *dev, FAR void *arg)
*
* Description:
* Callback from netdev_foreach() that does the real implementation of
* netdev_ipv6_ifconf
* netdev_ipv6_ifconf
().
*
* Parameters:
* dev - The network device for this callback.
...
...
@@ -176,9 +179,12 @@ static int ifconf_ipv6_callback(FAR struct net_driver_s *dev, FAR void *arg)
DEBUGASSERT
(
dev
!=
NULL
&&
info
!=
NULL
&&
info
->
lifc
!=
NULL
);
lifc
=
info
->
lifc
;
/* Check if this adaptor has an IPv6 address assigned */
/* Check if this adaptor has an IPv6 address assigned and is in the UP
* state.
*/
if
(
!
net_ipv6addr_cmp
(
dev
->
d_ipv6addr
,
g_ipv6_allzeroaddr
))
if
(
!
net_ipv6addr_cmp
(
dev
->
d_ipv6addr
,
g_ipv6_allzeroaddr
)
&&
(
dev
->
d_flags
&
IFF_UP
)
!=
0
)
{
/* Check if we would exceed the buffer space provided by the caller.
* NOTE: A common usage model is:
...
...
@@ -232,7 +238,8 @@ static int ifconf_ipv6_callback(FAR struct net_driver_s *dev, FAR void *arg)
* Name: netdev_ipv4_ifconf
*
* Description:
* Return the IPv4 configuration of each network adaptor
* Return the IPv4 configuration of each network adaptor that (1) has
* and IPv4 address assigned and (2) is in the UP state
*
* Parameters:
* ifc - A reference to the instance of struct ifconf in which to return
...
...
@@ -264,7 +271,8 @@ int netdev_ipv4_ifconf(FAR struct ifconf *ifc)
* Name: netdev_ipv6_ifconf
*
* Description:
* Return the IPv6 configuration of each network adaptor
* Return the IPv6 configuration of each network adaptor that (1) has
* and IPv6 address assigned and (2) is in the UP state.
*
* Parameters:
* lifc - A reference to the instance of struct lifconf in which to return
...
...
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