Skip to content

Commit

Permalink
Merge tag 'v4.14.0'
Browse files Browse the repository at this point in the history
v4.14.0
  • Loading branch information
cpaasch committed Mar 9, 2018
2 parents 850f858 + 7d14d00 commit 8d27554
Show file tree
Hide file tree
Showing 365 changed files with 22,186 additions and 11,054 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# locally generated
Config
static-syms.h
config.*
Config
*.o
*.a
*.so
Expand Down Expand Up @@ -36,6 +37,8 @@ series
# tests
testsuite/results
testsuite/iproute2/iproute2-this
testsuite/tools/generate_nlmsg
testsuite/tests/ip/link/dev_wo_vf_rate.nl

# doc files generated at runtime
doc/*.aux
Expand Down
23 changes: 14 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ifndef VERBOSE
# Top level Makefile for iproute2

ifeq ($(VERBOSE),0)
MAKEFLAGS += --no-print-directory
endif

Expand All @@ -7,6 +9,7 @@ LIBDIR?=$(PREFIX)/lib
SBINDIR?=/sbin
CONFDIR?=/etc/iproute2
DATADIR?=$(PREFIX)/share
HDRDIR?=$(PREFIX)/include/iproute2
DOCDIR?=$(DATADIR)/doc/iproute2
MANDIR?=$(DATADIR)/man
ARPDDIR?=/var/lib/arpd
Expand Down Expand Up @@ -43,49 +46,51 @@ CCOPTS = -O2
WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
WFLAGS += -Wmissing-declarations -Wold-style-definition -Wformat=2

CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS)
CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS)
YACCFLAGS = -d -t -v

SUBDIRS=lib ip tc bridge misc netem genl tipc devlink man
SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man

LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a
LDLIBS += $(LIBNETLINK)

all: Config
all: config.mk
@set -e; \
for i in $(SUBDIRS); \
do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done

Config:
config.mk:
sh configure $(KERNEL_INCLUDE)

install: all
install -m 0755 -d $(DESTDIR)$(SBINDIR)
install -m 0755 -d $(DESTDIR)$(CONFDIR)
install -m 0755 -d $(DESTDIR)$(ARPDDIR)
install -m 0755 -d $(DESTDIR)$(HDRDIR)
install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples
install -m 0755 -d $(DESTDIR)$(DOCDIR)/examples/diffserv
install -m 0644 README.iproute2+tc $(shell find examples -maxdepth 1 -type f) \
$(DESTDIR)$(DOCDIR)/examples
install -m 0644 $(shell find examples/diffserv -maxdepth 1 -type f) \
$(DESTDIR)$(DOCDIR)/examples/diffserv
@for i in $(SUBDIRS) doc; do $(MAKE) -C $$i install; done
@for i in $(SUBDIRS); do $(MAKE) -C $$i install; done
install -m 0644 $(shell find etc/iproute2 -maxdepth 1 -type f) $(DESTDIR)$(CONFDIR)
install -m 0755 -d $(DESTDIR)$(BASH_COMPDIR)
install -m 0644 bash-completion/tc $(DESTDIR)$(BASH_COMPDIR)
install -m 0644 include/bpf_elf.h $(DESTDIR)$(HDRDIR)

snapshot:
echo "static const char SNAPSHOT[] = \""`date +%y%m%d`"\";" \
> include/SNAPSHOT.h

clean:
@for i in $(SUBDIRS) doc; \
@for i in $(SUBDIRS); \
do $(MAKE) $(MFLAGS) -C $$i clean; done

clobber:
touch Config
touch config.mk
$(MAKE) $(MFLAGS) clean
rm -f Config cscope.*
rm -f config.mk cscope.*

distclean: clobber

Expand Down
5 changes: 3 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ database routines. Often this is in the db-devel package.

2. make

The makefile will automatically build a Config file which
contains whether or not ATM is available, etc.
The makefile will automatically build a config.mk file which
contains definitions of libraries that may or may not be available
on the system such as: ATM, ELF, MNL, and SELINUX.

3. To make documentation, cd to doc/ directory , then
look at start of Makefile and set correct values for
Expand Down
121 changes: 99 additions & 22 deletions bash-completion/tc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# Copyright 2016 6WIND S.A.
# Copyright 2016 Quentin Monnet <[email protected]>

QDISC_KIND=' choke codel bfifo pfifo pfifo_head_drop fq fq_codel gred hhf \
mqprio multiq netem pfifo_fast pie red rr sfb sfq tbf atm cbq drr \
dsmark hfsc htb prio qfq '
FILTER_KIND=' basic bpf cgroup flow flower fw route rsvp tcindex u32 matchall '
ACTION_KIND=' gact mirred bpf sample '

# Takes a list of words in argument; each one of them is added to COMPREPLY if
# it is not already present on the command line. Returns no value.
_tc_once_attr()
Expand All @@ -20,6 +26,26 @@ _tc_once_attr()
done
}

# Takes a list of words in argument; each one of them is added to COMPREPLY if
# it is not already present on the command line from the provided index. Returns
# no value.
_tc_once_attr_from()
{
local w subcword found from=$1
shift
for w in $*; do
found=0
for (( subcword=$from; subcword < ${#words[@]}-1; subcword++ )); do
if [[ $w == ${words[subcword]} ]]; then
found=1
break
fi
done
[[ $found -eq 0 ]] && \
COMPREPLY+=( $( compgen -W "$w" -- "$cur" ) )
done
}

# Takes a list of words in argument; adds them all to COMPREPLY if none of them
# is already present on the command line. Returns no value.
_tc_one_of_list()
Expand All @@ -33,6 +59,21 @@ _tc_one_of_list()
COMPREPLY+=( $( compgen -W "$*" -- "$cur" ) )
}

# Takes a list of words in argument; adds them all to COMPREPLY if none of them
# is already present on the command line from the provided index. Returns no
# value.
_tc_one_of_list_from()
{
local w subcword from=$1
shift
for w in $*; do
for (( subcword=$from; subcword < ${#words[@]}-1; subcword++ )); do
[[ $w == ${words[subcword]} ]] && return 1
done
done
COMPREPLY+=( $( compgen -W "$*" -- "$cur" ) )
}

# Returns "$cur ${cur}arg1 ${cur}arg2 ..."
_tc_expand_units()
{
Expand Down Expand Up @@ -345,11 +386,44 @@ _tc_bpf_options()
return 0
}

# Complete with options names for filter actions.
# This function is recursive, thus allowing multiple actions statement to be
# parsed.
# Returns 0 is completion should stop after running this function, 1 otherwise.
_tc_filter_action_options()
{
for ((acwd=$1; acwd < ${#words[@]}-1; acwd++));
do
if [[ action == ${words[acwd]} ]]; then
_tc_filter_action_options $((acwd+1)) && return 0
fi
done

local action acwd
for ((acwd=$1; acwd < ${#words[@]}-1; acwd++)); do
if [[ $ACTION_KIND =~ ' '${words[acwd]}' ' ]]; then
_tc_one_of_list_from $acwd action
_tc_action_options $acwd && return 0
fi
done
_tc_one_of_list_from $acwd $ACTION_KIND
return 0
}

# Complete with options names for filters.
# Returns 0 is completion should stop after running this function, 1 otherwise.
_tc_filter_options()
{
case $1 in

for ((acwd=$1; acwd < ${#words[@]}-1; acwd++));
do
if [[ action == ${words[acwd]} ]]; then
_tc_filter_action_options $((acwd+1)) && return 0
fi
done

filter=${words[$1]}
case $filter in
basic)
_tc_once_attr 'match action classid'
return 0
Expand All @@ -375,6 +449,10 @@ _tc_filter_options()
_tc_once_attr 'map hash divisor baseclass match action'
return 0
;;
matchall)
_tc_once_attr 'action skip_sw skip_hw'
return 0
;;
flower)
_tc_once_attr 'action classid indev dst_mac src_mac eth_type \
ip_proto dst_ip src_ip dst_port src_port'
Expand Down Expand Up @@ -419,20 +497,28 @@ _tc_filter_options()
# Returns 0 is completion should stop after running this function, 1 otherwise.
_tc_action_options()
{
case $1 in
local from=$1
local action=${words[from]}
case $action in
bpf)
_tc_bpf_options
return 0
;;
mirred)
_tc_one_of_list 'ingress egress'
_tc_one_of_list 'mirror redirect'
_tc_once_attr 'index dev'
_tc_one_of_list_from $from 'ingress egress'
_tc_one_of_list_from $from 'mirror redirect'
_tc_once_attr_from $from 'index dev'
return 0
;;
sample)
_tc_once_attr_from $from 'rate'
_tc_once_attr_from $from 'trunc'
_tc_once_attr_from $from 'group'
return 0
;;
gact)
_tc_one_of_list 'reclassify drop continue pass'
_tc_once_attr 'random'
_tc_one_of_list_from $from 'reclassify drop continue pass'
_tc_once_attr_from $from 'random'
return 0
;;
esac
Expand Down Expand Up @@ -562,10 +648,7 @@ _tc()
COMPREPLY=( $( compgen -W 'dev' -- "$cur" ) )
return 0
fi
local qdisc qdwd QDISC_KIND=' choke codel bfifo pfifo \
pfifo_head_drop fq fq_codel gred hhf mqprio multiq \
netem pfifo_fast pie red rr sfb sfq tbf atm cbq drr \
dsmark hfsc htb prio qfq '
local qdisc qdwd
for ((qdwd=$subcword; qdwd < ${#words[@]}-1; qdwd++)); do
if [[ $QDISC_KIND =~ ' '${words[qdwd]}' ' ]]; then
qdisc=${words[qdwd]}
Expand Down Expand Up @@ -600,10 +683,7 @@ _tc()
COMPREPLY=( $( compgen -W 'dev' -- "$cur" ) )
return 0
fi
local qdisc qdwd QDISC_KIND=' choke codel bfifo pfifo \
pfifo_head_drop fq fq_codel gred hhf mqprio multiq \
netem pfifo_fast pie red rr sfb sfq tbf atm cbq drr \
dsmark hfsc htb prio qfq '
local qdisc qdwd
for ((qdwd=$subcword; qdwd < ${#words[@]}-1; qdwd++)); do
if [[ $QDISC_KIND =~ ' '${words[qdwd]}' ' ]]; then
qdisc=${words[qdwd]}
Expand Down Expand Up @@ -638,13 +718,11 @@ _tc()
COMPREPLY=( $( compgen -W 'dev' -- "$cur" ) )
return 0
fi
local filter fltwd FILTER_KIND=' basic bpf cgroup flow \
flower fw route rsvp tcindex u32 '
local filter fltwd
for ((fltwd=$subcword; fltwd < ${#words[@]}-1; fltwd++));
do
if [[ $FILTER_KIND =~ ' '${words[fltwd]}' ' ]]; then
filter=${words[fltwd]}
_tc_filter_options $filter && return 0
_tc_filter_options $fltwd && return 0
fi
done
_tc_one_of_list $FILTER_KIND
Expand All @@ -671,11 +749,10 @@ _tc()
action)
case $subcmd in
add|change|replace)
local action acwd ACTION_KIND=' gact mirred bpf '
local action acwd
for ((acwd=$subcword; acwd < ${#words[@]}-1; acwd++)); do
if [[ $ACTION_KIND =~ ' '${words[acwd]}' ' ]]; then
action=${words[acwd]}
_tc_action_options $action && return 0
_tc_action_options $acwd && return 0
fi
done
_tc_one_of_list $ACTION_KIND
Expand Down
9 changes: 2 additions & 7 deletions bridge/Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
BROBJ = bridge.o fdb.o monitor.o link.o mdb.o vlan.o

include ../Config

ifeq ($(IP_CONFIG_SETNS),y)
CFLAGS += -DHAVE_SETNS
endif
include ../config.mk

all: bridge

bridge: $(BROBJ) $(LIBNETLINK)
bridge: $(BROBJ) $(LIBNETLINK)
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@

install: all
install -m 0755 bridge $(DESTDIR)$(SBINDIR)

clean:
rm -f $(BROBJ) bridge

1 change: 1 addition & 0 deletions bridge/br_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define MDB_RTR_RTA(r) \
((struct rtattr *)(((char *)(r)) + RTA_ALIGN(sizeof(__u32))))

extern void print_vlan_info(FILE *fp, struct rtattr *tb, int ifindex);
extern int print_linkinfo(const struct sockaddr_nl *who,
struct nlmsghdr *n,
void *arg);
Expand Down
1 change: 0 additions & 1 deletion bridge/bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

struct rtnl_handle rth = { .fd = -1 };
int preferred_family = AF_UNSPEC;
int resolve_hosts;
int oneline;
int show_stats;
int show_details;
Expand Down
Loading

0 comments on commit 8d27554

Please sign in to comment.