From 83e36d6bb77038d01d07bdf62a3037a01284bfdb Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 11 Feb 2003 22:58:08 +0000 Subject: 2003-02-11 Mike Siers * rtems/rtems_glue.c: A small patch to the network daemon task code. I just added code to check the return value of the rtems_bsdnet_event_receive function. Only when this function returns a SUCCESSFUL status, will the event flags be checked. This is more of a code cleanup issue than a bug. The patch will just ensure the ipintr() and arpintr() functions are only called when a event is signaled. --- cpukit/libnetworking/ChangeLog | 10 ++++++++++ cpukit/libnetworking/rtems/rtems_glue.c | 15 ++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) (limited to 'cpukit') diff --git a/cpukit/libnetworking/ChangeLog b/cpukit/libnetworking/ChangeLog index f875c98380..fdd7e2f2ff 100644 --- a/cpukit/libnetworking/ChangeLog +++ b/cpukit/libnetworking/ChangeLog @@ -1,3 +1,13 @@ +2003-02-11 Mike Siers + + * rtems/rtems_glue.c: A small patch to the network daemon task + code. I just added code to check the return value of + the rtems_bsdnet_event_receive function. Only when + this function returns a SUCCESSFUL status, will the + event flags be checked. This is more of a code cleanup issue + than a bug. The patch will just ensure the ipintr() and + arpintr() functions are only called when a event is signaled. + 2003-02-11 Ralf Corsepius * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c index cf3b0925c8..4ed1455cff 100644 --- a/cpukit/libnetworking/rtems/rtems_glue.c +++ b/cpukit/libnetworking/rtems/rtems_glue.c @@ -503,6 +503,7 @@ rtems_bsdnet_schednetisr (int n) static void networkDaemon (void *task_argument) { + rtems_status_code sc; rtems_event_set events; rtems_interval now; int ticksPassed; @@ -515,14 +516,18 @@ networkDaemon (void *task_argument) timeout = c->c_time; else timeout = RTEMS_NO_TIMEOUT; - rtems_bsdnet_event_receive (NETISR_EVENTS, + + sc = rtems_bsdnet_event_receive (NETISR_EVENTS, RTEMS_EVENT_ANY | RTEMS_WAIT, timeout, &events); - if (events & NETISR_IP_EVENT) - ipintr (); - if (events & NETISR_ARP_EVENT) - arpintr (); + if ( sc == RTEMS_SUCCESSFUL ) { + if (events & NETISR_IP_EVENT) + ipintr (); + if (events & NETISR_ARP_EVENT) + arpintr (); + } + rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now); ticksPassed = now - ticksWhenCalloutsLastChecked; if (ticksPassed != 0) { -- cgit v1.2.3