lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #55037] lwip 2.1.0 socket raw api lack of IPv6 cmsghdr


From: hongchengyan
Subject: [lwip-devel] [bug #55037] lwip 2.1.0 socket raw api lack of IPv6 cmsghdr information
Date: Fri, 16 Nov 2018 10:03:13 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36

URL:
  <https://savannah.nongnu.org/bugs/?55037>

                 Summary: lwip 2.1.0 socket raw api lack of IPv6 cmsghdr
information
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: yanhc
            Submitted on: Fri 16 Nov 2018 03:03:11 PM UTC
                Category: IPv6
                Severity: 3 - Normal
              Item Group: Feature Request
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: 2.1.0

    _______________________________________________________

Details:

Recently, I am using socket raw api to just receive ipv6 payload. In my
project, I need the cmsghdr information. However, I found that there is only
IPv4 cmsghdr support and no IPv6 cmsghdr support in "lwip_recvfrom_udp_raw"
function in sockets.c. So I add the IPv6 cmsghdr support following the example
of IPv4 in sockets.c and sockets.h which can be found the attached diff file.

Since the IPv6 cmsghdr need the destaddr and if_idx info, again, I found that
in "recv_raw" function in api_msg.c, there is lack support for
LWIP_NETBUF_RECVINFO. So I add the LWIP_NETBUF_RECVINFO support following the
example in "recv_udp" function. 
The information of buf->p->if_idx is also lost in "pbuf_clone" in "recv_udp"
function in api_msg.c where pbuf p is copied to pbuf q. So I just add the
"q->if_idx = p->if_idx;" in "pbuf_clone" function.
The changing of api_msg.c and pbuf.c can also be found in the attached diff
file.

Another issue is about MLD for socket raw api, I found that MLD only check UDP
and ignore RAW in "lwip_setsockopt_impl" function in sockets.c. Since in my
project I only use MLD from RAW api so I just change the following line to
NETCONN_RAW rather than support both RAW and UDP which is not appropriate.
LWIP_SOCKOPT_CHECK_OPTLEN_CONN_PCB_TYPE(sock, optlen, struct ipv6_mreq,
NETCONN_RAW);

I am not sure whether the above changes are appropriate, so I just pointed out
and wait for offical update.

Thanks for this cool project.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 16 Nov 2018 03:03:11 PM UTC  Name: diff.txt  Size: 4KiB   By: yanhc

<http://savannah.nongnu.org/bugs/download.php?file_id=45448>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?55037>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]