This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RedBoot - more DHCP bugs


Failed to unregister the UDP handler which on some machines 
caused bad, dangling references.  Also, there was a potential
infinite loop during the DHCP request phase.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: redboot/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/ChangeLog,v
retrieving revision 1.135
diff -u -5 -p -r1.135 ChangeLog
--- redboot/current/ChangeLog	23 Sep 2003 17:08:31 -0000	1.135
+++ redboot/current/ChangeLog	24 Sep 2003 15:29:53 -0000
@@ -1,5 +1,11 @@
+2003-09-24  Gary Thomas  <gary@mlbassoc.com>
+
+	* src/net/bootp.c (__bootp_find_local_ip): Forgot to unregister
+	UDP handler - could cause serious problems later!  Also, fix
+	problem with retries after DHCP discovery phase.
+
 2003-09-23  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/net/bootp.c (__bootp_find_local_ip): Handle retries on DHCP 
 	requests better.
 
Index: redboot/current/src/net/bootp.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/redboot/current/src/net/bootp.c,v
retrieving revision 1.15
diff -u -5 -p -r1.15 bootp.c
--- redboot/current/src/net/bootp.c	23 Sep 2003 17:08:31 -0000	1.15
+++ redboot/current/src/net/bootp.c	24 Sep 2003 15:28:25 -0000
@@ -219,12 +219,12 @@ __bootp_find_local_ip(bootp_header_t *in
             AddOption(p,dhcpParamRequestList);
             AddOption(p,dhcpEnd);
             dhcpState = DHCP_DISCOVER;
             break;
         case DHCP_OFFER:
-        case DHCP_REQUEST:
             retry = MAX_RETRIES;
+        case DHCP_REQUEST:
             AddOption(p,dhcpCookie);
             AddOption(p,dhcpRequest);
             AddOption(p,dhcpRequestIP);
             memcpy(p, &bp_info->bp_yiaddr, 4);  p += 4;  // Ask for the address just given
             AddOption(p,dhcpParamRequestList);
@@ -284,10 +284,11 @@ __bootp_find_local_ip(bootp_header_t *in
                             break;
                         }
                     }
                     p += optlen;
                 }
+		__udp_remove_listener(IPPORT_BOOTPC);
                 return 0;
             }
 #else
             // All done, if address response has arrived
 	    if (__local_ip_addr[0] || __local_ip_addr[1] ||

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]