Bug 109980 - /etc/rc.d/netif restart doesn't destroy cloned_interfaces
Summary: /etc/rc.d/netif restart doesn't destroy cloned_interfaces
Status: Closed DUPLICATE of bug 158734
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 6.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-06 11:30 UTC by Marat N.Afanasyev
Modified: 2020-12-04 19:36 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marat N.Afanasyev 2007-03-06 11:30:03 UTC
	/etc/rc.d/netif script doesn't destroy cloned interfaces,
	e.g. vlanXX, when called with restart parameter. This leads to
	impossibility to reconfigure cloned devices, because of 
	error produced by ifconfig. Before restart interfaces 
	one should destroy all cloned interfaces manually

Fix: 

n/a
How-To-Repeat: 	add cloned_interfaces to /etc/rc.conf:
	cloned_interfaces="vlan2"
	add ifconfig_vlan2 to /etc/rc.conf:
	ifconfig_vlan2="vlan 2 vlandev ifXX 192.168.0.1 255.255.255.0"
	try to restart netifs two times
	look to:
	ifconfig: SIOCIFCREATE: File exists 
	error string, and look to vlan2 interface.
Comment 1 Brooks Davis freebsd_committer 2007-03-07 20:42:06 UTC
The most realistinc solution to this problem is probably do simply
disable the restart case.  I don't think it's going to be practical to
support restart.

-- Brooks
Comment 2 Marat N.Afanasyev 2007-03-08 06:08:47 UTC
I think that if we create cloned interfaces at start, we should destroy 
them when shutting down.

-- 
SY, Marat
Comment 3 Yar Tikhiy freebsd_committer 2007-08-17 10:02:37 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to the rc list for consideration.
Comment 4 Chris Rees freebsd_committer 2012-10-30 14:47:58 UTC
State Changed
From-To: open->closed

From rc.d/netif, you can use clonedown and then cloneup to reset cloned 
interfaces.
Comment 5 Cy Schubert freebsd_committer 2020-10-12 05:10:27 UTC
This is not fixed. See PR/158734 for the patch.
Comment 6 Cy Schubert freebsd_committer 2020-10-12 05:12:20 UTC
This is a DUP of PR/158734. Closing this PR in lieu of PR/158734. See 158734 for the proposed patch.

*** This bug has been marked as a duplicate of bug 158734 ***
Comment 7 commit-hook freebsd_committer 2020-10-19 20:38:36 UTC
A commit references this bug:

Author: cy
Date: Mon Oct 19 20:37:39 UTC 2020
New revision: 366857
URL: https://svnweb.freebsd.org/changeset/base/366857

Log:
  Destroy cloned interfaces at netif stop, netif restart and shutdown.
  This is especially important during shutdown because a child interface
  of lagg with WOL enabled will not enable WOL at interface shutdown and
  thus no WOL to wake up the device (and machine).

  PR:		158734, 109980
  Reported by:	Antonio Huete Jimenez <tuxillo at quantumachine.net>
  		Marat N.Afanasyev <marat at zealot.ksu.ru>
  reviewed by:	kp
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D26797

Changes:
  head/libexec/rc/rc.d/netif
Comment 8 commit-hook freebsd_committer 2020-10-26 01:18:28 UTC
A commit references this bug:

Author: cy
Date: Mon Oct 26 01:18:16 UTC 2020
New revision: 367049
URL: https://svnweb.freebsd.org/changeset/base/367049

Log:
  MFC r366857:
  Destroy cloned interfaces at netif stop, netif restart and shutdown.
  This is especially important during shutdown because a child interface
  of lagg with WOL enabled will not enable WOL at interface shutdown and
  thus no WOL to wake up the device (and machine).

  PR:		158734, 109980
  Reported by:	Antonio Huete Jimenez <tuxillo at quantumachine.net>
  		Marat N.Afanasyev <marat at zealot.ksu.ru>
  reviewed by:	kp

Changes:
_U  stable/12/
  stable/12/libexec/rc/rc.d/netif
Comment 9 commit-hook freebsd_committer 2020-10-26 01:23:32 UTC
A commit references this bug:

Author: cy
Date: Mon Oct 26 01:23:15 UTC 2020
New revision: 367050
URL: https://svnweb.freebsd.org/changeset/base/367050

Log:
  This is a direct commit to stable/11 however it performs MFC r366857
  applied to stable/12 with r367049. This is due to src/etc/rc.d/netif
  having been previously moved to src/libexec/rc.d/netif.

  Destroy cloned interfaces at netif stop, netif restart and shutdown.
  This is especially important during shutdown because a child interface
  of lagg with WOL enabled will not enable WOL at interface shutdown and
  thus no WOL to wake up the device (and machine).

  PR:		158734, 109980
  Reported by:	Antonio Huete Jimenez <tuxillo at quantumachine.net>
  		Marat N.Afanasyev <marat at zealot.ksu.ru>
  reviewed by:    kp

Changes:
  stable/11/etc/rc.d/netif
Comment 10 commit-hook freebsd_committer 2020-12-04 19:31:24 UTC
A commit references this bug:

Author: cy
Date: Fri Dec  4 19:31:16 UTC 2020
New revision: 368345
URL: https://svnweb.freebsd.org/changeset/base/368345

Log:
  Revert r366857.

  r366857 created a number of problems, tearing down interfaces too
  early in shutdown. This resulted in:

  - hung ssh sessions when shutting down or rebooting remotely using
    shutdown (I've used exec shutdown, for years, as apposed to simply
    shutdown).

  - NFS mounted filesystems "disappear" prior to unmount.

  - dhclient attached to a VLAN on an interface who's parent interface
    has already shut down prints errors.

  The path forward is to teach lagg(4) and vlan(4) about WOL.

  PR:		251531, 251540
  PR:		158734, 109980 are broken again
  Reported by:	jhb, emaste, jtl, Helge Oldach<freebsd_oldach.net>
  		Martin Birgmeier <d8zNeCFG_aon.at>
  MFC after:      Immediately
  Discussion at:	https://reviews.freebsd.org/D27459

Changes:
  head/libexec/rc/rc.d/netif
Comment 11 commit-hook freebsd_committer 2020-12-04 19:36:31 UTC
A commit references this bug:

Author: cy
Date: Fri Dec  4 19:35:44 UTC 2020
New revision: 368346
URL: https://svnweb.freebsd.org/changeset/base/368346

Log:
  Revert r366857.

  r366857 created a number of problems, tearing down interfaces too
  early in shutdown. This resulted in:

  - hung ssh sessions when shutting down or rebooting remotely using
    shutdown (I've used exec shutdown, for years, as apposed to simply
    shutdown).

  - NFS mounted filesystems "disappear" prior to unmount.

  - dhclient attached to a VLAN on an interface who's parent interface
    has already shut down prints errors.

  The path forward is to teach lagg(4) and vlan(4) about WOL.

  PR:		251531, 251540
  PR:		158734, 109980 are broken again
  Reported by:	jhb, emaste, jtl, Helge Oldach<freebsd_oldach.net>
  		Martin Birgmeier <d8zNeCFG_aon.at>
  Discussion at:	https://reviews.freebsd.org/D27459

Changes:
_U  stable/12/
  stable/12/libexec/rc/rc.d/netif