From: Benjamin LaHaise <bcrl@lhnet•ca>
To: Ben Greear <greearb@candelatech•com>
Cc: "Eric W. Biederman" <ebiederm@xmission•com>,
Patrick McHardy <kaber@trash•net>,
netdev@vger•kernel.org
Subject: Re: RFC: net 00/05: routing based send-to-self implementation
Date: Mon, 30 Nov 2009 15:04:30 -0500 [thread overview]
Message-ID: <20091130200430.GS14610@kvack.org> (raw)
In-Reply-To: <4B141EFB.4070409@candelatech.com>
On Mon, Nov 30, 2009 at 11:37:31AM -0800, Ben Greear wrote:
> This doesn't work if you want to have one application manage lots of
> interfaces and send traffic between these interfaces. Certainly there are
> use-cases that can use multiple name-spaces, but it's nice to have the
> option not to use them as well.
Actually, it's quite doable from within one application. An application
I recently adapted to make use of multiple network namespaces within a single
process by way of pthreads and unshare(CLONE_NEWNET). The scheme I used
is to just open the socket in a new namespace in a thread. Since the
file descriptor table is still shared, it's easy to send/receive data from
any other thread, regardless of which virtual network namespace it's in.
All told, setting up virtual routers with namespaces is pretty easy.
-ben
next prev parent reply other threads:[~2009-11-30 20:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-30 17:55 RFC: net 00/05: routing based send-to-self implementation Patrick McHardy
2009-11-30 17:55 ` net 01/05: fib_rules: rearrange struct fib_rule Patrick McHardy
2009-11-30 17:55 ` net 02/05: fib_rules: rename ifindex/ifname/FRA_IFNAME to iifindex/iifname/FRA_IIFNAME Patrick McHardy
2009-11-30 20:21 ` Jarek Poplawski
2009-11-30 20:23 ` Patrick McHardy
2009-11-30 17:55 ` net 03/05: fib_rules: add oif classification Patrick McHardy
2009-11-30 22:31 ` Jarek Poplawski
2009-12-01 9:32 ` Patrick McHardy
2009-12-01 9:48 ` Jarek Poplawski
2009-11-30 17:55 ` net 04/05: fib_rules: allow to delete local rule Patrick McHardy
2009-12-01 13:23 ` jamal
2009-12-01 17:12 ` Alexey Kuznetsov
2009-12-01 17:38 ` Patrick McHardy
2009-11-30 17:55 ` ipv4 05/05: add sysctl to accept packets with local source addresses Patrick McHardy
2009-11-30 19:32 ` RFC: net 00/05: routing based send-to-self implementation Eric W. Biederman
2009-11-30 19:37 ` Ben Greear
2009-11-30 20:04 ` Benjamin LaHaise [this message]
2009-11-30 20:15 ` Patrick McHardy
2009-11-30 20:15 ` Ben Greear
2009-11-30 20:23 ` Benjamin LaHaise
2009-12-03 6:32 ` 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=20091130200430.GS14610@kvack.org \
--to=bcrl@lhnet$(echo .)ca \
--cc=ebiederm@xmission$(echo .)com \
--cc=greearb@candelatech$(echo .)com \
--cc=kaber@trash$(echo .)net \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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