Skip to content

Commit 724ec5a

Browse files
committed
Merge ../iproute2-next
2 parents 97864a5 + 97b44d5 commit 724ec5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1621
-1020
lines changed

Makefile

-6
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ DEFINES+=-DCONFDIR=\"$(CONFDIR)\" \
4040
-DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \
4141
-DNETNS_ETC_DIR=\"$(NETNS_ETC_DIR)\"
4242

43-
#options for decnet
44-
ADDLIB+=dnet_ntop.o dnet_pton.o
45-
46-
#options for ipx
47-
ADDLIB+=ipx_ntop.o ipx_pton.o
48-
4943
#options for mpls
5044
ADDLIB+=mpls_ntop.o mpls_pton.o
5145

README.decnet

-33
This file was deleted.

README.iproute2+tc

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ in rsvp/cbqinit.eth1.
4242

4343

4444
Terminology and advices about setting CBQ parameters may be found in Sally Floyd
45-
papers.
45+
papers.
4646

4747

4848
Pairs X:Y are class handles, X:0 are qdisc handles.

README.lnstat

+8-9
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ This tool is a generalized and more feature-complete replacement for the old
77

88
In addition to routing cache statistics, it supports any kind of statistics
99
the linux kernel exports via a file in /proc/net/stat. In a stock 2.6.9
10-
kernel, this is
11-
per-protocol neighbour cache statistics
12-
(ipv4, ipv6, atm, decnet)
10+
kernel, this is
11+
per-protocol neighbour cache statistics
12+
(ipv4, ipv6, atm)
1313
routing cache statistics
1414
(ipv4)
1515
connection tracking statistics
@@ -29,7 +29,7 @@ In order to get a list of supported statistics files, you can run
2929
lnstat -d
3030

3131
It will display something like
32-
32+
3333
/proc/net/stat/arp_cache:
3434
1: entries
3535
2: allocs
@@ -52,19 +52,19 @@ arp_cach|rt_cache|arp_cach|
5252

5353

5454
You can specify the interval (e.g. 10 seconds) by:
55-
55+
5656
lnstat -i 10
5757

5858
You can specify to only use one particular statistics file:
5959

6060
lnstat -f ip_conntrack
6161

62-
You can specify individual field widths
62+
You can specify individual field widths
6363

6464
lnstat -k arp_cache:entries,rt_cache:entries -w 20,8
6565

6666
You can specify not to print a header at all
67-
67+
6868
lnstat -s 0
6969

7070
You can specify to print a header only at start of the program
@@ -76,6 +76,5 @@ You can specify to print a header at start and every 20 lines:
7676
lnstat -s 20
7777

7878
You can specify the number of samples you want to take (e.g. 5):
79-
80-
lnstat -c 5
8179

80+
lnstat -c 5

bash-completion/tc

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ _tc_qdisc_options()
302302
;;
303303
gred)
304304
_tc_once_attr 'setup vqs default grio vq prio limit min max avpkt \
305-
burst probability bandwidth'
305+
burst probability bandwidth ecn harddrop'
306306
return 0
307307
;;
308308
hhf)

bridge/bridge.c

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ static int batch(const char *name)
9797
return EXIT_FAILURE;
9898
}
9999

100+
rtnl_set_strict_dump(&rth);
101+
100102
cmdlineno = 0;
101103
while (getcmdline(&line, &len, stdin) != -1) {
102104
char *largv[100];
@@ -205,6 +207,8 @@ main(int argc, char **argv)
205207
if (rtnl_open(&rth, 0) < 0)
206208
exit(1);
207209

210+
rtnl_set_strict_dump(&rth);
211+
208212
if (argc > 1)
209213
return do_cmd(argv[1], argc-1, argv+1);
210214

bridge/fdb.c

+47-15
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "rt_names.h"
3131
#include "utils.h"
3232

33-
static unsigned int filter_index, filter_vlan, filter_state;
33+
static unsigned int filter_index, filter_vlan, filter_state, filter_master;
3434

3535
static void usage(void)
3636
{
@@ -256,20 +256,49 @@ int print_fdb(struct nlmsghdr *n, void *arg)
256256
return 0;
257257
}
258258

259-
static int fdb_show(int argc, char **argv)
259+
static int fdb_linkdump_filter(struct nlmsghdr *nlh, int reqlen)
260260
{
261-
struct {
262-
struct nlmsghdr n;
263-
struct ifinfomsg ifm;
264-
char buf[256];
265-
} req = {
266-
.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg)),
267-
.ifm.ifi_family = PF_BRIDGE,
268-
};
261+
int err;
262+
263+
if (filter_index) {
264+
struct ifinfomsg *ifm = NLMSG_DATA(nlh);
265+
266+
ifm->ifi_index = filter_index;
267+
}
268+
269+
if (filter_master) {
270+
err = addattr32(nlh, reqlen, IFLA_MASTER, filter_master);
271+
if (err)
272+
return err;
273+
}
274+
275+
return 0;
276+
}
277+
278+
static int fdb_dump_filter(struct nlmsghdr *nlh, int reqlen)
279+
{
280+
int err;
281+
282+
if (filter_index) {
283+
struct ndmsg *ndm = NLMSG_DATA(nlh);
269284

285+
ndm->ndm_ifindex = filter_index;
286+
}
287+
288+
if (filter_master) {
289+
err = addattr32(nlh, reqlen, NDA_MASTER, filter_master);
290+
if (err)
291+
return err;
292+
}
293+
294+
return 0;
295+
}
296+
297+
static int fdb_show(int argc, char **argv)
298+
{
270299
char *filter_dev = NULL;
271300
char *br = NULL;
272-
int msg_size = sizeof(struct ifinfomsg);
301+
int rc;
273302

274303
while (argc > 0) {
275304
if ((strcmp(*argv, "brport") == 0) || strcmp(*argv, "dev") == 0) {
@@ -304,19 +333,22 @@ static int fdb_show(int argc, char **argv)
304333
fprintf(stderr, "Cannot find bridge device \"%s\"\n", br);
305334
return -1;
306335
}
307-
addattr32(&req.n, sizeof(req), IFLA_MASTER, br_ifindex);
308-
msg_size += RTA_LENGTH(4);
336+
filter_master = br_ifindex;
309337
}
310338

311339
/*we'll keep around filter_dev for older kernels */
312340
if (filter_dev) {
313341
filter_index = ll_name_to_index(filter_dev);
314342
if (!filter_index)
315343
return nodev(filter_dev);
316-
req.ifm.ifi_index = filter_index;
317344
}
318345

319-
if (rtnl_dump_request(&rth, RTM_GETNEIGH, &req.ifm, msg_size) < 0) {
346+
if (rth.flags & RTNL_HANDLE_F_STRICT_CHK)
347+
rc = rtnl_neighdump_req(&rth, PF_BRIDGE, fdb_dump_filter);
348+
else
349+
rc = rtnl_linkdump_req_filter_fn(&rth, PF_BRIDGE,
350+
fdb_linkdump_filter);
351+
if (rc < 0) {
320352
perror("Cannot send dump request");
321353
exit(1);
322354
}

0 commit comments

Comments
 (0)