All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raina Daijour <raina.daijour@gmail.com>
To: lartc@vger.kernel.org
Subject: Duplicate rules in RPDB, how to delete all
Date: Mon, 01 Jul 2013 12:51:11 +0000	[thread overview]
Message-ID: <51D17B3F.8020701@gmail.com> (raw)

I'm building a privacy network where users connect to an 'entry' server
using openvpn which then routes their traffic through one of a dozen
'exit' servers. The exit server is specified by the client and passed to
a script running on the 'entry' server when the client connects which
then creates a new rule in the RPDB from the VPN assigned IP to the
custom routing table that has its default gateway pointing to the remote
server. When the user disconnects, this rule needs to be deleted or
another user that receives the same IP may end up with their traffic
being incorrectly routed.

The problem I have is that sometimes the script doesn't run when a user
disconnects  and we are left with a rule for an IP that doesn't exist
that needs to be deleted. Sometimes we end up with duplicate rules with
the exact same SELECTOR (the users IP) and TABLE_ID. The obvious
solution is to delete any rules matching the source IP when a user
connects but the 'ip rule delete' command doesn't delete all matching
rules, it only deletes the last inserted (highest priority) rule. Is
there any way to delete all rules matching a selector? Any advice/hint
would be greatly appreciated.

                 reply	other threads:[~2013-07-01 12:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=51D17B3F.8020701@gmail.com \
    --to=raina.daijour@gmail.com \
    --cc=lartc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.