Forum Discussion
Altera_Forum
Honored Contributor
15 years agoSorry to re-open this thread, but I had the same problem.
Your code worked for me, except for DHCP. This one does:
if(dhcp_actv)
{
p_net -> n_flags |= NF_DHCPC;
// dhc_setup(); // fails, because port is in use?
dhc_state_init(0, FALSE); /* Put DHCPClient in INIT-REBOOT state */
int e = dhc_second(); /* To send the DISCOVER/REQUEST pkt */
if (e)
printf("DHCP returned error %i.\n", e);
}
In dhc_setup(), calling dhc_first() fails , probably because the port is already in use. So I just called dhc_second, is it's done in dhc_setup(). Works for me.