From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acp3R-0005x9-6F for qemu-devel@nongnu.org; Mon, 07 Mar 2016 01:54:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1acp3M-0001i7-La for qemu-devel@nongnu.org; Mon, 07 Mar 2016 01:54:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1acp3M-0001hx-Fe for qemu-devel@nongnu.org; Mon, 07 Mar 2016 01:54:04 -0500 References: From: Jason Wang Message-ID: <56DD2582.607@redhat.com> Date: Mon, 7 Mar 2016 14:53:54 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv9 01/10] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Samuel Thibault , qemu-devel@nongnu.org Cc: Thomas Huth , zhanghailiang , Li Zhijian , Stefan Hajnoczi , Dave Gilbert , Vasiliy Tolstov , Huangpeng , Gonglei , Jan Kiszka , Guillaume Subiron On 02/23/2016 03:28 AM, Samuel Thibault wrote: > From: Guillaume Subiron > > This patch adds the functions needed to handle IPv6 packets. ICMPv6 and > NDP headers are implemented. > > Slirp is now able to send NDP Router or Neighbor Advertisement when it > receives Router or Neighbor Solicitation. Using a 64bit-sized IPv6 > prefix, the guest is now able to perform stateless autoconfiguration > (SLAAC) and to compute its IPv6 address. > > This patch adds an ndp_table, mainly inspired by arp_table, to keep an > NDP cache and manage network address resolution. > Slirp regularly sends NDP Neighbor Advertisement, as recommended by the > RFC, to make the guest refresh its route. > > This also adds ip6_cksum() to compute ICMPv6 checksums using IPv6 > pseudo-header. > > Some #define ETH_* are moved upper in slirp.h to make them accessible to > other slirp/*.h > > Signed-off-by: Guillaume Subiron > Signed-off-by: Samuel Thibault > Reviewed-by: Thomas Huth > --- > slirp/Makefile.objs | 6 +- > slirp/cksum.c | 25 ++++ > slirp/if.c | 2 +- > slirp/ip6.h | 138 +++++++++++++++++++++ > slirp/ip6_icmp.c | 347 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > slirp/ip6_icmp.h | 203 ++++++++++++++++++++++++++++++ > slirp/ip6_input.c | 69 +++++++++++ > slirp/ip6_output.c | 38 ++++++ > slirp/ndp_table.c | 84 +++++++++++++ > slirp/slirp.c | 51 +++++++- > slirp/slirp.h | 37 ++++++ > slirp/socket.h | 7 ++ > 12 files changed, 1001 insertions(+), 6 deletions(-) > create mode 100644 slirp/ip6.h > create mode 100644 slirp/ip6_icmp.c > create mode 100644 slirp/ip6_icmp.h > create mode 100644 slirp/ip6_input.c > create mode 100644 slirp/ip6_output.c > create mode 100644 slirp/ndp_table.c > [...] > + > + /* > + * Switch out to protocol's input routine. > + */ > + switch (ip6->ip_nh) { > +#if 0 > + case IPPROTO_TCP: > + tcp_input(m, hlen, (struct socket *)NULL); > + break; > + case IPPROTO_UDP: > + udp_input(m, hlen); > + break; > +#endif This looks odd, why need this?