]> git.pld-linux.org Git - packages/rc-scripts.git/blob - rc-scripts-routes6.patch
- rel 6; disabling ipv6 dropped
[packages/rc-scripts.git] / rc-scripts-routes6.patch
1 Index: rc-scripts/doc/sysconfig.txt
2 ===================================================================
3 --- rc-scripts/doc/sysconfig.txt        (revision 12207)
4 +++ rc-scripts/doc/sysconfig.txt        (working copy)
5 @@ -61,7 +61,7 @@
6  
7    <device> may be a device name to have the route brought up and
8    down with the device, or "any" to have the correct devices calculated
9 -  at run time. [type] is optional. RH style isn't supported !
10 +  at run time. [type] is optional. RH style isn't supported!
11  
12    Also you can set few options after "<gateway>":
13      tos <tos>
14 @@ -77,8 +77,12 @@
15      protocol <rtproto>
16      onlink
17      equalize
18 -  For more informations see iproute2 documentation .
19 +  For more informations see iproute2 documentation.
20  
21 +/etc/sysconfig/static-routes6:
22 +
23 +  Same as /etc/sysconfig/static-routes but for IPv6.
24 +
25  /etc/sysconfig/routed:
26  
27    SILENT=yes|no
28 Index: rc-scripts/sysconfig/static-routes6
29 ===================================================================
30 --- rc-scripts/sysconfig/static-routes6 (revision 0)
31 +++ rc-scripts/sysconfig/static-routes6 (revision 12210)
32 @@ -0,0 +1,14 @@
33 +# IPv6 specific rules and routes
34 +
35 +# Entry format for ip rule:
36 +# <rule>
37 +# Entry format for static route:
38 +# <device>     <network_ip>/<network_mask_length>      <other arguments>
39 +#
40 +# Combined example:
41 +
42 +#from fec0:2::/32 table 10
43 +#eth0 default via fec0:2::1 table 10
44 +#
45 +# route fec0:12::34 via fec0:2::3 via any interface
46 +#any fec0:12::34 via fec0:2::3
47 Index: rc-scripts/sysconfig/Makefile.am
48 ===================================================================
49 --- rc-scripts/sysconfig/Makefile.am    (revision 12207)
50 +++ rc-scripts/sysconfig/Makefile.am    (working copy)
51 @@ -10,6 +10,7 @@
52         system \
53         network \
54         static-routes \
55 +       static-routes6 \
56         static-nat \
57         static-arp \
58         i18n
59 Index: rc-scripts/sysconfig/network-scripts/ifup-routes
60 ===================================================================
61 --- rc-scripts/sysconfig/network-scripts/ifup-routes    (revision 12207)
62 +++ rc-scripts/sysconfig/network-scripts/ifup-routes    (working copy)
63 @@ -5,7 +5,7 @@
64  # Adds static routes which go through device $DEVICE
65  # Called from ifup-post.
66  
67 -if [ ! -f /etc/sysconfig/static-routes ]; then
68 +if [ ! -f /etc/sysconfig/static-routes -a ! -f /etc/sysconfig/static-routes6 ]; then
69         return
70  fi
71  
72 @@ -23,6 +23,11 @@
73         /sbin/ip route add $args dev $REALDEVICE
74  done
75  
76 +if ! is_no "$IPV6_NETWORKING"; then
77 +       grep -E "^($DEVICE|any)[[:blank:]]" /etc/sysconfig/static-routes6 | while read device args; do
78 +               /sbin/ip -6 route add $args dev $REALDEVICE
79 +       done
80 +fi
81  
82  # based on information from http://avahi.org/wiki/AvahiAutoipd#Routes
83  if is_yes "$ZEROCONF" && ! /sbin/ip link show dev $REALDEVICE | grep -q POINTOPOINT ; then
84 Index: rc-scripts/sysconfig/network-scripts/functions.network
85 ===================================================================
86 --- rc-scripts/sysconfig/network-scripts/functions.network      (revision 12207)
87 +++ rc-scripts/sysconfig/network-scripts/functions.network      (working copy)
88 @@ -327,6 +327,18 @@
89                         done
90                 fi
91         fi
92 +       is_no "$IPV6_NETWORKING" && return
93 +       if [ -f /etc/sysconfig/static-routes6 ]; then
94 +               if [ "$1" = "on" -o "$1" = "yes" ]; then
95 +                       grep -E "^(none|any)[[:blank:]]" /etc/sysconfig/static-routes6 | while read device args; do
96 +                               /sbin/ip -6 route add $args
97 +                       done
98 +               else
99 +                       grep -E "^(none|any)[[:blank:]]" /etc/sysconfig/static-routes6 | while read device args; do
100 +                               /sbin/ip -6 route del $args 2>/dev/null
101 +                       done
102 +               fi
103 +       fi
104  }
105  
106  # Add ONLY IPv4 address (IPv6 address is added automaticly)
107 @@ -344,6 +356,10 @@
108                 fi
109                 /sbin/ip route add $args dev lo
110         done
111 +       is_no "$IPV6_NETWORKING" && return
112 +       grep -E "^(lo|any)[[:blank:]]" /etc/sysconfig/static-routes6 | while read device args; do
113 +               /sbin/ip -6 route add $args dev lo
114 +       done
115  }
116  
117  set_down_loopback()
118 @@ -460,10 +476,22 @@
119                         done
120                 elif is_no "$1"; then
121                         LC_ALL=C /sbin/ip rule show | grep -vE -e "from all lookup (main|default|local) \$" -e " map-to " | while read prio from src args; do
122 -                               [ "$src" = "all" ] && ip rule delete $args || ip rule delete $from $src $args
123 +                               [ "$src" = "all" ] && /sbin/ip rule delete $args || /sbin/ip rule delete $from $src $args
124                         done
125                 fi
126         fi
127 +       is_no "$IPV6_NETWORKING" && return
128 +       if [ -f /etc/sysconfig/static-routes6 ]; then
129 +               if is_yes "$1"; then
130 +                       grep -E "^(from|to|iif|tos|fwmark|dev|pref|priority|prio)[[:blank:]]" /etc/sysconfig/static-routes6 | while read args; do
131 +                               /sbin/ip -6 rule add $args
132 +                       done
133 +               elif is_no "$1"; then
134 +                       LC_ALL=C /sbin/ip -6 rule show | grep -vE -e "from all lookup (main|default|local) \$" -e " map-to " | while read prio from src args; do
135 +                               [ "$src" = "all" ] && /sbin/ip -6 rule delete $args || /sbin/ip -6 rule delete $from $src $args
136 +                       done
137 +               fi
138 +       fi
139  }
140  
141  is_wireless_device ()
This page took 0.04066 seconds and 3 git commands to generate.