#!/bin/sh
#
# Copyright (C) 2007 Nokia Corporation. All rights reserved.
# Author: jukka.rissanen@nokia.com
#
# Send router solicitation message when IPv6 network is brought up.
# This way we might get autoconfigured IPv6 address faster.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA

# Only for IPv6
if [ "$ADDRFAM" != inet6 ]; then
    exit 0
fi

# Only when starting the interface
if [ "$MODE" != start ]; then
    exit 0
fi

PROG=/usr/bin/rtsol
if [ ! -x $PROG ]; then
    exit 0
fi

# Default is 3 second timeout
TIMEOUT=3

# No need to wait the timeout, so running in background
$PROG -t $TIMEOUT -d $IFACE > /dev/null &

exit 0



