W6100 DHCP 관련하여 문의 드립니다.

질문 1:
아래 DHCP 초기화 함수 중 DHCPv4_CHADDR[0] ~ DHCPv4_CHADDR[5] 값이 고정되어 있는데
만약 공유기 1대에 w6100을 사용한 여러대가 동시에 전원이 켜지고, DHCP를 요청하게 되어도 문제가 없나요?

void DHCPv4_init(uint8_t s, uint8_t * buf)
{
uint8_t zeroip[4] = {0,0,0,0};
getSHAR(DHCPv4_CHADDR);
if((DHCPv4_CHADDR[0] | DHCPv4_CHADDR[1] | DHCPv4_CHADDR[2] | DHCPv4_CHADDR[3] | DHCPv4_CHADDR[4] | DHCPv4_CHADDR[5]) == 0x00)
{
// assigning temporary mac address, you should be set SHAR before call this function.
DHCPv4_CHADDR[0] = 0x00;
DHCPv4_CHADDR[1] = 0x08;
DHCPv4_CHADDR[2] = 0xdc;
DHCPv4_CHADDR[3] = 0x00;
DHCPv4_CHADDR[4] = 0x00;
DHCPv4_CHADDR[5] = 0x00;
setSHAR(DHCPv4_CHADDR);
}

DHCPV4_SOCKET = s; // SOCK_DHCP
pDHCPv4MSG = (RIP_MSG*)buf;
DHCPV4_XID = 0x12345678;
{
	DHCPV4_XID += DHCPv4_CHADDR[3];
	DHCPV4_XID += DHCPv4_CHADDR[4];
	DHCPV4_XID += DHCPv4_CHADDR[5];
	DHCPV4_XID += (DHCPv4_CHADDR[3] ^ DHCPv4_CHADDR[4] ^ DHCPv4_CHADDR[5]);
}

// WIZchip Netinfo Clear
setSIPR(zeroip);
setGAR(zeroip);

reset_DHCPv4_timeout();
dhcpv4_state = STATE_DHCPV4_INIT;

}

질문 2:
공유기에 접속한 이후 IP임대시간 만료가 되면 어떻게 처리해야 하는지 궁금합니다.
DHCPv4_run() 을 주기적으로 실행하여 확인을 해야 하나요? 아니면 다른 방법이 있나요?
혹시 IP 임대시간 만료를 확인할 수 있는 예제가 있을까요?

항상 감사합니다.

Answer 1 in the code:

// assigning temporary mac address, you should be set SHAR before call this function.

If this code executes (due to the if condition being true) every device with this MAC address will receive same IP address.

Answer 2: this goes beyond the chip functionality and is defined in the DHCP protocol. In general you are right, when lease expires you must perform DHCP again. If you do not perform it current device will continue working, until DHCP accidentally leases this IP address to another network node.

Question 1:
Does each w6100 device need to request a different MAC address when running DHCP?

Question 2:
We found a way
Analyze the DHCP behavior and protocol

w5500_EVB DHCP Client code

See here.