head	1.7;
access;
symbols
	RELENG_8_4:1.7.0.2
	RELENG_8_3_0_RELEASE:1.6.2.2.2.1
	RELENG_8_3:1.6.2.2.0.2
	RELENG_8_3_BP:1.6.2.2
	RELENG_7_4_0_RELEASE:1.5.12.1
	RELENG_8_2_0_RELEASE:1.6.2.1.6.1
	RELENG_7_4:1.5.0.12
	RELENG_7_4_BP:1.5
	RELENG_8_2:1.6.2.1.0.6
	RELENG_8_2_BP:1.6.2.1
	RELENG_8_1_0_RELEASE:1.6.2.1.4.1
	RELENG_8_1:1.6.2.1.0.4
	RELENG_8_1_BP:1.6.2.1
	RELENG_7_3_0_RELEASE:1.5.10.1
	RELENG_7_3:1.5.0.10
	RELENG_7_3_BP:1.5
	RELENG_8_0_0_RELEASE:1.6.2.1.2.1
	RELENG_8_0:1.6.2.1.0.2
	RELENG_8_0_BP:1.6.2.1
	RELENG_8:1.6.0.2
	RELENG_8_BP:1.6
	RELENG_7_2_0_RELEASE:1.5.8.1
	RELENG_7_2:1.5.0.8
	RELENG_7_2_BP:1.5
	RELENG_7_1_0_RELEASE:1.5.6.1
	RELENG_6_4_0_RELEASE:1.1.2.5.4.1
	RELENG_7_1:1.5.0.6
	RELENG_7_1_BP:1.5
	RELENG_6_4:1.1.2.5.0.4
	RELENG_6_4_BP:1.1.2.5
	RELENG_7_0_0_RELEASE:1.5
	RELENG_6_3_0_RELEASE:1.1.2.5
	RELENG_7_0:1.5.0.4
	RELENG_7_0_BP:1.5
	RELENG_6_3:1.1.2.5.0.2
	RELENG_6_3_BP:1.1.2.5
	RELENG_7:1.5.0.2
	RELENG_7_BP:1.5
	RELENG_6_2_0_RELEASE:1.1.2.3.2.2
	RELENG_6_2:1.1.2.3.0.2
	RELENG_6_2_BP:1.1.2.3
	RELENG_6:1.1.0.2;
locks; strict;
comment	@# @;


1.7
date	2009.09.12.22.13.41;	author hrs;	state dead;
branches
	1.7.2.1;
next	1.6;

1.6
date	2008.06.23.22.06.28;	author mtm;	state Exp;
branches
	1.6.2.1;
next	1.5;

1.5
date	2006.12.29.15.56.21;	author hrs;	state Exp;
branches
	1.5.2.1
	1.5.6.1
	1.5.8.1
	1.5.10.1
	1.5.12.1;
next	1.4;

1.4
date	2006.12.08.06.34.06;	author hrs;	state Exp;
branches;
next	1.3;

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

1.2
date	2006.10.13.12.41.35;	author ume;	state Exp;
branches;
next	1.1;

1.1
date	2006.10.07.15.45.56;	author ume;	state Exp;
branches
	1.1.2.1;
next	;

1.7.2.1
date	2009.09.12.22.13.41;	author svnexp;	state dead;
branches;
next	1.7.2.2;

1.7.2.2
date	2013.03.28.13.02.43;	author svnexp;	state Exp;
branches;
next	;

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

1.6.2.2
date	2012.02.10.10.18.30;	author dougb;	state Exp;
branches
	1.6.2.2.2.1;
next	1.6.2.3;

1.6.2.3
date	2012.11.17.10.35.56;	author svnexp;	state Exp;
branches;
next	;

1.6.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.6.2.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.6.2.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.6.2.2.2.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.6.2.2.2.2;

1.6.2.2.2.2
date	2012.11.17.08.24.38;	author svnexp;	state Exp;
branches;
next	;

1.5.2.1
date	2012.11.17.08.01.20;	author svnexp;	state Exp;
branches;
next	;

1.5.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.5.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.5.10.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.5.12.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.5.12.2;

1.5.12.2
date	2012.11.17.08.16.37;	author svnexp;	state Exp;
branches;
next	;

1.1.2.1
date	2006.10.10.12.41.05;	author ume;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2006.10.16.15.09.24;	author ume;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2006.11.03.17.35.23;	author hrs;	state Exp;
branches
	1.1.2.3.2.1;
next	1.1.2.4;

1.1.2.4
date	2006.12.08.06.40.34;	author hrs;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2006.12.29.16.01.12;	author hrs;	state Exp;
branches
	1.1.2.5.4.1;
next	1.1.2.6;

1.1.2.6
date	2012.11.17.07.39.06;	author svnexp;	state Exp;
branches;
next	;

