Lines 162-167
Link Here
|
162 |
} |
162 |
} |
163 |
fi |
163 |
fi |
164 |
fi |
164 |
fi |
|
|
165 |
# Set default route if applicable to this interface on inet6 |
166 |
if [[ ${gateway6} == ${IFACE}/* ]]; then |
167 |
local ogw6=$(/bin/netstat -A inet6 -rn | awk '$1 == "::/0" {print $2}' | head -n1) |
168 |
local gw6=${gateway6#*/} |
169 |
if [[ ${ogw6} != ${gw6} ]]; then |
170 |
ebegin " Setting default IPv6 gateway ($gw6)" |
171 |
|
172 |
# First delete any existing route if it was setup by kernel... |
173 |
/sbin/route -A inet6 del default dev ${IFACE} &>${devnull} |
174 |
|
175 |
# Second delete old gateway if it was set... |
176 |
/sbin/route -A inet6 del default gw ${ogw6} &>${devnull} |
177 |
|
178 |
# Third add our new default gateway |
179 |
/sbin/route -A inet6 add default gw ${gw6} >${devnull} |
180 |
eend $? || { |
181 |
true # need to have some command in here |
182 |
# Note: This originally called stop, which is obviously |
183 |
# wrong since it's calling with a local version of IFACE. |
184 |
# The below code works correctly to abort configuration of |
185 |
# the interface, but is commented because we're assuming |
186 |
# that default route failure should not cause the interface |
187 |
# to be unconfigured. |
188 |
#local error=$? |
189 |
#ewarn "Aborting configuration of ${IFACE}" |
190 |
#iface_stop ${IFACE} |
191 |
#return ${error} |
192 |
} |
193 |
fi |
194 |
fi |
165 |
|
195 |
|
166 |
# Enabling rp_filter causes wacky packets to be auto-dropped by |
196 |
# Enabling rp_filter causes wacky packets to be auto-dropped by |
167 |
# the kernel. Note that we only do this if it is not set via |
197 |
# the kernel. Note that we only do this if it is not set via |
Lines 198-204
Link Here
|
198 |
for i in ${aliases} ${IFACE}; do |
228 |
for i in ${aliases} ${IFACE}; do |
199 |
|
229 |
|
200 |
# Delete all the inet6 addresses for this interface |
230 |
# Delete all the inet6 addresses for this interface |
201 |
inet6="$(ifconfig ${i} | awk '$1 == "inet6" {print $2}')" |
231 |
inet6="$(ifconfig ${i} | awk '$1 == "inet6" {print $3}')" |
202 |
if [[ -n ${inet6} ]]; then |
232 |
if [[ -n ${inet6} ]]; then |
203 |
einfo " Removing inet6 addresses" |
233 |
einfo " Removing inet6 addresses" |
204 |
for x in ${inet6}; do |
234 |
for x in ${inet6}; do |