lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] DHCP OK but TCP not? (Chen)


From: Pomeroy, Marty
Subject: Re: [lwip-users] DHCP OK but TCP not? (Chen)
Date: Fri, 21 Sep 2012 11:27:04 -0400

 
I honestly don't know if this is an issue, but on 1.4.0, my startup also calls tcpip_init as below:
 
   g_EmacSetMacFromRegs( (char *)&m_NetIF.hwaddr); // init MAC address from the hardware
   IP4_ADDR(&eth0gw, 192,168,0,1);
   IP4_ADDR(&eth0ipaddr, 0,0,0,0);  // for DHCP, start with this IP
   IP4_ADDR(&eth0netmask, 255,255,255,0);
 
   tcpip_init( NULL, NULL);
 
   netif_add( &m_NetIF, &eth0ipaddr, &eth0netmask, &eth0gw, NULL, ethernetif_init, tcpip_input);
 
   dhcp_start( &m_NetIF)
     ...
After DHCP completes, try ping it from a computer on the subnet.
 
HTH!
 
Marty
 


From: address@hidden [mailto:address@hidden On Behalf Of Chen
Sent: Thursday, September 20, 2012 3:54 PM
To: address@hidden
Subject: [lwip-users] DHCP OK but TCP not? (Chen)
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 );
    }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]