BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001005 [BusyBox] Networking Support major always 08-22-06 17:19 09-03-06 05:33
Reporter pnoffke View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.2.x
Summary 0001005: zcip does not claim another IP after defending
Description I've discovered another problem with zcip. When an IP address has been claimed, the defending did not work properly. When I set another host to use the claimed IP address, zcip would deconfig the IP, but never grab another one.

I've tracked it down to improper use of the poll function. The code had previously used a return value of 0 (timeout) to trigger state transitions, and a return value of 1 (packets arriving) for conflict detection. However when probing, if a packet arrived, this would result in the timeout getting set to -1 (infinite) and the probing would never continue. I've modified zcip to use a state machine, with 5 states:

PROBE
RATE_LIMITED_PROBE
ANNOUNCE
MONITOR
DEFEND

It moves through these states according to RFC 3927. For example, three timeouts (with no conflicts arriving) in the PROBE state cause a transition to the ANNOUNCE state. Or if a conflict is detected in the MONITOR state, it sends a single ARP and moves to the DEFEND state. If another conflict arrives in the DEFEND state, we go back to the PROBE state and start all over again.

I hope the code is easier to follow -- I know it was much easier to debug this way.
Additional Information Patch is attached. This patch also fixes the problem described in issue 993 where the target IP address was shifted by two bytes.
Attached Files  busybox-1.2.1-zcip.patch [^] (10,845 bytes) 08-22-06 17:19
 busybox-1.2.1-zcip-fix-memcmp.patch [^] (11,128 bytes) 08-25-06 01:28

- Relationships

- Notes
(0001578)
pnoffke
08-22-06 21:20

Jason Schoon has pointed out this was fixed here:

http://www.busybox.net/lists/busybox/2006-March/019881.html [^]

I have tested on 1.2.1 and it seems to work. I upgraded from 1.1.1 to 1.2.1 prior to writing the patch, and did not test after upgrading to confirm whether the defending worked.

You may still wish to apply the patch if you prefer the state machine implementation. Personally I find it easier to follow the code this way, but whether that is reason enough to patch it isn't my call. As far as I can tell everything works correctly with my patch.
 
(0001585)
pnoffke
08-25-06 01:28

Updated patch to use memcmp when comparing IP addresses.
 
(0001605)
vda
09-03-06 05:33

Applied
 

- Issue History
Date Modified Username Field Change
08-22-06 17:19 pnoffke New Issue
08-22-06 17:19 pnoffke Status new => assigned
08-22-06 17:19 pnoffke Assigned To  => BusyBox
08-22-06 17:19 pnoffke File Added: busybox-1.2.1-zcip.patch
08-22-06 17:19 pnoffke Issue Monitored: pnoffke
08-22-06 21:20 pnoffke Note Added: 0001578
08-25-06 01:28 pnoffke File Added: busybox-1.2.1-zcip-fix-memcmp.patch
08-25-06 01:28 pnoffke Note Added: 0001585
09-03-06 05:33 vda Status assigned => closed
09-03-06 05:33 vda Note Added: 0001605
09-03-06 05:33 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker