Merge branch 'iproute2-master' into iproute2-next
Signed-off-by: David Ahern <dsahern@gmail.com>
This commit is contained in:
commit
7b2e200679
16
Makefile
16
Makefile
|
|
@ -71,6 +71,19 @@ all: config.mk
|
|||
for i in $(SUBDIRS); \
|
||||
do echo; echo $$i; $(MAKE) $(MFLAGS) -C $$i; done
|
||||
|
||||
help:
|
||||
@echo "Make Targets:"
|
||||
@echo " all - build binaries"
|
||||
@echo " clean - remove products of build"
|
||||
@echo " distclean - remove configuration and build"
|
||||
@echo " install - install binaries on local machine"
|
||||
@echo " check - run tests"
|
||||
@echo " cscope - build cscope database"
|
||||
@echo " snapshot - generate version number header"
|
||||
@echo ""
|
||||
@echo "Make Arguments:"
|
||||
@echo " V=[0|1] - set build verbosity level"
|
||||
|
||||
config.mk:
|
||||
sh configure $(KERNEL_INCLUDE)
|
||||
|
||||
|
|
@ -106,6 +119,9 @@ clobber:
|
|||
|
||||
distclean: clobber
|
||||
|
||||
check:
|
||||
cd testsuite && $(MAKE) && $(MAKE) alltests
|
||||
|
||||
cscope:
|
||||
cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc
|
||||
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
|
|||
__u64 attrs = 0;
|
||||
bool set_op = (n->nlmsg_type == RTM_NEWLINK &&
|
||||
!(n->nlmsg_flags & NLM_F_CREATE));
|
||||
bool selected_family = false;
|
||||
|
||||
saddr.family = daddr.family = AF_UNSPEC;
|
||||
|
||||
|
|
@ -356,12 +357,26 @@ static int vxlan_parse_opt(struct link_util *lu, int argc, char **argv,
|
|||
int type = (saddr.family == AF_INET) ? IFLA_VXLAN_LOCAL
|
||||
: IFLA_VXLAN_LOCAL6;
|
||||
addattr_l(n, 1024, type, saddr.data, saddr.bytelen);
|
||||
selected_family = true;
|
||||
}
|
||||
|
||||
if (is_addrtype_inet(&daddr)) {
|
||||
int type = (daddr.family == AF_INET) ? IFLA_VXLAN_GROUP
|
||||
: IFLA_VXLAN_GROUP6;
|
||||
addattr_l(n, 1024, type, daddr.data, daddr.bytelen);
|
||||
selected_family = true;
|
||||
}
|
||||
|
||||
if (!selected_family) {
|
||||
if (preferred_family == AF_INET) {
|
||||
get_addr(&daddr, "default", AF_INET);
|
||||
addattr_l(n, 1024, IFLA_VXLAN_GROUP,
|
||||
daddr.data, daddr.bytelen);
|
||||
} else if (preferred_family == AF_INET6) {
|
||||
get_addr(&daddr, "default", AF_INET6);
|
||||
addattr_l(n, 1024, IFLA_VXLAN_GROUP6,
|
||||
daddr.data, daddr.bytelen);
|
||||
}
|
||||
}
|
||||
|
||||
if (!set_op || VXLAN_ATTRSET(attrs, IFLA_VXLAN_LEARNING))
|
||||
|
|
|
|||
|
|
@ -395,9 +395,9 @@ get_failed:
|
|||
addattr32(n, 1024, IFLA_GRE_OKEY, okey);
|
||||
addattr_l(n, 1024, IFLA_GRE_IFLAGS, &iflags, 2);
|
||||
addattr_l(n, 1024, IFLA_GRE_OFLAGS, &oflags, 2);
|
||||
if (is_addrtype_inet(&saddr))
|
||||
if (is_addrtype_inet_not_unspec(&saddr))
|
||||
addattr_l(n, 1024, IFLA_GRE_LOCAL, saddr.data, saddr.bytelen);
|
||||
if (is_addrtype_inet(&daddr))
|
||||
if (is_addrtype_inet_not_unspec(&daddr))
|
||||
addattr_l(n, 1024, IFLA_GRE_REMOTE, daddr.data, daddr.bytelen);
|
||||
addattr_l(n, 1024, IFLA_GRE_PMTUDISC, &pmtudisc, 1);
|
||||
if (ignore_df)
|
||||
|
|
|
|||
|
|
@ -424,9 +424,9 @@ get_failed:
|
|||
addattr32(n, 1024, IFLA_GRE_OKEY, okey);
|
||||
addattr_l(n, 1024, IFLA_GRE_IFLAGS, &iflags, 2);
|
||||
addattr_l(n, 1024, IFLA_GRE_OFLAGS, &oflags, 2);
|
||||
if (is_addrtype_inet(&saddr))
|
||||
if (is_addrtype_inet_not_unspec(&saddr))
|
||||
addattr_l(n, 1024, IFLA_GRE_LOCAL, saddr.data, saddr.bytelen);
|
||||
if (is_addrtype_inet(&daddr))
|
||||
if (is_addrtype_inet_not_unspec(&daddr))
|
||||
addattr_l(n, 1024, IFLA_GRE_REMOTE, daddr.data, daddr.bytelen);
|
||||
if (link)
|
||||
addattr32(n, 1024, IFLA_GRE_LINK, link);
|
||||
|
|
|
|||
|
|
@ -320,11 +320,11 @@ get_failed:
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (is_addrtype_inet(&saddr)) {
|
||||
if (is_addrtype_inet_not_unspec(&saddr)) {
|
||||
addattr_l(n, 1024, IFLA_IPTUN_LOCAL,
|
||||
saddr.data, saddr.bytelen);
|
||||
}
|
||||
if (is_addrtype_inet(&daddr)) {
|
||||
if (is_addrtype_inet_not_unspec(&daddr)) {
|
||||
addattr_l(n, 1024, IFLA_IPTUN_REMOTE,
|
||||
daddr.data, daddr.bytelen);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,11 +325,11 @@ get_failed:
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (is_addrtype_inet(&saddr)) {
|
||||
if (is_addrtype_inet_not_unspec(&saddr)) {
|
||||
addattr_l(n, 1024, IFLA_IPTUN_LOCAL,
|
||||
saddr.data, saddr.bytelen);
|
||||
}
|
||||
if (is_addrtype_inet(&daddr)) {
|
||||
if (is_addrtype_inet_not_unspec(&daddr)) {
|
||||
addattr_l(n, 1024, IFLA_IPTUN_REMOTE,
|
||||
daddr.data, daddr.bytelen);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,9 +157,9 @@ get_failed:
|
|||
|
||||
addattr32(n, 1024, IFLA_VTI_IKEY, ikey);
|
||||
addattr32(n, 1024, IFLA_VTI_OKEY, okey);
|
||||
if (is_addrtype_inet(&saddr))
|
||||
if (is_addrtype_inet_not_unspec(&saddr))
|
||||
addattr_l(n, 1024, IFLA_VTI_LOCAL, saddr.data, saddr.bytelen);
|
||||
if (is_addrtype_inet(&daddr))
|
||||
if (is_addrtype_inet_not_unspec(&daddr))
|
||||
addattr_l(n, 1024, IFLA_VTI_REMOTE, daddr.data, daddr.bytelen);
|
||||
addattr32(n, 1024, IFLA_VTI_FWMARK, fwmark);
|
||||
if (link)
|
||||
|
|
|
|||
|
|
@ -159,9 +159,9 @@ get_failed:
|
|||
|
||||
addattr32(n, 1024, IFLA_VTI_IKEY, ikey);
|
||||
addattr32(n, 1024, IFLA_VTI_OKEY, okey);
|
||||
if (is_addrtype_inet(&saddr))
|
||||
if (is_addrtype_inet_not_unspec(&saddr))
|
||||
addattr_l(n, 1024, IFLA_VTI_LOCAL, saddr.data, saddr.bytelen);
|
||||
if (is_addrtype_inet(&daddr))
|
||||
if (is_addrtype_inet_not_unspec(&daddr))
|
||||
addattr_l(n, 1024, IFLA_VTI_REMOTE, daddr.data, daddr.bytelen);
|
||||
addattr32(n, 1024, IFLA_VTI_FWMARK, fwmark);
|
||||
if (link)
|
||||
|
|
|
|||
|
|
@ -666,17 +666,20 @@ static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov,
|
|||
if (!err->error)
|
||||
/* check messages from kernel */
|
||||
nl_dump_ext_ack(h, errfn);
|
||||
else {
|
||||
errno = -err->error;
|
||||
|
||||
if (rtnl->proto != NETLINK_SOCK_DIAG &&
|
||||
show_rtnl_err)
|
||||
rtnl_talk_error(h, err, errfn);
|
||||
if (rtnl->proto != NETLINK_SOCK_DIAG &&
|
||||
show_rtnl_err)
|
||||
rtnl_talk_error(h, err, errfn);
|
||||
}
|
||||
|
||||
errno = -err->error;
|
||||
if (answer)
|
||||
*answer = (struct nlmsghdr *)buf;
|
||||
else
|
||||
free(buf);
|
||||
return -i;
|
||||
|
||||
return err->error ? -i : 0;
|
||||
}
|
||||
|
||||
if (answer) {
|
||||
|
|
|
|||
|
|
@ -28,20 +28,24 @@ endif
|
|||
configure:
|
||||
echo "Entering iproute2" && cd iproute2 && $(MAKE) configure && cd ..;
|
||||
|
||||
compile: configure
|
||||
compile: configure generate_nlmsg
|
||||
echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..;
|
||||
$(MAKE) -C tools
|
||||
|
||||
listtests:
|
||||
@for t in $(TESTS); do \
|
||||
echo "$$t"; \
|
||||
done
|
||||
|
||||
alltests: $(TESTS)
|
||||
generate_nlmsg:
|
||||
$(MAKE) -C tools
|
||||
|
||||
clean:
|
||||
alltests: generate_nlmsg $(TESTS)
|
||||
|
||||
testclean:
|
||||
@echo "Removing $(RESULTS_DIR) dir ..."
|
||||
@rm -rf $(RESULTS_DIR)
|
||||
|
||||
clean: testclean
|
||||
@rm -f iproute2/iproute2-this
|
||||
@rm -f tests/ip/link/dev_wo_vf_rate.nl
|
||||
$(MAKE) -C tools clean
|
||||
|
|
@ -49,18 +53,21 @@ clean:
|
|||
distclean: clean
|
||||
echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
|
||||
|
||||
$(TESTS): clean
|
||||
$(TESTS): testclean
|
||||
ifeq (,$(IPVERS))
|
||||
$(error Please run make first)
|
||||
endif
|
||||
ifeq (,$(HAVE_UNSHARED_UTIL))
|
||||
$(error Please install util-linux tools to run tests in separated network namespace)
|
||||
endif
|
||||
@./tools/generate_nlmsg
|
||||
|
||||
@mkdir -p $(RESULTS_DIR)
|
||||
|
||||
|
||||
@for d in $(TESTS_DIR); do \
|
||||
mkdir -p $(RESULTS_DIR)/$$d; \
|
||||
done
|
||||
|
||||
|
||||
@if [ "$(KCPATH)" = "/proc/config.gz" ]; then \
|
||||
gunzip -c $(KCPATH) >$(KENVFN); \
|
||||
elif [ "$(KCPATH)" != "" ]; then \
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
include ../../config.mk
|
||||
|
||||
generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDLIBS) $(EXTRA_CFLAGS) -I../../include -include../../include/uapi/linux/netlink.h -o $@ $^
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDLIBS) $(EXTRA_CFLAGS) -I../../include -include../../include/uapi/linux/netlink.h -o $@ $^ -lmnl
|
||||
|
||||
clean:
|
||||
rm -f generate_nlmsg
|
||||
|
|
|
|||
Loading…
Reference in New Issue