Don't do anything if the interface doesn't exist

iproute2_post_stop() does now check if the network interface still exist.

Reported-by: Yun Zheng Hu <hu@fox-it.com>
X-Gentoo-Bug: 379575
X-Gentoo-Bug-URL: https://bugs.gentoo.org/379575
This commit is contained in:
Yun Zheng Hu 2011-09-19 00:01:52 +02:00 committed by Christian Ruppert
parent fb485366e6
commit bf49e59e3e

View File

@ -301,6 +301,9 @@ iproute2_post_start()
iproute2_post_stop() iproute2_post_stop()
{ {
# Only do something if the interface actually exist
_exists || return
# Kernel may not have IP built in # Kernel may not have IP built in
if [ -e /proc/net/route ]; then if [ -e /proc/net/route ]; then
local rules="$(service_get_value "ip_rule")" local rules="$(service_get_value "ip_rule")"