Bug 708385 - rwhod doesn't transmit reliably if using DHCP
Summary: rwhod doesn't transmit reliably if using DHCP
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: rwho
Version: 14
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Honza Horak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-27 14:20 UTC by Ian Donaldson
Modified: 2011-06-15 05:34 UTC (History)
1 user (show)

Fixed In Version: rwho-0.17-35.fc14
Clone Of:
Environment:
Last Closed: 2011-06-11 04:30:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ian Donaldson 2011-05-27 14:20:47 UTC
Description of problem:

rwhod receives but doesn't transmit reliably if using DHCP (eg: via NetworkManager)

Version-Release number of selected component (if applicable):

rwho-0.17-33.fc14.x86_64


How reproducible:

Easy, but its a race condition.

Steps to Reproduce:
1. start system
2. wait 5 minutes, then do 'ruptime' on another system
3. note your system isn't showing as up (or at all possibly)
  
Actual results:

not up or missing in ruptime output

Expected results:

system up in ruptime output

Additional info:


When DHCP is in use, the UP interface list may not be finalized by
the time rwhod starts, and rwhod only scans the interface list at
startup.

The following patch addresses this by scanning the interface list
every time just prior to transmitting new information, allowing
the network details to change completely since the previous transmission.

--
*** rwhod.c_pre Sat May 28 00:11:51 2011
--- rwhod.c     Sat May 28 00:12:15 2011
***************
*** 383,388 ****
--- 383,390 ----
        getboottime(&mywd);
  
        while (1) {
+               if (!configure(sk))
+                       exit(1);
                sendpacket(&mywd);
                (void) sleep(AL_INTERVAL);
        }
***************
*** 603,608 ****
--- 605,624 ----
        struct sockaddr_in *sn;
        register struct neighbor *np;
  
+       /* forget previous neighbors; interfaces may have changed */
+       for (np = neighbors; np != NULL; ) {
+               register struct neighbor *pp;
+ 
+               if(np->n_name)
+                       free(np->n_name);
+               if(np->n_addr)
+                       free(np->n_addr);
+               pp = np;
+               np = np->n_next;
+               free((char *)pp);
+       }
+       neighbors = 0;
+ 
        ifc.ifc_len = sizeof (buf);
        ifc.ifc_buf = (char *)buf;
        if (ioctl(s, SIOCGIFCONF, &ifc) < 0) {


--

Comment 1 Honza Horak 2011-06-02 09:40:14 UTC
Ian, thanks for reporting, I'll apply the changes as proposed while they fixes the issue for me too. 

This is a reliable way how to reproduce:
1. run rhowd service on system A
2. stop network on system B
3. start rwhod service on system B
4. wait 12 minutes to mark system B as down (not necessary if wasn't up yet)
5. run 'ruptime' on system A: system B is reported as 'down'
6. start network on system B
7. wait a bit more than 4 minutes
8. run 'ruptime' on system A: system B is still reported as 'down'

Comment 2 Fedora Update System 2011-06-02 10:38:22 UTC
rwho-0.17-35.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/rwho-0.17-35.fc15

Comment 3 Fedora Update System 2011-06-02 10:41:09 UTC
rwho-0.17-35.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/rwho-0.17-35.fc14

Comment 4 Fedora Update System 2011-06-03 05:28:42 UTC
Package rwho-0.17-35.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing rwho-0.17-35.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/rwho-0.17-35.fc15
then log in and leave karma (feedback).

Comment 5 Ian Donaldson 2011-06-06 09:16:19 UTC
I've tried the FC14 version and it seems ok.  Can't test the FC15 one here
as I have no FC15 installs yet.

Comment 6 Fedora Update System 2011-06-11 04:30:00 UTC
rwho-0.17-35.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2011-06-15 05:34:05 UTC
rwho-0.17-35.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.