1.1.2.3.2.1
date	2006.12.08.06.43.35;	author hrs;	state Exp;
branches;
next	1.1.2.3.2.2;

1.1.2.3.2.2
date	2006.12.31.15.26.25;	author hrs;	state Exp;
branches;
next	;

1.1.2.5.4.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;


desc
@@


1.7
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
@#!/bin/sh
#
# $FreeBSD: src/etc/rc.d/auto_linklocal,v 1.6 2008/06/23 22:06:28 mtm Exp $
#

# PROVIDE: auto_linklocal
# REQUIRE: root
# BEFORE:  sysctl
# KEYWORD: nojail

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

name="auto_linklocal"
start_cmd="auto_linklocal_start"
stop_cmd=":"

auto_linklocal_start()
{
	if ! checkyesno ipv6_enable && ${SYSCTL} net.inet6 > /dev/null 2>&1; then
		if ! ${SYSCTL_W} net.inet6.ip6.auto_linklocal=0 >/dev/null 2>&1; then
			warn "failed to set sysctl(8)"
			return 1
		fi
		laddr=`network6_getladdr lo0`
		if [ -z "${laddr}" ]; then
			ifconfig lo0 inet6 fe80::1 prefixlen 64
		fi
	fi
}

load_rc_config $name
run_rc_command "$1"
@


1.7.2.1
log
@file auto_linklocal was added on branch RELENG_8_4 on 2013-03-28 13:02:43 +0000
@
text
@d1 33
@


1.7.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 32
#!/bin/sh
#
# $FreeBSD: releng/8.4/etc/rc.d/auto_linklocal 231372 2012-02-10 10:18:30Z dougb $
#

# PROVIDE: auto_linklocal
# REQUIRE: root
# KEYWORD: nojail

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

name="auto_linklocal"
start_cmd="auto_linklocal_start"
stop_cmd=":"

auto_linklocal_start()
{
	if ! checkyesno ipv6_enable && ${SYSCTL} net.inet6 > /dev/null 2>&1; then
		if ! ${SYSCTL_W} net.inet6.ip6.auto_linklocal=0 >/dev/null 2>&1; then
			warn "failed to set sysctl(8)"
			return 1
		fi
		laddr=`network6_getladdr lo0`
		if [ -z "${laddr}" ]; then
			ifconfig lo0 inet6 fe80::1 prefixlen 64
		fi
	fi
}

load_rc_config $name
run_rc_command "$1"
@


1.6
log
@SVN rev 179965 on 2008-06-23 22:06:28Z by mtm

The sysctl(8) program exits on some errors and only emits warnings on
others. In the case where it displayed warnings it would still return
succesfully. Modify it so that it returns the number of sysctls that
it was not able to set.

Make use of this in rc.d to display only *unsuccessfull* attempts to
set sysctls.
@
text
@d3 1
a3 1
# $FreeBSD$
@


1.6.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.6.2.2
log
@SVN rev 231372 on 2012-02-10 10:18:30Z by dougb

MFC r208307:

This change does the following for the scripts that run up through
FILESYSTEMS (the default early_late_divider):
1. Move sysctl to run first
2. Move as many BEFOREs to REQUIREs as possible.
3. Minor effect, move hostid_save from right before mdconfig to right
   after.

A lot of the early scripts make use of sysctl one way or another so
running this first makes a lot of sense given that system-critical
values are often placed in sysctl.conf. (More details in original log.)

In addition to the changes from this revision, tweak a few other rcorder
elements in order to minimize the differences between the order before
and after this change, mostly related to scripts still in this branch
that are no longer in HEAD.
@
text
@d8 1
@


1.6.2.3
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d3 1
a3 1
# $FreeBSD: stable/8/etc/rc.d/auto_linklocal 231372 2012-02-10 10:18:30Z dougb $
@


1.6.2.2.2.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.6.2.2.2.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/8.3/etc/rc.d/auto_linklocal 231372 2012-02-10 10:18:30Z dougb $
@


1.6.2.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.6.2.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.6.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.5
log
@Add "nojail" keyword to prevent spurious error messages.

Spotted by:	Keve Nagy
PR:		conf/107083
@
text
@d21 4
a24 1
		${SYSCTL_W} net.inet6.ip6.auto_linklocal=0
@


1.5.2.1
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: stable/7/etc/rc.d/auto_linklocal 220110 2011-03-28 19:29:30Z dougb $
@


1.5.12.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.5.12.2
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: releng/7.4/etc/rc.d/auto_linklocal 165637 2006-12-29 15:56:21Z hrs $
@


1.5.10.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.5.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.5.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.4
log
@Add a link-local address to the lo0 even when ipv6_enable="NO".

