[PATCH] zcip defend problem

Patrick Noffke Patrick.Noffke at adpro.com.au
Wed Aug 23 00:15:17 UTC 2006


> -----Original Message-----
> From: busybox-bounces at busybox.net 
> [mailto:busybox-bounces at busybox.net]On
> Behalf Of Patrick Noffke
> Sent: Monday, 14 August 2006 11:10 AM
> To: BusyBox mailing list; uclibc at uclibc.org
> Subject: RE: Problem with zcip's packing of ARP packets?
> 
> 
> 
> Thanks, Jason.  That patch fixes the problem for me.  I've 
> submitted an issue for this problem, and attached your patch 
> to the issue report.  You can track the issue at:
> 
> http://bugs.busybox.net/view.php?id=993
> 

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.

I've attached a patch (against busybox 1.2.1), which also includes the fix where the target IP address was shifted by two bytes.  I'll update issue 993 with this patch.  Let me know if you see any problems with this patch.

Thanks,
Patrick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-1.2.1-zcip.patch
Type: application/octet-stream
Size: 10845 bytes
Desc: busybox-1.2.1-zcip.patch
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060823/b0ce8faf/attachment-0002.obj 


More information about the busybox mailing list