[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] IPv6 L2TP PPP review
From: |
Sylvain Rochet |
Subject: |
Re: [lwip-devel] IPv6 L2TP PPP review |
Date: |
Mon, 2 Mar 2015 21:35:00 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hello Ivan,
On Mon, Mar 02, 2015 at 01:16:55PM -0700, Ivan Delamer wrote:
> Hello Sylvain,
>
> I think your code is correct. I use something very similar for UDP
> connections, only using netconns.
Thank you :)
> In general once you are working with UDP or TCP, it is really quite
> similar for IPv4 or IPv6, because you are one layer over that. It is
> just address binding/comparison that needs to be done appropriately.
>
> The API is not completely safe and requires care from the programmer.
I saw that, there is casts everywhere meaning functions calls/prototypes
coherency is not checked at all.
> I think we have it as a task to improve ipX_addr_t to include a
> version field. We just wanted to initially implement IPv6 in a way
> that was easy to turn it off, and the resulting stack was exactly
> the same as the old IPv4-only stack. We will have to improve it
> though...
I agree it is a bit disappointing, this is why I wasn't sure, I am more
used to sockaddr, sockaddr_in, sockaddr_in6, sockaddr_storage, "russian
dolls" structures.
By the way, I struggled a little bit setting UP a static IPv6 global
scope address and ended up with the following which I am not very happy
with:
netif.ip6_addr[1].addr[0] = PP_HTONL(0x20010000);
netif.ip6_addr[1].addr[1] = PP_HTONL(0x00000000);
netif.ip6_addr[1].addr[2] = PP_HTONL(0x00000000);
netif.ip6_addr[1].addr[3] = PP_HTONL(0x00000002);
netif_ip6_addr_set_state(&netif, 1, IP6_ADDR_TENTATIVE|IP6_ADDR_PREFERRED);
netif_create_ip6_linklocal_address(&netif, 1);
Using IP6_ADDR_VALID instead of IP6_ADDR_TENTATIVE didn't work and I
don't know why from looking at the source code, do you have a clue ?
Cheers,
Sylvain
signature.asc
Description: Digital signature