public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Toralf Förster" <toralf.foerster@gmx.de>
To: netdev@vger.kernel.org
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: How to find an unused TAP device with kernel 3.8 ?
Date: Sat, 26 Jan 2013 11:29:49 +0100	[thread overview]
Message-ID: <5103B01D.5070303@gmx.de> (raw)

With kernel 3.8. I just realized that all pre-defined TAP devices are
RUNNING even if no virtual linux system is using it. Now I'm wondering
whether this is a new feature of the upcoming kernel, a bug of the old -
and how I can avoid that.

Background : When I start a user mode linux instance, I currently grep
for the next free tap device in this way :

Code:	
for t in $(ifconfig | grep "^tap" | cut -f1 -d:)
do
   ethtool $t | grep -q 'Link detected: no'
   if [[ $? -eq 0 ]]; then
      NET="tuntap,$t"
      break
   fi
done

but this doesn't work now anymore.

Here is the diff in dmesg

$ diff 3.7.1 3.8.0-rc1+ | grep UP

< br0: flags=4355<UP,BROADCAST,PROMISC,MULTICAST>  mtu 1500
> br0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500

< tap0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
> tap0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500


more details : http://forums.gentoo.org/viewtopic-p-7211498.html#7211498


-- 
MfG/Sincerely
Toralf Förster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

             reply	other threads:[~2013-01-26 10:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-26 10:29 Toralf Förster [this message]
2013-01-28  9:38 ` How to find an unused TAP device with kernel 3.8 ? Jason Wang
2013-01-28 10:11   ` [PATCH] tun: fix carrier on/off status Michael S. Tsirkin
2013-01-28 10:38     ` [PATCHv2] " Michael S. Tsirkin
2013-01-28 11:00       ` Jason Wang
2013-01-28 19:38       ` Toralf Förster
2013-01-29 20:45       ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5103B01D.5070303@gmx.de \
    --to=toralf.foerster@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox