From: Denys Fedoryshchenko <denys@visp.net.lb>
To: Patrick McHardy <kaber@trash.net>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>,
netdev@vger.kernel.org
Subject: Re: iproute2 proposal
Date: Wed, 6 Aug 2008 13:22:54 +0300 [thread overview]
Message-ID: <200808061322.54655.denys@visp.net.lb> (raw)
In-Reply-To: <4899784C.5060405@trash.net>
[-- Attachment #1: Type: text/plain, Size: 108 bytes --]
On Wednesday 06 August 2008, Patrick McHardy wrote:
> No patch attached ..
Sorry :-) Now must be attached
[-- Attachment #2: iproute2-proposal2.patch --]
[-- Type: text/x-diff, Size: 3961 bytes --]
diff -Naur iproute2-original/tc/f_route.c iproute2-patched/tc/f_route.c
--- iproute2-original/tc/f_route.c 2008-08-05 19:15:56.000000000 +0000
+++ iproute2-patched/tc/f_route.c 2008-08-06 09:50:48.000000000 +0000
@@ -25,6 +25,8 @@
#include "tc_common.h"
#include "tc_util.h"
+extern int link_cache;
+
static void explain(void)
{
fprintf(stderr, "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n");
@@ -83,7 +85,10 @@
} else if (matches(*argv, "fromif") == 0) {
__u32 id;
NEXT_ARG();
- ll_init_map(&rth);
+ if (!link_cache) {
+ ll_init_map(&rth);
+ link_cache = 1;
+ }
if ((id=ll_name_to_index(*argv)) <= 0) {
fprintf(stderr, "Illegal \"fromif\"\n");
return -1;
diff -Naur iproute2-original/tc/m_mirred.c iproute2-patched/tc/m_mirred.c
--- iproute2-original/tc/m_mirred.c 2008-08-05 19:15:56.000000000 +0000
+++ iproute2-patched/tc/m_mirred.c 2008-08-06 09:49:39.000000000 +0000
@@ -27,6 +27,7 @@
#include <linux/tc_act/tc_mirred.h>
int mirred_d = 1;
+extern int link_cache;
static void
explain(void)
@@ -146,7 +147,10 @@
if (d[0]) {
int idx;
- ll_init_map(&rth);
+ if (!link_cache) {
+ ll_init_map(&rth);
+ link_cache = 1;
+ }
if ((idx = ll_name_to_index(d)) == 0) {
fprintf(stderr, "Cannot find device \"%s\"\n", d);
diff -Naur iproute2-original/tc/tc.c iproute2-patched/tc/tc.c
--- iproute2-original/tc/tc.c 2008-08-05 19:15:56.000000000 +0000
+++ iproute2-patched/tc/tc.c 2008-08-06 09:47:18.000000000 +0000
@@ -38,6 +38,7 @@
int resolve_hosts = 0;
int use_iec = 0;
int force = 0;
+int link_cache = 0;
struct rtnl_handle rth;
static void *BODY = NULL; /* cached handle dlopen(NULL) */
diff -Naur iproute2-original/tc/tc_class.c iproute2-patched/tc/tc_class.c
--- iproute2-original/tc/tc_class.c 2008-08-05 19:15:56.000000000 +0000
+++ iproute2-patched/tc/tc_class.c 2008-08-06 09:51:18.000000000 +0000
@@ -25,6 +25,8 @@
#include "tc_util.h"
#include "tc_common.h"
+extern int link_cache;
+
static void usage(void);
static void usage(void)
@@ -130,7 +132,10 @@
}
if (d[0]) {
- ll_init_map(&rth);
+ if (!link_cache) {
+ ll_init_map(&rth);
+ link_cache = 1;
+ }
if ((req.t.tcm_ifindex = ll_name_to_index(d)) == 0) {
fprintf(stderr, "Cannot find device \"%s\"\n", d);
@@ -273,7 +278,10 @@
argc--; argv++;
}
- ll_init_map(&rth);
+ if (!link_cache) {
+ ll_init_map(&rth);
+ link_cache = 1;
+ }
if (d[0]) {
if ((t.tcm_ifindex = ll_name_to_index(d)) == 0) {
diff -Naur iproute2-original/tc/tc_filter.c iproute2-patched/tc/tc_filter.c
--- iproute2-original/tc/tc_filter.c 2008-08-05 19:15:56.000000000 +0000
+++ iproute2-patched/tc/tc_filter.c 2008-08-06 09:48:54.000000000 +0000
@@ -26,6 +26,7 @@
#include "tc_util.h"
#include "tc_common.h"
+extern int link_cache;
static void usage(void);
static void usage(void)
@@ -158,7 +159,10 @@
if (d[0]) {
- ll_init_map(&rth);
+ if (!link_cache) {
+ ll_init_map(&rth);
+ link_cache = 1;
+ }
if ((req.t.tcm_ifindex = ll_name_to_index(d)) == 0) {
fprintf(stderr, "Cannot find device \"%s\"\n", d);
diff -Naur iproute2-original/tc/tc_qdisc.c iproute2-patched/tc/tc_qdisc.c
--- iproute2-original/tc/tc_qdisc.c 2008-08-05 19:15:56.000000000 +0000
+++ iproute2-patched/tc/tc_qdisc.c 2008-08-06 09:53:11.000000000 +0000
@@ -25,6 +25,8 @@
#include "tc_util.h"
#include "tc_common.h"
+extern int link_cache;
+
static int usage(void);
static int usage(void)
@@ -145,7 +147,10 @@
if (d[0]) {
int idx;
- ll_init_map(&rth);
+ if (!link_cache) {
+ ll_init_map(&rth);
+ link_cache = 1;
+ }
if ((idx = ll_name_to_index(d)) == 0) {
fprintf(stderr, "Cannot find device \"%s\"\n", d);
@@ -272,7 +277,10 @@
argc--; argv++;
}
- ll_init_map(&rth);
+ if (!link_cache) {
+ ll_init_map(&rth);
+ link_cache = 1;
+ }
if (d[0]) {
if ((t.tcm_ifindex = ll_name_to_index(d)) == 0) {
next prev parent reply other threads:[~2008-08-06 10:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-05 22:25 iproute2 proposal Denys Fedoryshchenko
2008-08-06 8:28 ` Patrick McHardy
2008-08-06 10:04 ` Denys Fedoryshchenko
2008-08-06 10:09 ` Patrick McHardy
2008-08-06 10:09 ` Patrick McHardy
2008-08-06 10:22 ` Denys Fedoryshchenko [this message]
2008-08-06 10:25 ` Patrick McHardy
2008-08-06 10:38 ` Denys Fedoryshchenko
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=200808061322.54655.denys@visp.net.lb \
--to=denys@visp.net.lb \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).