head	1.7;
access;
symbols
	RELENG_9_1_0_RELEASE:1.6.2.1.4.2
	RELENG_9_1:1.6.2.1.0.4
	RELENG_9_1_BP:1.6.2.1
	RELENG_9_0_0_RELEASE:1.6.2.1.2.1
	RELENG_9_0:1.6.2.1.0.2
	RELENG_9_0_BP:1.6.2.1
	RELENG_9:1.6.0.2
	RELENG_9_BP:1.6;
locks; strict;
comment	@# @;


1.7
date	2012.11.17.01.49.04;	author svnexp;	state Exp;
branches;
next	1.6;

1.6
date	2011.03.30.01.19.00;	author emaste;	state Exp;
branches
	1.6.2.1;
next	1.5;

1.5
date	2009.10.17.21.09.15;	author dougb;	state Exp;
branches;
next	1.4;

1.4
date	2009.10.10.22.17.03;	author dougb;	state Exp;
branches;
next	1.3;

1.3
date	2009.10.02.06.19.34;	author hrs;	state Exp;
branches;
next	1.2;

1.2
date	2009.10.02.02.24.25;	author hrs;	state Exp;
branches;
next	1.1;

1.1
date	2009.09.12.22.13.41;	author hrs;	state Exp;
branches;
next	;

1.6.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.6.2.1.2.1
	1.6.2.1.4.1;
next	1.6.2.2;

1.6.2.2
date	2012.11.17.11.36.11;	author svnexp;	state Exp;
branches;
next	;

1.6.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.6.2.1.2.2;

1.6.2.1.2.2
date	2012.11.17.08.36.11;	author svnexp;	state Exp;
branches;
next	;

1.6.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.6.2.1.4.2;

1.6.2.1.4.2
date	2012.11.17.08.47.01;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Switching exporter and resync
@
text
@#!/bin/sh
# $FreeBSD: head/etc/rc.d/faith 220153 2011-03-30 01:19:00Z emaste $
#

# PROVIDE: faith
# REQUIRE: netif
# KEYWORD: nojail

. /etc/rc.subr
. /etc/network.subr

name="faith"
start_cmd="faith_up"
stop_cmd="faith_down"

faith_up()
{
	case ${ipv6_faith_prefix} in
	[Nn][Oo] | '')
		;;
	*)
		echo "Configuring IPv6-to-IPv4 TCP relay capturing interface:" \
		    " faith0."
		${SYSCTL} net.inet6.ip6.keepfaith=1
		ifconfig faith0 create >/dev/null 2>&1
		ifconfig faith0 up
		for prefix in ${ipv6_faith_prefix}; do
			prefixlen=`expr "${prefix}" : ".*/\(.*\)"`
			case ${prefixlen} in
			'')
				prefixlen=96
				;;
			*)
				prefix=`expr "${prefix}" : \
					     "\(.*\)/${prefixlen}"`
				;;
			esac
			route add -inet6 ${prefix} -prefixlen ${prefixlen} ::1
			route change -inet6 ${prefix} -prefixlen ${prefixlen} \
				-ifp faith0
		done
		check_startmsgs && ifconfig faith0
		;;
	esac
}

faith_down()
{
	echo "Removing IPv6-to-IPv4 TCP relay capturing interface: faith0."
	ifconfig faith0 destroy
	${SYSCTL} net.inet6.ip6.keepfaith=0

	case ${ipv6_faith_prefix} in
	[Nn][Oo] | '')
		;;
	*)
		for prefix in ${ipv6_faith_prefix}; do
			prefixlen=`expr "${prefix}" : ".*/\(.*\)"`
			case ${prefixlen} in
			'')
				prefixlen=96
				;;
			*)
				prefix=`expr "${prefix}" : \
					     "\(.*\)/${prefixlen}"`
				;;
			esac
			route delete -inet6 ${prefix} -prefixlen ${prefixlen}
		done
		;;
	esac
}

load_rc_config $name
run_rc_command "$1"
@


