Problem with TCP socket on RTEMS 4.8.1 (ARM BSP)
Alex Zolotov
nightradio at gmail.com
Wed Aug 27 04:54:18 UTC 2008
I have a simple rtems server-application, that is waiting for connection
with telnet client.
It's working ok with RTEMS 4.7.99.1.
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.
**********************************************************************************************
There is source:
(program hangs on accept(...) function)
/* create TCP socket */
s = socket( AF_INET, SOCK_STREAM, 0 );
if( s < 0 ) ERROR;
/* bind to the port */
memset( &sa, 0, sizeof(sa) );
sa.sin_family = AF_INET;
sa.sin_port = htons( 23 );
sa.sin_addr.s_addr = htonl( INADDR_ANY );
if( bind( s, (struct sockaddr *)&sa, sizeof( sa ) ) < 0 ) ERROR;
/* start listening */
if( listen( s, 1 ) < 0 ) ERROR;
struct sockaddr_in sa2;
socklen_t addr_len;
int s2;
while( 1 )
{
addr_len = sizeof( sa2 );
memset( &sa2, 0, addr_len );
s2 = accept( s, (struct sockaddr*)&sa2, &addr_len );
....
....
}
...
/*
* Network configuration
*/
extern void rtems_bsdnet_loopattach();
static struct rtems_bsdnet_ifconfig loopback_config =
{
"lo0", /* name */
(int (*)(struct rtems_bsdnet_ifconfig *, int))rtems_bsdnet_loopattach,
NULL, /* link to next interface */
"127.0.0.1", /* IP address */
"255.0.0.0", /* IP net mask */
};
static struct rtems_bsdnet_ifconfig eth0_config =
{
RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */
RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach (ARM EMAC) */
&loopback_config, /* link to next interface */
MODULE_IP_ADDR0, /* IP address */
"255.255.255.0", /* IP net mask */
ethernet_address0, /* Ethernet hardware address */
0, 0, 0, 0, 0, 0, 0, NULL
};
struct rtems_bsdnet_config rtems_bsdnet_config =
{
ð0_config,
NULL,
0,
256 * 1024,
256 * 1024,
NULL,
NULL,
NULL,
NULL,
{NULL},
{NULL}
};
**********************************************************************************************
Debug messages in ethernet driver tells me, that rtems receiving all packets
correctly.
After enabling rtems libnetworking debug messages (#define TCPDEBUG in
cpukit/libnetworking/opt_tcpdebug.h) i see following:
???????? drop 0 at 0, urp=0
???????? drop 0 at 0, urp=0
???????? drop 0 at 0, urp=0
But, what is it mean? :)
Thanks for help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20080827/386093b4/attachment.html>
More information about the users
mailing list