<div dir="ltr">I have a simple rtems server-application, that is waiting for connection with telnet client.<br>It's working ok with RTEMS <a href="http://4.7.99.1">4.7.99.1</a>. <br>But after compiling with 4.8.1 my application is not working correctly anymore. It still can send/receive UDP packets and answer on pings without problems. But external telnet-client can't establish connection with this app.<br>
<br>**********************************************************************************************<br>
There is source:<br>(program hangs on accept(...) function)<br><br>/* create TCP socket */<br>s = socket( AF_INET, SOCK_STREAM, 0 );<br>if( s < 0 ) ERROR;<br><br>/* bind to the port */<br>memset( &sa, 0, sizeof(sa) );<br>
sa.sin_family = AF_INET;<br>sa.sin_port = htons( 23 );<br>sa.sin_addr.s_addr = htonl( INADDR_ANY );<br>if( bind( s, (struct sockaddr *)&sa, sizeof( sa ) ) < 0 ) ERROR;<br><br>/* start listening */<br>if( listen( s, 1 ) < 0 ) ERROR;<br>
struct sockaddr_in sa2;<br>socklen_t addr_len;<br>int s2;<br>while( 1 )<br>{<br> addr_len = sizeof( sa2 );<br> memset( &sa2, 0, addr_len );<br> s2 = accept( s, (struct sockaddr*)&sa2, &addr_len );<br>
....<br> ....<br>}<br><br>...<br><br>/*<br> * Network configuration<br> */<br>extern void rtems_bsdnet_loopattach();<br>static struct rtems_bsdnet_ifconfig loopback_config =<br>{<br> "lo0", /* name */<br>
(int (*)(struct rtems_bsdnet_ifconfig *, int))rtems_bsdnet_loopattach,<br> NULL, /* link to next interface */<br> "<a href="http://127.0.0.1">127.0.0.1</a>", /* IP address */<br>
"<a href="http://255.0.0.0">255.0.0.0</a>", /* IP net mask */<br>};<br>static struct rtems_bsdnet_ifconfig eth0_config =<br>{<br> RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */<br> RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach (ARM EMAC) */<br>
&loopback_config, /* link to next interface */<br> MODULE_IP_ADDR0, /* IP address */<br> "<a href="http://255.255.255.0">255.255.255.0</a>", /* IP net mask */<br>
ethernet_address0, /* Ethernet hardware address */<br> 0, 0, 0, 0, 0, 0, 0, NULL<br>};<br>struct rtems_bsdnet_config rtems_bsdnet_config =<br>{<br> ð0_config,<br> NULL,<br> 0,<br> 256 * 1024,<br>
256 * 1024,<br> NULL,<br> NULL,<br> NULL,<br> NULL,<br> {NULL},<br> {NULL}<br>};<br>**********************************************************************************************<br>
<br>Debug messages in ethernet driver tells me, that rtems receiving all packets correctly.<br><br>After enabling rtems libnetworking debug messages (#define TCPDEBUG in cpukit/libnetworking/opt_tcpdebug.h) i see following:<br>
???????? drop 0@0, urp=0<br>???????? drop 0@0, urp=0<br>???????? drop 0@0, urp=0<br>But, what is it mean? :)<br><br>Thanks for help.<br>
</div>