1.6
log
@SVN rev 220153 on 2011-03-30 01:19:00Z by emaste

Replace ${SYSCTL_W} with ${SYSCTL} in rc.d scripts, as they are identical.
This is a further clean up after r202988.

SYSCTL_W is still initialized in rc.subr as some ports may still use it.
@
text
@d2 1
a2 1
# $FreeBSD$
@


1.6.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.6.2.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d2 1
a2 1
# $FreeBSD: stable/9/etc/rc.d/faith 220153 2011-03-30 01:19:00Z emaste $
@


1.6.2.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.6.2.1.4.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/9.1/etc/rc.d/faith 220153 2011-03-30 01:19:00Z emaste $
@


1.6.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.6.2.1.2.2
log
@Switch importer
@
text
@d2 1
a2 1
# $FreeBSD: releng/9.0/etc/rc.d/faith 220153 2011-03-30 01:19:00Z emaste $
@


1.5
log
@SVN rev 198190 on 2009-10-17 21:09:15Z by dougb

Remove a circular dependency on routing

Submitted by:	Mykola Dzham <freebsd@@levsha.org.ua>
Approved by:	hrs
@
text
@d24 1
a24 1
		${SYSCTL_W} net.inet6.ip6.keepfaith=1
d51 1
a51 1
	${SYSCTL_W} net.inet6.ip6.keepfaith=0
@


1.4
log
@SVN rev 197947 on 2009-10-10 22:17:03Z by dougb

In regards to the "Starting foo:" type messages at boot time, create and
employ a more generic solution, and use it in the individual rc.d scripts
that also have an $rc_quiet test:

1. Add check_startmsgs() to rc.subr.
2. In the rc.d scripts that use rc_quiet (and rc.subr) substitute
variations of [ -z "$rc_quiet" ] with check_startmsgs
3. In savecore add a trailing '.' to the end of the message to make it
more consistent with other scripts.
4. In newsyslog remove a : before the terminal '.' since we do not expect
there to be anything printed out in between to make it more consistent.
5. In the following scripts change "quotes" to 'quotes' where no variables
exist in the message: savecore pf newsyslog
6. In the following scripts substitute if/then/fi for the simpler (and
more consistent) check_startmsgs &&: faith stf
7. In the following scripts separate the "Starting foo:" from the terminal
'.' to make them more consistent: moused hostname pf
8. In nfsclient move the message to its own line to avoid a style bug
9. In pf rc_quiet does not apply to the _stop method, so remove the
test there.
10. In motd add 'quotes' around the terminal '.' for consistency
@
text
@d6 1
a6 1
# REQUIRE: netif routing
@


1.3
log
@SVN rev 197701 on 2009-10-02 06:19:34Z by hrs

Revert the previous afexists() change.  Knobs configured explicitly by
the user should not be ignored if possible even if the kernel does not
support the prerequisite feature.

Discussed with:	ume
@
text
@d42 1
a42 3
		if [ -z "${rc_quiet}" ]; then
			ifconfig faith0
		fi
@


1.2
log
@SVN rev 197697 on 2009-10-02 02:24:25Z by hrs

- Add AF_IPX and AF_NATM to afexists().

- Add afexists() check to address family specific rc.d scripts.  A
  script for an AF will be silently ignored if the kernel has no
  support for the AF.
@
text
@a17 2
	afexists inet6 || return 0

a50 2
	afexists inet6 || return 0

@


1.1
log
@SVN rev 197139 on 2009-09-12 22:13:41Z by hrs

Integrate rc.d/network_ipv6 into rc.d/netif:

- Add rc.d/stf and rc.d/faith for stf(4) and faith(4).
- Remove rc.d/auto_linklocal and rc.d/network_ipv6.
- Move rc.d/sysctl to just before FILESYSTEMS because rc.d/netif
  depends on some sysctl variables.

Reviewed by:	brooks
MFC after:	3 days
@
text
@d18 2
d53 2
@