A kernel with INET6 always has ::1 on lo0, so in the case of
ipv6_enable="NO" the lo0 can have ::1 with no link-local address.
This is a violation of the IPv6 specification.  As a workaround for
this situation, fe80::1 is added in rc.d/auto_linklocal when lo0 has
no link-local address.  This should not be harmful for IPv4-only users.
@
text
@d9 1
@


1.3
log
@Suppress a spurious warning message when a kernel without INET6 is
used.

Spotted by:	ru
Reviewed by:	ume
MFC after:	3 days
@
text
@d11 1
d21 4
@


1.2
log
@Revert the default value of net.inet6.ip6.auto_linklocal to 1.
If ipv6_enable is not set to "YES", net.inet6.ip6.auto_linklocal
is turned to 0 at boot.

Discussed with:	re@@, gnn@@
MFC after:	3 days
@
text
@d18 1
a18 1
	if ! checkyesno ipv6_enable; then
@


1.1
log
@Restore the behavior that net.inet6.ip6.auto_linklocal=0 could
be coexist with ipv6_enable="YES".

MFC after:	3 days
@
text
@d13 1
a13 2
rcvar=`set_rcvar ipv6`
start_cmd="${SYSCTL_W} net.inet6.ip6.auto_linklocal=1"
d16 7
@


1.1.2.1
log
@MFC: Restore the behavior that net.inet6.ip6.auto_linklocal=0 could
be coexist with ipv6_enable="YES".

	etc/network.subr:		1.175
	etc/rc.d/Makefile:		1.77
	etc/rc.d/auto_linklocal:	1.1

Approved by:	re (hrs)
@
text
@@


1.1.2.2
log
@MFC: Revert the default value of net.inet6.ip6.auto_linklocal to 1.
If ipv6_enable is not set to "YES", net.inet6.ip6.auto_linklocal
is turned to 0 at boot.

	etc/rc.d/auto_linklocal:	1.2
	sys/netinet6/in6_ifattach.c:	1.35

Approved by:	re (hrs)
@
text
@d13 2
a14 1
start_cmd="auto_linklocal_start"
a16 7
auto_linklocal_start()
{
	if ! checkyesno ipv6_enable; then
		${SYSCTL_W} net.inet6.ip6.auto_linklocal=0
	fi
}

@


1.1.2.3
log
@MFC rev.1.3: Suppress a spurious warning message when a kernel without
INET6 is used.

Spotted by:     ru
Reviewed by:    ume
Approved by:	re (kensmith)
@
text
@d18 1
a18 1
	if ! checkyesno ipv6_enable && ${SYSCTL} net.inet6 > /dev/null 2>&1; then
@


1.1.2.3.2.1
log
@MFC:
 Add a link-local address to the lo0 even when ipv6_enable="NO".

 A kernel with INET6 always has ::1 on lo0, so in the case of
 ipv6_enable="NO" the lo0 can have ::1 with no link-local address.
 This is a violation of the IPv6 specification.  As a workaround for
 this situation, fe80::1 is added in rc.d/auto_linklocal when lo0 has
 no link-local address.  This should not be harmful for IPv4-only users.

Approved by:    re (bmah, kensmith)
@
text
@a10 1
. /etc/network.subr
a19 4
		laddr=`network6_getladdr lo0`
		if [ -z "${laddr}" ]; then
			ifconfig lo0 inet6 fe80::1 prefixlen 64
		fi
@


1.1.2.3.2.2
log
@MFC: Add "nojail" keyword to prevent spurious error messages.

Spotted by:	Keve Nagy
PR:		conf/107083
Approved by:	re (kensmith)
@
text
@a8 1
# KEYWORD: nojail
@


1.1.2.4
log
@MFC:
 Add a link-local address to the lo0 even when ipv6_enable="NO".

 A kernel with INET6 always has ::1 on lo0, so in the case of
 ipv6_enable="NO" the lo0 can have ::1 with no link-local address.
 This is a violation of the IPv6 specification.  As a workaround
 for this situation, fe80::1 is added in rc.d/auto_linklocal when
 lo0 has no link-local address.
@
text
@a10 1
. /etc/network.subr
a19 4
		laddr=`network6_getladdr lo0`
		if [ -z "${laddr}" ]; then
			ifconfig lo0 inet6 fe80::1 prefixlen 64
		fi
@


1.1.2.5
log
@MFC: Add "nojail" keyword to prevent a spurious error message.

Spotted by:	Keve Nagy
PR:		conf/107083
@
text
@a8 1
# KEYWORD: nojail
@


1.1.2.6
log
@Switch importer
@
text
@d3 1
a3 1
# $FreeBSD: stable/6/etc/rc.d/auto_linklocal 165638 2006-12-29 16:01:12Z hrs $
@


1.1.2.5.4.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


