bug-hurd
[Top][All Lists]
Advanced

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

IPv6-capable pfinet


From: Stefan Siegl
Subject: IPv6-capable pfinet
Date: Sun, 7 Oct 2007 03:52:28 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

Hello!

I've already announced it on #hurd, however for the records and to
publish the patch:  I've somewhat successfully made the good old pfinet
IPv6-aware.

In order to do so, I imported a number of source files (without
modifications) from Linux 2.2.14 kernel -- because of our build system I
had to rename some of them, to make their filenames unique.
(all bundled together in attached pfinet-ipv6-imports.diff.gz)

Changes to these imported files and to files that have been in the
repository for long were of course necessary and are all collected in
the attached file pfinet-ipv6-modifications.diff.


If you'd like to try it out:

 - for development I've put the sources into a git repository, available
   by `git clone http://brokenpipe.de/gitroot/pfinet6'
 
 - to set the translator (leaving IPv6 address assignment to
   autoconfiguation) do like this

    settrans -fgp /servers/socket/2 /hurd/pfinet6
      -6 /servers/socket/26 -i eth0 
      -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1

   and
    
    settrans -fgp /servers/socket/26 /hurd/pfinet6
      -4 /servers/socket/2 -i eth0
      -a 192.168.7.23 -m 255.255.255.0 -g 192.168.7.1
 
   ... a bit clumsy, but actually quite like /hurd/term and others do;
   and necessary because we need one process for IPv4 and IPv6, however
   activly translating on both /servers/socket/2 and 26.

   If you'd like to statically assign a global IPv6 address, use the new
   -A (--address6) option.

 - Please mind that IPv6 heavily relies on multicasting (especially
   router and neighbour solicits and advertisements) and that by default
   GNU Mach doesn't configure the network drivers to receive those
   multicasts.  This is, you need to patch your Mach kernel:
 
 ,--
 | Index: net.c
 | ===================================================================
 | RCS file: /sources/hurd/gnumach/linux/dev/glue/Attic/net.c,v
 | retrieving revision 1.1.4.7
 | diff -u -p -r1.1.4.7 net.c
 | --- net.c    27 Mar 2007 22:47:11 -0000      1.1.4.7
 | +++ net.c    6 Oct 2007 00:52:35 -0000
 | @@ -366,7 +366,7 @@ device_open (ipc_port_t reply_port, mach
 |  
 |        ifp = &nd->ifnet;
 |        ifp->if_unit = dev->name[strlen (dev->name) - 1] - '0';
 | -      ifp->if_flags = IFF_UP | IFF_RUNNING;
 | +      ifp->if_flags = IFF_UP | IFF_RUNNING | IFF_ALLMULTI;
 |        ifp->if_mtu = dev->mtu;
 |        ifp->if_header_size = dev->hard_header_len;
 |        ifp->if_header_format = dev->type;
 | @@ -398,7 +398,7 @@ device_open (ipc_port_t reply_port, mach
 |      }
 |        else
 |      {
 | -      dev->flags |= LINUX_IFF_UP | LINUX_IFF_RUNNING;
 | +      dev->flags |= LINUX_IFF_UP | LINUX_IFF_RUNNING | LINUX_IFF_ALLMULTI;
 |        skb_queue_head_init (&dev->buffs[0]);
 |      }
 |        if (IP_VALID (reply_port))
 `--

   ... however not all network drivers seem to care for this flag.  My
   eepro100 does, even the orinoco does, but the ne2k-pci doesn't.

   I think we have to peek some of the drivers in this regard :D



The ChangeLog:

