Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 145187

Summary: hotplug doesn't handle tun*/tap* events properly for vpn's
Product: Gentoo Linux Reporter: Jason Cooper <gentoobugs>
Component: [OLD] Core systemAssignee: Greg Kroah-Hartman (RETIRED) <gregkh>
Status: RESOLVED WONTFIX    
Severity: normal CC: base-system
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 145809    
Bug Blocks:    

Description Jason Cooper 2006-08-26 08:02:50 UTC
I recently began using openssh-4.3_p2 for a simple VPN setup.  v4.3 added support for creating tun/tap interfaces.  It works well except that hotplug doesn't handle the tun/tap ADD event.  Or, more accurately, it handles it improperly.

To fix, change lines 40 and 89 of /etc/hotplug/net.agent from:

ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)

to:

ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*)

so that the ADD and REMOVE events are handled properly.

I'm not sure what this make break on other systems, but it has no side effects on mine.

# emerge --info

Portage 2.1-r2 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.3.6-r4, 2.6.17-gentoo i686)
=================================================================
System uname: 2.6.17-gentoo i686 Intel(R) Pentium(R) M processor 1.60GHz
Gentoo Base System version 1.12.4
app-admin/eselect-compiler: [Not Present]
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r3
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/mozilla/defaults/pref /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache confcache distlocks metadata-transfer parallel-fetch sandbox sfperms strict userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://gentoo.arcticnetwork.ca/ http://gentoo.mirrored.ca/ http://gentoo.osuosl.org/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://www.gtlib.gatech.edu/pub/gentoo http://adelie.polymtl.ca/ "
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apache2 apm arts avi bash-completion berkdb bitmap-fonts cli crypt cups dlloader doc dri eds emboss encode esd foomaticdb fortran gdbm gif gnome gpm gstreamer gtk gtk2 imlib input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kde kerberos ldap libg++ libwww linguas_en linguas_en_US mad mikmod motif mp3 mpeg ncurses nls nntp nptl nptlonly ogg opengl oss pam pcre pdflib perl png pppd python qt3 qt4 quicktime readline reflection samba sasl sdl session spell spl ssl static tcpd truetype truetype-fonts type1-fonts udev video_cards_radeon video_cards_vesa vorbis xml xmms xorg xv zlib elibc_glibc input_devices_evdev kernel_linux userland_GNU"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

#######################
relevant versions:
   net-misc/openssh-4.3_p2-r1
   dev-libs/openssl-0.9.7j
   sys-apps/hotplug-20040923-r2
   sys-apps/hotplug-base-20040401
Comment 1 Greg Kroah-Hartman (RETIRED) gentoo-dev 2006-08-27 11:29:35 UTC
This goes against the wishes of other people who wanted the tun/tap interfaces
to be handled by that agent...

I suggest just not using the hotplug agent at all...
Comment 2 Jason Cooper 2006-08-27 16:23:42 UTC
(In reply to comment #1)
> This goes against the wishes of other people who wanted the tun/tap interfaces
> to be handled by that agent...
> 
> I suggest just not using the hotplug agent at all...
> 

Greg,

I apologize, I wasn't clear.  Lines 40 and 89 of net.agent catch ADD and REMOVE events and then 'exit 0'.  My change allows hotplug to detect tap*/tun* events, and instead of exiting, launch the init script, which is what I need.  

Is there a better way to detect the creation of tun/tap devices and launch the init script?

On the same vein, is there a reason hotplug, by default, doesn't handle tun/tap events?

thx,

Jason.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-09-04 00:05:33 UTC
sys-apps/hotplug is useless with any recent udev version, and 2.4 kernels are no longer supported. Unmerge it and move on.

WONTFIX.