Changeset 34542


Ignore:
Timestamp:
2012-12-06T21:52:40+01:00 (5 years ago)
Author:
cyrus
Message:

ipv6-support: next iteration

  • Introduce mode 6rd
  • Introduce mode 6to4
  • Fix announcement of DNS-Servers received from DHCPv6
  • Fix some corner-cases in relaying behaviour
Location:
trunk/package/network/ipv6/ipv6-support
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/network/ipv6/ipv6-support/Makefile

    r34466 r34542  
    99 
    1010PKG_NAME:=ipv6-support 
    11 PKG_VERSION:=2012-12-03 
     11PKG_VERSION:=2012-12-06 
    1212PKG_RELEASE:=1 
    1313 
  • trunk/package/network/ipv6/ipv6-support/files/dhcpv6.sh

    r34466 r34542  
    4040local peerdns 
    4141config_get_bool peerdns "$network" peerdns 0 
    42 [ "peerdns" -eq "1" ] && { 
     42[ "$peerdns" -eq "1" ] && { 
    4343        proto_init_update "*" 1 
     44        proto_set_keep 1 
    4445        for server in $RDNSS; do 
    4546                proto_add_dns_server "$server" 
  • trunk/package/network/ipv6/ipv6-support/files/network6.config

    r34466 r34542  
    66        option peerdns          1        
    77 
    8  
    98config interface lan 
    109        option mode             router 
     
    1211        option relay_master     wan 
    1312 
    14  
    15 config interface 6in4 
    16         option mode             static 
    17         list static_prefix      2001:DB8::/48 
    18  
  • trunk/package/network/ipv6/ipv6-support/files/support.sh

    r34466 r34542  
    5353        local __device="$2" 
    5454        local __return="$3" 
    55  
    5655        local __cdevice 
    5756        network_get_device __cdevice "$__section" 
     
    154153        # Disable any active distribution 
    155154        [ "$__cmode" == "router" ] && disable_router "$__section" 
     155 
     156        # Configure interface to accept RA and send RS 
     157        conf_set "$__device" accept_ra 2 
     158        conf_set "$__device" forwarding 2 
    156159 
    157160        eval "$__return"'="$'"$__return"' '"$__device"'"' 
     
    287290 
    288291                # Save prefix so it will be preserved across reboots 
    289                 uci set network6.$network.ula_prefix=$ula_prefix 
    290                 uci commit network6 
     292                uci_set network6 "$network" ula_prefix "$ula_prefix" 
     293                uci_commit network6 
    291294        } 
    292295 
     
    314317        # Start RD & DHCPv6 service 
    315318        local pid="/var/run/ipv6-router-$network.pid" 
    316         start_service "/usr/sbin/6relayd -Rserver -Dserver . $device" "$pid" 
     319 
     320        # Start server 
     321        start_service "/usr/sbin/6relayd -S . $device" "$pid" 
    317322 
    318323        # Try relaying if necessary 
    319324        restart_master_relay "$network" 
     325 
     326        # start relay if there are forced relay members 
     327        restart_relay "$network" 
    320328} 
    321329 
     
    356364 
    357365 
     366enable_6to4() { 
     367        local network="$1" 
     368        local device="$2" 
     369        local mode="$3" 
     370 
     371        local prefixlen="48" 
     372        [ "$mode" == "6rd" ] && { 
     373                local ip4prefix=$(uci_get network "$network" ip4prefixlen 0) 
     374                local ip6prefix=$(uci_get network "$network" ip6prefixlen 32) 
     375                prefixlen=$(($ip6prefix + 32 - $ip4prefix)) 
     376        } 
     377 
     378        local prefix="" 
     379        network_get_ipaddr6 prefix "$network" 
     380 
     381        announce_prefix "$prefix/$prefixlen" "$network" 
     382} 
     383 
     384 
    358385enable_interface() 
    359386{ 
     
    371398        [ "$mode" == "dhcpv6" ] && enable_dhcpv6 "$network" "$device" 
    372399        [ "$mode" == "router" ] && enable_router "$network" "$device" 
     400        [ "$mode" == "6to4" -o "$mode" == "6rd" ] && enable_6to4 "$network" "$device" "$mode" 
    373401        [ "$mode" == "relay" ] && restart_master_relay "$network" forced 
    374402} 
Note: See TracChangeset for help on using the changeset viewer.