uid patches

Kevin C. Miller kevinm at andrew.cmu.edu
Fri Mar 29 05:53:50 UTC 2002


So I've now done the following:

added to mdb.c (make_binding_state_transition, about line 1178)
	if (lease -> uid) {
                        uid_hash_delete (lease);
                        dfree (lease -> uid, MDL);
                        lease -> uid_len = 0;
                        lease -> uid_max = 0;
                        lease -> uid = (unsigned char*)0;
                }

I needed to add the uid_hash_delete to properly get rid of the uid 
(otherwise we were spinning.. oops)

Added the same about line 1236 below that (for the released case).

Subsequently, we were deleting uid's on the primary, but not the 
secondary. It looks to me like the problem is that in 
dhcp_failover_process_bind_update, we change the "new lease" (lt) to 
be next_binding_state = free, where binding_state = active. So 
entering make_binding_state_transition, we don't enter the block for 
clearing the uid components, due to this test:

mdb.c:(~1135):
#if defined (FAILOVER_PROTOCOL)
	peer &&
                    (lease -> binding_state == FTS_EXPIRED)
                    &&
                    (lease -> next_binding_state == FTS_FREE ||
                     lease -> next_binding_state == FTS_BACKUP)) ||


So I am testing a change of this to:

#if defined (FAILOVER_PROTOCOL)
	peer &&
                    (lease -> binding_state == FTS_ACTIVE ||
                     lease -> binding_state == FTS_EXPIRED)
                    &&

Preliminarily, that seems to work.

These changes aren't in patch format yet, though assuming this makes 
sense I'm going to update my scattered changes to rc8 (still based on 
rc6) and make some real patches.

-Kevin
---------------------------------------------------
Kevin C. Miller <kcm at cmu.edu>
Network Group
Carnegie Mellon University


More information about the dhcp-hackers mailing list