Skip to content

Problem with LWIP on Renesas RX63 (with solution provided) #2

@KlaasVortex

Description

@KlaasVortex

I run LWIP on a RX63, this is NOT an ESP device.

I had some trouble to get it working. The problem is the allignment in LWIP on Renesas.
When using the list from [getaddrinfo] it is not 4-byte alligned. Because of that it will fail the [connect] function.

Using a helper-variable it will avoid this problem.

After this it worked like a charm.

---------- SNIP -- blynk.c line 684 ----
int fd = -1;
struct addrinfo *r;
struct sockaddr addr;
for (r = result; r != NULL; r = r->ai_next) {
fd = socket(r->ai_family, r->ai_socktype, r->ai_protocol);
if (fd < 0) {
continue;
}
// Copy the result into the helper for getting 4bytes allignment
addr = *r->ai_addr;
if (connect(fd, &addr, sizeof(addr)) < 0) {
close(fd);
fd = -1;
continue;
}
break;
}

----------- SNIP -------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions