Hi there,

I have been developing my project using static IP and every works great, now I wanted to turn on DHCP

Bad news, DHCP got the IP assigned, but I can't connect to it via TCP anymore (UDP works fine), and the only difference in codes are

   if (DHCP){
        //This gets the IP, but I can't open via TCP
           IP4_ADDR( &xIpAddr,0,0,0,0 );
           IP4_ADDR( &xNetMask,255,255,255,0 );
           IP4_ADDR( &xGateway,0,0,0,0 );
netif_add( &MACB_if, &xIpAddr, &xNetMask, &xGateway, NULL, ethernetif_init, tcpip_input );

           netif_set_default( &MACB_if );

           dhcp_start(&MACB_if);
   }
   else{
        //This works perfectly
           IP4_ADDR( &xIpAddr,myIP[0],myIP[1],myIP[2],myIP[3]);
           IP4_ADDR( &xNetMask,255,255,255,0 );
           IP4_ADDR( &xGateway,0,0,0,0 );
netif_add( &MACB_if, &xIpAddr, &xNetMask, &xGateway, NULL, ethernetif_init, tcpip_input );

           netif_set_default( &MACB_if );
           netif_set_up( &MACB_if );
   }

......
//If DHCP is used, it will not returned from this call
clientfd = lwip_accept(lSocket, (struct sockaddr*)&client_addr, (socklen_t)&addrlen);


I am using lwip 1.32 on AVR32. Is there a known bug like this?

Thanks for your time!

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to