[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] mem alignment issue when updating to Rev 1.4.1
From: |
tm264 |
Subject: |
Re: [lwip-users] mem alignment issue when updating to Rev 1.4.1 |
Date: |
Thu, 21 Aug 2014 12:04:13 +0200 |
Thanks for your answer.
Sorry, it's an LWIP_ERROR not a LWIP_ASSERT.
I found this in sockets.c line
420
/* check size, familiy and alignment of 'name' */
LWIP_ERROR("lwip_bind: invalid address", ((namelen == sizeof(struct sockaddr_in)) &&
((name->sa_family) == AF_INET) && ((((mem_ptr_t)name) % 4) == 0)),
sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;);
and line
820
LWIP_ERROR("lwip_sendto: invalid address", (((to == NULL) && (tolen == 0)) ||
((tolen == sizeof(struct sockaddr_in)) &&
((to->sa_family) == AF_INET) && ((((mem_ptr_t)to) % 4) == 0))),
sock_set_errno(sock, err_to_errno(ERR_ARG)); return -1;);
Ignoring that results in failures. E.g. connecting with TCP is impossible.
Unfortunately our very old compiler doesn't support alignment 4 and update for compiler is not allowed in the moment.
But if your answer is "no" I assume that I can use alignment 2 in general and alignment 4 especially for this code area.
In the moment I'm fighting with damaged elements in memp pool but I think root cause for that is anywhere else.
I wish to have someone here with deeper lwip knowledge. I would pay for help;-)
Regards Thomas