On 08/05/2020 06:48, Hesham Almatary wrote:
Hello Chris,

Currently sample/loopback.exe fails on risc64 with that error:

*** BEGIN OF TEST LOOPBACK ***
*** TEST VERSION: 5.0.0.e78c0806cbbf0c9fae5c8c355ea81636b704f908
*** TEST STATE: EXPECTED_PASS
*** TEST BUILD: RTEMS_NETWORKING RTEMS_POSIX_API
*** TEST TOOLS: 9.3.0 20200312 (RTEMS 5, RSB 5 (1011d5f76851), Newlib 7947581)
"Network" initializing!
"Network" initialized!
Try running client with no server present.
Should fail with `connection refused'.
Connect to server.
tcphdr too big
*** FATAL ***
fatal source: 11 (RTEMS_FATAL_SOURCE_PANIC)
fatal code: 2147715424 (0x80038960)
RTEMS version: 5.0.0.e78c0806cbbf0c9fae5c8c355ea81636b704f908
RTEMS tools: 9.3.0 20200312 (RTEMS 5, RSB 5 (1011d5f76851), Newlib 7947581)
executing thread ID: 0x08a010001
executing thread name: UI1


The "tcphdr too big" error is at
cpukit/libnetworking/netinet/tcp_output.c:458, failing that check:
if (max_linkhdr + hdrlen > MHLEN)
  panic("tcphdr too big");
On riscv64:
hdrlen = 76
max_linkhdr = 16
optlen = 20
sizeof (struct tcpiphdr) = 56
MHLEN = 72

The problem is probably this:

/*
 * Overlay for ip header used by other protocols (tcp, udp).
 */
struct ipovly {
    caddr_t    ih_next;
    caddr_t ih_prev;        /* for protocol sequence q's */
    u_char    ih_x1;            /* (unused) */
    u_char    ih_pr;            /* protocol */
    u_short    ih_len;            /* protocol length */
    struct    in_addr ih_src;        /* source internet address */
    struct    in_addr ih_dst;        /* destination internet address */
};

The caddr_t is a pointer. This is what I meant with a lot more problems.

In the new stack we have:

/*
 * Overlay for ip header used by other protocols (tcp, udp).
 */
struct ipovly {
    u_char    ih_x1[9];        /* (unused) */
    u_char    ih_pr;            /* protocol */
    u_short    ih_len;            /* protocol length */
    struct    in_addr ih_src;        /* source internet address */
    struct    in_addr ih_dst;        /* destination internet address */
};

I am not sure if the old stack ever worked on a 64-bit target.

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to