Hi Sylvain,

now that it is working it is not really a problem for me. But that's what I
have seen:

in lwiplib.c / lwIPInit() there is a statement

if(lwipIf->ipMode == IPADDR_USE_STATIC)
{
    ip_addr.addr = htonl(lwipIf->ipAddr);
    net_mask.addr = htonl(lwipIf->netMask);
    gw_addr.addr = htonl(lwipIf->gwAddr);
}

which seems to be responsible for exchanging the byteorder.

udp_sendto() of the SNTP-code does not seem to do something similar. So
that could explain why both behave that different.

Karl



2015-02-06 15:08 GMT+01:00 Sylvain Rochet <[email protected]>:

> Hello Karl,
>
> On Fri, Feb 06, 2015 at 08:57:06AM +0100, Karl Karpfen wrote:
> > 2015-02-03 15:24 GMT+01:00 Simon Goldschmidt <[email protected]>:
> >
> > > Karl Karpfen wrote:
> > >
> > > There's nothing strange here: the contents of ip_addr_t needs to be in
> > > network byte order and the sntp client calls a function that returns
> the
> > > correct byte order.
> >
> > OK, to clarify that: to get the ip_addr_t that is used to configure my
> > network interface I have to do the following for IP, gateway and netmask:
> >
> >     ipaddr_aton(c, &globalConfig.ip);
> >     globalConfig.ip.addr=htonl(globalConfig.ip.addr);
>
> Something is wrong in your setup/port/whatever, what I have is:
>
> ipaddr_aton((char*)linebuf, &config.ethernet.address4);
> ipaddr_aton((char*)linebuf, &config.ethernet.netmask4);
> ipaddr_aton((char*)linebuf, &config.ethernet.gateway4);
> netif_add(&MACB_if, &config.ethernet.address4, &config.ethernet.netmask4,
> &config.ethernet.gateway4, NULL, ethernetif_init, tcpip_input);
>
> Could you dig deeper into your issue finding the root cause of the
> problem ?
>
> Sylvain
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to