[Top][All Lists]
[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(ð0gw, 192,168,0,1);
IP4_ADDR(ð0ipaddr, 0,0,0,0); // for DHCP, start with this IP
IP4_ADDR(ð0netmask, 255,255,255,0);
tcpip_init( NULL, NULL);
netif_add( &m_NetIF, ð0ipaddr, ð0netmask, ð0gw, NULL,
ethernetif_init, tcpip_input);
dhcp_start(
&m_NetIF)
...
After DHCP completes, try ping it from a computer on the
subnet.
HTH!
Marty
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 );
}