Changeset 34204


Ignore:
Timestamp:
2012-11-16T10:27:56+01:00 (5 years ago)
Author:
cyrus
Message:

6relayd: various updates & fixes

  • Add RD- and DHCPv6-server functionality
  • Rework configuration and add example UCI file
  • Fix various bugs and be more RFC compliant
Location:
trunk/package/network/ipv6/6relayd
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/network/ipv6/6relayd/Makefile

    r34027 r34204  
    99 
    1010PKG_NAME:=6relayd 
    11 PKG_VERSION:=2012-11-01 
     11PKG_VERSION:=2012-11-16 
    1212PKG_RELEASE=$(PKG_SOURCE_VERSION) 
    1313 
     
    1616PKG_SOURCE_URL:=git://nbd.name/6relayd.git 
    1717PKG_SOURCE_PROTO:=git 
    18 PKG_SOURCE_VERSION:=3f8db4e75d6ac98ea290e0b52e4e2cff91bcee8c 
     18PKG_SOURCE_VERSION:=f0fec4df02e3310de134e46e9826dbeedb86119a 
    1919 
    2020PKG_MAINTAINER:=Steven Barth <steven@midlink.org> 
     
    2626  SECTION:=ipv6 
    2727  CATEGORY:=IPv6 
    28   TITLE:=IPv6-Relay (RD-, DHCPv6- & NDP-Proxy) 
     28  TITLE:=IPv6-Relay and Server (RD-, DHCPv6- & NDP-Proxy) 
    2929  DEPENDS:=+kmod-ipv6 
    3030endef 
     
    3535 bridged) interfaces can use the public address prefix, DHCPv6 and DNS-service 
    3636 of a master interface. This is useful to avoid NAT in chained IPv6-routers. 
     37 
     38 It can also be used as a lightweight router advertisement daemon and provide 
     39 stateless DHCPv6 service where size matters. 
    3740endef 
    3841 
     
    4245        $(INSTALL_DIR) $(1)/etc/hotplug.d/iface 
    4346        $(INSTALL_DATA) ./files/6relayd.hotplug $(1)/etc/hotplug.d/iface/30-6relay 
     47        $(INSTALL_DIR) $(1)/etc/config 
     48        $(INSTALL_DATA) ./files/6relayd.config $(1)/etc/config/6relayd 
    4449        $(INSTALL_DIR) $(1)/etc/init.d 
    4550        $(INSTALL_BIN) ./files/6relayd.init $(1)/etc/init.d/6relayd 
  • trunk/package/network/ipv6/6relayd/files/6relayd.init

    r34027 r34204  
    1919start_6relayd() { 
    2020        local cfg="$1" 
    21  
    22         local args="-S -l" 
     21        local mode="$2" 
     22        local args="-s -l" 
    2323        local ifaces="" 
    24  
    25         config_get proto "$cfg" proto 
    26         [[ "$proto" == 6relay ]] || return 0 
    2724 
    2825        SERVICE_DAEMONIZE=1 
     
    5148        done 
    5249 
    53         local forward_rd # = 1 
    54         config_get_bool forward_rd "$cfg" forward_rd 1 
    55         [ $forward_rd -eq 1 ] && append args "-R" 
     50        local rd 
     51        config_get rd "$cfg" rd 
     52        [ -n "$rd" ] && append args "-R$rd" 
    5653 
    57         local forward_dhcpv6 # = 1 
    58         local forward_dhcpv6_mode # = relay 
    59         config_get_bool forward_dhcpv6 "$cfg" forward_dhcpv6 1 
    60         config_get forward_dhcpv6_mode "$cfg" forward_dhcpv6_mode 
    61         [ $forward_dhcpv6 -eq 1 ] && append args "-D$forward_dhcpv6_mode" 
     54        local dhcpv6 
     55        config_get dhcpv6 "$cfg" dhcpv6 
     56        [ -n "$dhcpv6" ] && append args "-D$dhcpv6" 
    6257 
    63         local forward_ndp # = 1 
    64         config_get_bool forward_ndp "$cfg" forward_ndp 1 
    65         [ $forward_ndp -eq 1 ] && append args "-N" 
     58        local ndp 
     59        config_get ndp "$cfg" ndp 
     60        [ "$ndp" == "relay" ] && append args "-N -r" 
    6661 
    67         local configure_routes # = 1 
    68         config_get_bool configure_routes "$cfg" configure_routes 1 
    69         [ $configure_routes -eq 1 ] && append args "-r" 
    70  
    71         local always_rewrite_dns # = 0 
     62        local always_rewrite_dns 
    7263        config_get_bool always_rewrite_dns "$cfg" always_rewrite_dns 0 
    7364        [ $always_rewrite_dns -eq 1 ] && append args "-n" 
     65 
     66        # In server mode the first interface needs to be passed twice 
     67        [ "$mode" == "server" ] && { 
     68                for iface in $ifaces; do 
     69                        ifaces="$iface $ifaces" 
     70                        break 
     71                done 
     72        } 
    7473 
    7574        service_start /usr/sbin/6relayd $args $ifaces 
     
    8685start() { 
    8786        include /lib/network 
    88         config_load network 
    89         config_foreach start_6relayd interface 
     87        config_load 6relayd 
     88        config_foreach start_6relayd relay relay 
     89        config_foreach start_6relayd server server 
    9090} 
Note: See TracChangeset for help on using the changeset viewer.