2007-10-07  Stefan Siegl  <stesie@brokenpipe.de>

        * config.h (CONFIG_IPV6, CONFIG_IPV6_EUI64): New defines, 
        set to 1.
        * Makefile (ipv6-srcs): New variable.
        (LINUXSRCS): Add ipv6-srcs.
        (target): Set to pfinet6.
        
        * ethernet.c (ethernet_demuxer): Call skb_put instead of changing
        skb->len directly, and thus now update skb->tail accordingly.
        * pfinet.h (PORTCLASS_INET, PORTCLASS_INET6): New enums.
        (trivfs_protid_portclasses, trivfs_protid_nportclasses)
        (trivfs_cntl_portclasses, trivfs_cntl_nportclasses): Declare
        these.
        (pfinet_bootstrap_portclass): New variable.
        (pfinet_bind): New function.
        * main.c: Define _HACK_ERRNO_H.  Include <errno.h>.  
        (trivfs_protid_portclasses, trivfs_cntl_portclasses): New slots
        for PORTCLASS_INET6.
        (trivfs_protid_nportclasses, trivfs_cntl_nportclasses): Set to 2.
        (pfinet_bootstrap_portclass): New variable.
        (pfinet_bind): New function.
        (main) [CONFIG_IPV6]: Call inet6_proto_init.
        (main): Reordered to allow pfinet to not be started as a
        translator, if pfinet_bind is used.  If started as a translator,
        treat pfinet_bootstrap_portclass when calling trivfs_startup.
        * options.c: Include <net/sock.h>, <net/ip6_fib.h>,
        <net/ip6_route.h> and <net/addrconf.h>. 
        (options): New option `ipv4'.
        (options) [CONFIG_IPV6]: New options `ipv6', `address6' and
        `gateway6'.
        (parse_interface) [CONFIG_IPV6]: Add address6 and gateway6.
        (parse_hook_add_interface) [CONFIG_IPV6]: Initialize address6 and
        gateway6. 
        (parse_opt): Parse new args.
        * socket-ops.c (S_socket_create): Call either
        net_families[PF_INET]->create or net_families[PF_INET6]->create,
        depending on receiving master.
        (S_socket_create_address): Allow creation of AF_INET6 addresses.
        
        * glue-include/asm/delay.h: New stub file.
        * glue-include/linux/ipv6.h: Merged many bits unmodified from Linux
        header file.
        * glue-include/linux/in6.h: Likewise.
        (ipv6mr_ifindex): New define, glue to ipv6mr_interface. 
        * glue-include/linux/socket.h (SOL_IPV6, SOL_ICMPV6): New defines.

        * linux-src/net/ipv6/addrconf.c (ipv6_find_idev, inet6_addr_add)
        (inet6_addr_del) [_HURD_]: Make these non-static.
        (addrconf_set_dstaddr, addrconf_add_ifaddr, addrconf_del_ifaddr)
        [_HURD_]: Don't define these functions.
        * linux-src/net/ipv6/route_ipv6.c (ipv6_route_ioctl) [_HURD_]:
        Likewise. 
        * linux-src/net/ipv6/af_inet6.c (inet6_ioctl) [_HURD_]: Don't
        define the function, instead #define it to 0.
        (inet6_proto_init) [_HURD_]: Don't call sit_init.
        * linux-src/net/ipv6/udp_ipv6.c (udp_ioctl) [_HURD_]: Define 
        to 0. 
        (udp_v6_get_port): Put empty statement after label to silence
        compiler. 
        * linux-src/net/ipv6/tcp_ipv6.c (tcp_v6_get_port, tcp_v6_rcv):
        Likewise. 
        * linux-src/net/ipv6/icmpv6.c (icmpv6_rcv): Likewise.
        (icmpv6_init) [_HURD_]: Don't initialize i_uid and i_gid.
        * linux-src/net/ipv6/mcast.c (igmp6_init): Likewise.
        * linux-src/net/ipv6/ndisc.c (ndisc_init): Likewise.
        * linux-src/net/ipv6/ip6_fib.c (BUG_TRAP): Don't use __FUNCTION__
        as a string but a variable, to keep gcc happy.
        (fib6_walker_list): Make it non-static, to keep gcc happy.
        * linux-src/net/ipv6/ip6_flowlabel.c (fl_create) [_HURD_]: Drop
        IPV6_FL_S_USER support, since current->euid is not available.
        
2007-10-07  Stefan Siegl  <stesie@brokenpipe.de>

        Import a number of files from Linux 2.2.14.  Renamed some of them,
        to have unique filenames as required by the make system.
        
        * linux-src/net/ipv6/addrconf.c: Import file.
        * linux-src/net/ipv6/af_inet6.c: Likewise.
        * linux-src/net/ipv6/exthdrs.c: Likewise.
        * linux-src/net/ipv6/ip6_fib.c: Likewise.
        * linux-src/net/ipv6/ip6_flowlabel.c: Likewise.
        * linux-src/net/ipv6/ip6_input.c: Likewise.
        * linux-src/net/ipv6/ip6_output.c: Likewise.
        * linux-src/net/ipv6/ipv6_sockglue.c: Likewise.
        * linux-src/net/ipv6/mcast.c: Likewise.
        * linux-src/net/ipv6/ndisc.c: Likewise.
        * linux-src/net/ipv6/reassembly.c: Likewise.
        * linux-src/net/ipv6/tcp_ipv6.c: Likewise.
        * linux-src/net/ipv6/datagram_ipv6.c: Import file (was datagram.c).
        * linux-src/net/ipv6/icmpv6.c: Import file (was icmp.c).
        * linux-src/net/ipv6/protocol_ipv6.c: Import file (was protocol.c).
        * linux-src/net/ipv6/raw_ipv6.c: Import file (was raw.c).
        * linux-src/net/ipv6/route_ipv6.c: Import file (was route.c).
        * linux-src/net/ipv6/udp_ipv6.c: Import file (was udp.c). 
        
   - % -

A few last bits:

 -> where to import?
    I more and more arrive at the conclusion that we should just
    IPv6-enhance the existing pfinet, not add another pfinet6 directory
    which shares almost all the code.

    IPv6 support can easily be disabled in config.h (and maybe some flag
    to the configure script somewhen)

 -> how to import?
    Do we need to maintain the vendor branch further? 
    Updates haven't been applied anyways (at least not since 2.2.14) and
    because of the file renamings it's a pain to track with CVS.

`-> have fun testing!
    (I consider IPv6 just plain cool, since it makes all the NAT-cruft
    and port forwarding pain history ...)

cheers,
  stesie

Attachment: pfinet-ipv6-imports.diff.gz
Description: Binary data

Attachment: pfinet-ipv6-modifications.diff
Description: Text Data


reply via email to

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