Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net:modify check condition from IFF_UP to IFF_RUNNING in sendto_next_transfer #193

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion net/arp/arp_acd.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void arp_acd_set_addr(FAR struct net_driver_s *dev)
if (!net_ipv4addr_cmp(dev->d_ipaddr, INADDR_ANY))
{
dev->d_acd.need_announce = true;
if (IFF_IS_UP(dev->d_flags))
if (IFF_IS_RUNNING(dev->d_flags))
{
arp_acd_setup(dev);
}
Expand Down
2 changes: 1 addition & 1 deletion net/igmp/igmp_leave.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int igmp_leavegroup(struct net_driver_s *dev,

/* Send a leave if the flag is set according to the state diagram */

if (IFF_IS_UP(dev->d_flags) && IS_LASTREPORT(group->flags))
if (IFF_IS_RUNNING(dev->d_flags) && IS_LASTREPORT(group->flags))
{
ninfo("Schedule Leave Group message\n");
IGMP_STATINCR(g_netstats.igmp.leave_sched);
Expand Down
5 changes: 3 additions & 2 deletions net/ipforward/ipv4_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,10 @@ static int ipv4_forward_callback(FAR struct net_driver_s *fwddev,

DEBUGASSERT(fwddev != NULL);

/* Only IFF_UP device and non-loopback device need forward packet */
/* Only IFF_RUNNING device and non-loopback device need forward packet */

if (!IFF_IS_UP(fwddev->d_flags) || fwddev->d_lltype == NET_LL_LOOPBACK)
if (!IFF_IS_RUNNING(fwddev->d_flags) ||
fwddev->d_lltype == NET_LL_LOOPBACK)
{
return OK;
}
Expand Down
7 changes: 4 additions & 3 deletions net/ipforward/ipv6_forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev,

/* If the interface isn't "up", we can't forward. */

if ((fwddev->d_flags & IFF_UP) == 0)
if (IFF_IS_RUNNING(fwddev->d_flags) == 0)
{
nwarn("WARNING: device is DOWN\n");
ret = -EHOSTUNREACH;
Expand Down Expand Up @@ -510,9 +510,10 @@ static int ipv6_forward_callback(FAR struct net_driver_s *fwddev,

DEBUGASSERT(fwddev != NULL);

/* Only IFF_UP device and non-loopback device need forward packet */
/* Only IFF_RUNNING device and non-loopback device need forward packet */

if (!IFF_IS_UP(fwddev->d_flags) || fwddev->d_lltype == NET_LL_LOOPBACK)
if (!IFF_IS_RUNNING(fwddev->d_flags) ||
fwddev->d_lltype == NET_LL_LOOPBACK)
{
return OK;
}
Expand Down
6 changes: 3 additions & 3 deletions net/netdev/netdown_notifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ int netdown_notifier_setup(worker_t worker, FAR struct net_driver_s *dev,

DEBUGASSERT(worker != NULL);

/* If network driver is already down, then return zero without setting up
* the notification.
/* If network driver is already not yet running,
* then return zero without setting up the notification.
*/

if ((dev->d_flags & IFF_UP) == 0)
if (IFF_IS_RUNNING(dev->d_flags) == 0)
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion net/procfs/netdev_statistics.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int netprocfs_linklayer(FAR struct netprocfs_file_s *netfile)

/* Get the interface status: RUNNING, UP, or DOWN */

if ((dev->d_flags & IFF_RUNNING) != 0)
if (IFF_IS_RUNNING(dev->d_flags) != 0)
{
status = "RUNNING";
}
Expand Down
4 changes: 2 additions & 2 deletions net/udp/udp_sendto_buffered.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ static int sendto_next_transfer(FAR struct udp_conn_s *conn)

/* Make sure that the device is in the UP state */

if ((dev->d_flags & IFF_UP) == 0)
if (IFF_IS_RUNNING(dev->d_flags) == 0)
{
nwarn("WARNING: device is DOWN\n");
nwarn("WARNING: device is not RUNNING\n");
return -EHOSTUNREACH;
}

Expand Down
2 changes: 1 addition & 1 deletion net/udp/udp_sendto_unbuffered.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ ssize_t psock_udp_sendto(FAR struct socket *psock, FAR const void *buf,

/* Make sure that the device is in the UP state */

if ((state.st_dev->d_flags & IFF_UP) == 0)
if (IFF_IS_RUNNING(state.st_dev->d_flags) == 0)
{
nwarn("WARNING: device is DOWN\n");
ret = -EHOSTUNREACH;
Expand Down
Loading