code: 9ferno

Download patch

ref: 7191930290637622c1a4bb50a359809e62e4bf58
parent: f7a4f9314d76309fc5ec064014ace3ec9a112a24
author: 9ferno <gophone2015@gmail.com>
date: Sat Oct 23 16:19:27 EDT 2021

added debug prints

--- a/appl/lib/dhcpclient.b
+++ b/appl/lib/dhcpclient.b
@@ -584,6 +584,8 @@
 {
 	# INIT-REBOOT: know an address; try requesting it (once)
 	# TO DO: could use Inform when our address is static but we need a few service parameters
+	if(debug)
+		sys->print("reacquire\n");
 	req.ciaddr = ip->v4noaddr;
 	rep := request(srv, ++xidgen, req, (Oipaddr, addr.v4()) :: initopt);
 	if(rep != nil && rep.dhcpop == Ack && addr.eq(rep.yiaddr)){
@@ -600,6 +602,8 @@
 askround(srv: ref DhcpIO, req: ref Dhcp, initopt: list of (int, array of byte)): ref Dhcp
 {
 	# INIT
+	if(debug)
+		sys->print("askround\n");
 	req.ciaddr = ip->v4noaddr;
 	req.udphdr[Udpraddr:] = (ip->v4bcast).v6();
 	for(retries := 0; retries < 5; retries++){
@@ -929,7 +933,7 @@
 	sys->print("%s %s/%ud: ", dir, IPaddr.newv6(m.udphdr[Udpraddr:]).text(), get2(m.udphdr, Udprport));
 	if(m.dhcpop != NotDHCP)
 		s = " "+opname(m.dhcpop);
-	sys->print("op %d%s htype %d hops %d xid %ud\n", m.op, s, m.htype, m.hops, m.xid);
+	sys->print("op %d%s htype %d hops %d xid %ux\n", m.op, s, m.htype, m.hops, m.xid);
 	sys->print("\tsecs %d flags 0x%.4ux\n", m.secs, m.flags);
 	sys->print("\tciaddr %s\n", m.ciaddr.text());
 	sys->print("\tyiaddr %s\n", m.yiaddr.text());