summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-06-01 07:21:41 -0700
committerBen Pfaff <blp@ovn.org>2017-06-01 07:21:41 -0700
commit0b2c7e690a0ad1efda5487f828690db64133980e (patch)
tree6ab42ce058d52a668e1bd83e52765af06908c039 /Makefile.am
parente2d12c07df97fc19c01f076be0a2bbb388e84c52 (diff)
downloadopenvswitch-0b2c7e690a0ad1efda5487f828690db64133980e.tar.gz
Replace most uses of and references to "ifconfig" by "ip".
It's becoming more common that OSes include "ip" but not "ifconfig", so it's best to avoid using the latter. This commit removes most references to "ifconfig" and replaces them by "ip". It also adds a build-time check to make it harder to introduce new uses of "ifconfig". There are important differences between "ifconfig" and "ip": - An "ifconfig" command that sets an IP address also brings the interface up, but a similar "ip addr add" command does not, so it is often necessary (or at least precautionary) to add an "ip link set <dev> up" command. - "ifconfig" can infer a netmask from an IP adddress, but "ip" always assumes /32 if none is given. - "ifconfig" with address 0.0.0.0 removes any configured IP address, but "ip addr add" does not, so "ifconfig <dev> 0.0.0.0" must be replaced by "ip addr del" or "ip addr flush". Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 4a6b5e574..d810a5e72 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -311,6 +311,20 @@ thread-safety-check:
EXTRA_DIST += build-aux/thread-safety-blacklist
.PHONY: thread-safety-check
+# Check that "ip" is used in preference to "ifconfig", because
+# "ifconfig" is not installed ubiquitously anymore.
+ALL_LOCAL += check-ifconfig
+check-ifconfig:
+ @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
+ (cd $(srcdir) && git --no-pager grep -l -E -e 'ifconfig' | \
+ $(EGREP) -v 'Makefile.am|ovs-vsctl-bashcomp|openvswitch-custom\.te'); \
+ then \
+ echo "See above for list of files that use or reference"; \
+ echo "'ifconfig'. Please use 'ip' instead."; \
+ exit 1; \
+ fi
+.PHONY: check-ifconfig
+
if HAVE_GROFF
ALL_LOCAL += manpage-check
manpage-check: $(man_MANS) $(dist_man_MANS) $(noinst_man_MANS)