debian/0000755000000000000000000000000012241734453007173 5ustar debian/NEWS0000644000000000000000000000141012241734453007666 0ustar batctl (2013.4.0-2) unstable; urgency=low batctl 2013.5.0 will have the vis commands (vis_mode and vis_data) removed. The functionality is not available anymore in the Linux kernel starting with v3.13. Instead the batadv-vis daemon should be used together with the alfred daemon to replace them. They run in userspace, only need access to the batman-adv originators table in debugfs and can already be used. The vis_data command will print a warning on stderr when it is used in batctl 2013.4.0. This is done to inform users early about the upcoming removal. The normal output on stdout is not modified. Consumers may have to be modified to only read from stdout and ignore stderr. -- Sven Eckelmann Sat, 16 Nov 2013 19:01:22 +0100 debian/README.Debian0000644000000000000000000000060012241734453011230 0ustar batctl for Debian ---------------------------- Please see ./README for a description of the batctl software. The Debian batctl source package provides two packages, 1) batctl, which provides the userspace utilities for batman-adv-kernelland 2) batctl-dbg, which provides the debug symbols for batctl -- Simon Wunderlich Mon, 22 Jun 2009 00:44:35 +0200 debian/batctl.examples0000644000000000000000000000002112241734453012175 0ustar bat-hosts.sample debian/batctl.install0000644000000000000000000000004712241734453012035 0ustar usr/sbin/* usr/share/man/man8/batctl.8 debian/changelog0000644000000000000000000004403112241734453011047 0ustar batctl (2013.4.0-2) unstable; urgency=low * Upgraded to policy 3.9.5, no changes required * Add NEWS entry about upcoming vis_data+vis_mode command removal * debian/patches: - Add vis_removal_warning.patch, Warn about upcoming removal of vis functionality -- Sven Eckelmann Sat, 16 Nov 2013 19:27:46 +0100 batctl (2013.4.0-1) unstable; urgency=low * New Upstream Version * Update e-mail address of Simon Wunderlich * debian/copyright: - Update e-mail address of Marek Lindner * debian/patches: - Add email_addresses.patch, Update author addresses - Remove upstream merged nobatman_memleak.patch, bisect_iv_neigh_add.patch, hyphen_man.patch - Add ip_resolver_cleanup.patch, Reduce IPv4 focus of mac resolve functions - Add ip_resolver_rtnl.patch, Replace /proc/net/arp based resolver with rtnl - Add ip_resolver_ipv6.patch, Add support for IPv6 to address resolver - Add ip_resolver_libnl.patch, Use libnl to implement mac resolver * debian/control: - Add libnl-3-dev and pkg-config as Build-Depends for mac resolve functions -- Sven Eckelmann Tue, 15 Oct 2013 20:00:20 +0200 batctl (2013.3.0-2) unstable; urgency=low * debian/patches: - Add strncat_bufferoverflow.patch, Fix possible buffer overflow when using strncat - Add gnu_source.patch, Fix inconsistent use of _GNU_SOURCE - Add const_assignment.patch, Avoid assigning const buffer to non-const pointer - Add static_functions.patch, Mark all local functions as static - Add include_guards.patch, Add include guards to avoid redundant declarations or include loops - Add legacy_types.patch, Remove legacy types u64 and caddr_t - Add includes.patch, Add missing includes and remove unused includes - Add cflags_linker.patch, Add CFLAGS to the linker step - Remove lto.patch, Replaced by cflags_linker.patch - Add nobatman_memleak.patch, Fix error handling jump in interface when batadv is not loaded - Add bisect_iv_neigh_add.patch, Fix type of new neighbor buffer in _seqno_trace_neigh_add - Add make_header_depends.patch, Don't fail rebuild when header is removed - Add hyphen_man.patch, Don't use hyphen for parameter in manpage * debian/rules: - Remove unused make option LTO=1 - Add -flto to DEB_CFLAGS_MAINT_APPEND to replace lto.patch -- Sven Eckelmann Tue, 10 Sep 2013 22:21:47 +0200 batctl (2013.3.0-1) unstable; urgency=low * New Upstream Version -- Sven Eckelmann Wed, 24 Jul 2013 15:20:44 +0200 batctl (2013.2.0-2) unstable; urgency=low * Upload to unstable for Linux 3.10 * debian/rules: - Enable link-time optimization - Enable garbage collection of sections * debian/patches: - Add lto.patch, Enable Link-time optimization for smaller binaries * debian/watch: - Verify new upstream versions using GPG key 96E5AF383F7C593B6B16 -- Sven Eckelmann Tue, 16 Jul 2013 12:13:16 +0200 batctl (2013.2.0-1) experimental; urgency=low * New Upstream Version -- Sven Eckelmann Sun, 21 Apr 2013 10:20:38 +0200 batctl (2013.1.0-2) unstable; urgency=low * Upload to unstable for Linux 3.8 and Linux 3.9 -- Sven Eckelmann Tue, 07 May 2013 07:56:00 +0200 batctl (2013.1.0-1) experimental; urgency=low * New Upstream Version -- Sven Eckelmann Mon, 04 Mar 2013 10:00:49 +0100 batctl (2013.0.0-1) experimental; urgency=low * New Upstream Version * Remove obsolete DM-Upload-Allowed in debian/control * Update copyright years in debian/copyright -- Sven Eckelmann Sun, 13 Jan 2013 01:43:29 +0100 batctl (2012.4.0-1) experimental; urgency=low * New Upstream Version * Upgraded to policy 3.9.4, no changes required -- Sven Eckelmann Mon, 29 Oct 2012 17:21:23 +0100 batctl (2012.3.0-1) experimental; urgency=low * New Upstream Version -- Sven Eckelmann Sun, 19 Aug 2012 22:49:35 +0200 batctl (2012.2.0-1) experimental; urgency=low * New Upstream Version -- Sven Eckelmann Wed, 13 Jun 2012 01:11:15 +0200 batctl (2012.1.0-1) unstable; urgency=low * New Upstream Version * Upgraded to policy 3.9.3, no changes required * Let debhelper set the buildflags implicitly * Update copyright years in debian/copyright -- Sven Eckelmann Fri, 30 Mar 2012 18:55:13 +0200 batctl (2012.0.0-2) unstable; urgency=low * Enable all hardening flags in debian/rules (Closes: #662962) -- Sven Eckelmann Wed, 07 Mar 2012 18:05:08 +0100 batctl (2012.0.0-1) unstable; urgency=low * New Upstream Version * Upgrade debhelper compat to v9 -- Sven Eckelmann Sun, 05 Feb 2012 15:32:42 +0100 batctl (2011.4.0-2) unstable; urgency=low * Upload to unstable for Linux 3.2 * Update copyright years in debian/copyright -- Sven Eckelmann Thu, 19 Jan 2012 10:39:27 +0100 batctl (2011.4.0-1) experimental; urgency=low * New Upstream Version -- Sven Eckelmann Mon, 14 Nov 2011 15:46:16 +0100 batctl (2011.3.0-3) unstable; urgency=low * Upload to unstable for Linux 3.1 * Remove hardening-includes which are now integrated in dpkg- buildflags * Use debian packaging manual URL as format identifier in debian/copyright -- Sven Eckelmann Mon, 24 Oct 2011 21:28:50 +0200 batctl (2011.3.0-2) experimental; urgency=low * Don't mix implicit and explicit rules to prevent FTBFS with make 3.82 -- Sven Eckelmann Sun, 21 Aug 2011 17:40:30 +0200 batctl (2011.3.0-1) experimental; urgency=low * New Upstream Version * Override new PREFIX install variable with /usr in debian/rules * Don't install manpage twice using debian/batctl.manpages -- Sven Eckelmann Sun, 21 Aug 2011 16:37:31 +0200 batctl (2011.2.0-2) unstable; urgency=low * Upload to unstable for Linux 3.0 * Mark all targets in debian/rules as phony -- Sven Eckelmann Sun, 24 Jul 2011 15:01:57 +0200 batctl (2011.2.0-1) experimental; urgency=low * New Upstream Version * Update Vcs-* fields to new anonscm.debian.org URLs in debian/control -- Sven Eckelmann Sun, 19 Jun 2011 21:51:26 +0200 batctl (2011.1.0-2) unstable; urgency=low * Upgraded to policy 3.9.2, no changes required * debian/control: - Remove Recommends of obsolete package batman-adv-dkms - Remove Suggests of obsolete package batman-adv-source -- Sven Eckelmann Fri, 20 May 2011 14:52:07 +0200 batctl (2011.1.0-1) unstable; urgency=low * New Upstream Version * debian/patches: - Remove upstream merged patch decapsulate_monitor.patch -- Sven Eckelmann Sun, 17 Apr 2011 19:48:52 +0200 batctl (2011.0.0-2) unstable; urgency=low * Upload to unstable * debian/patches: - Add decapsulate_monitor.patch, Remove extra headers of frames from monitor devices -- Sven Eckelmann Sun, 06 Feb 2011 11:23:57 +0100 batctl (2011.0.0-1) experimental; urgency=low * New Upstream Version * Keep dependencies on separate lines in debian/control * debian/copyright: - Update to DEP5 revision 164 - Update copyright years -- Sven Eckelmann Sat, 29 Jan 2011 22:58:29 +0100 batctl (2010.2.0+83+g927399e-1) experimental; urgency=low * New Upstream Snapshot from 927399e7d54686679f4205241bdc4107b7559a93 * Updated my maintainer e-mail address -- Sven Eckelmann Sat, 11 Dec 2010 10:57:03 +0100 batctl (2010.2.0+79+g8262d6d-1) experimental; urgency=low * New Upstream Snapshot from 8262d6dbfb548524563efec6d5b155907d5367e4 -- Sven Eckelmann Sun, 21 Nov 2010 22:38:47 +0100 batctl (2010.2.0-1) experimental; urgency=low * New Upstream Version -- Sven Eckelmann Sun, 21 Nov 2010 22:34:56 +0100 batctl (2010.1.0+9+g68875a5-1) experimental; urgency=low * New Upstream Snapshot from 68875a5f3a8d9cf236c450ddd91c8baa56d8e657 * Upgrade debhelper compat to v8 * debian/rules: - set *FLAGS using dpkg-buildflags in debian/rules to work like dpkg-buildpackage when called directly - Use hardening-includes for CFLAGS and LDFLAGS hardened builds - Show build commands when compiling - Save debian version as version string for batctl * Change upstream domain to open-mesh.org -- Sven Eckelmann Thu, 23 Sep 2010 13:04:24 +0200 batctl (2010.1.0+6+g9bab711-1) experimental; urgency=low * New Upstream Snapshot from 9bab711ac9412554196cfa93fcf146272ad0b14a -- Sven Eckelmann Sat, 04 Sep 2010 15:57:32 +0200 batctl (2010.1.0-1) experimental; urgency=low * New Upstream Version -- Sven Eckelmann Sat, 04 Sep 2010 15:53:37 +0200 batctl (2010.1.0~23+g40fe3f1-1) experimental; urgency=low * New Upstream Snapshot from 40fe3f144d263a0b392a7f1fbb3055a8dd233fd2 * Upgraded to policy 3.9.1, no changes required * Change get-orig-source.sh to support versions from next branch * Don't recommend virtual package batman-adv-modules which isn't provided anymore -- Sven Eckelmann Thu, 02 Sep 2010 22:39:45 +0200 batctl (2010.0.0+svn1682-1) experimental; urgency=low * New Upstream Snapshot -- Sven Eckelmann Sat, 19 Jun 2010 00:26:58 +0200 batctl (2010.0.0-2) unstable; urgency=low * Upgraded to policy 3.9.0, no changes required * Only build on linux-any due to linux dependencies of batman-adv -- Sven Eckelmann Tue, 29 Jun 2010 22:22:28 +0200 batctl (2010.0.0-1) unstable; urgency=low * New Upstream Version -- Sven Eckelmann Sat, 19 Jun 2010 00:11:11 +0200 batctl (0.3.0~alpha~svn1680-1) experimental; urgency=low * New Upstream Snapshot * Update debian/copyright -- Sven Eckelmann Wed, 02 Jun 2010 12:07:20 +0200 batctl (0.3.0~alpha~svn1625-1) experimental; urgency=low * New Upstream Snapshot -- Sven Eckelmann Thu, 29 Apr 2010 11:02:26 +0200 batctl (0.3.0~alpha~svn1610-1) experimental; urgency=low * New Upstream Snapshot -- Sven Eckelmann Tue, 23 Mar 2010 00:56:05 +0100 batctl (0.3.0~alpha~svn1575-1) experimental; urgency=low * New Upstream Snapshot -- Sven Eckelmann Mon, 01 Mar 2010 14:05:34 +0100 batctl (0.2.1-1) unstable; urgency=low * New Upstream Version * Updated debian/copyright * debian/rules: - Enable parallel builds using dh's --parallel - Inform about missing installed files using dh's --list-missing -- Sven Eckelmann Tue, 23 Mar 2010 00:35:51 +0100 batctl (0.2-2) unstable; urgency=low * Correct spelling errors found by lintian * debian/copyright: Update copyright years * Upgraded to policy 3.8.4, no changes required * Remove outdated README.source * Don't list removed transitional packages in README.Debian * Call dh_auto_install with needed parameters in debian/rules -- Sven Eckelmann Mon, 01 Mar 2010 13:53:07 +0100 batctl (0.2-1) unstable; urgency=low * New Upstream Version * Convert to 3.0 (quilt) source format * Change current upstream maintainer to Marek Lindner * debian/control: - Remove shlibs:Depends for binary packages without shared libs dependencies - Rewrote descriptions for batctl with new features - Remove cdbs and change debhelper dependency to 7 for for dh support - Remove batman-adv-battool transitional due to conflict with same package in unstable * Rewrote debian/rules with dh -- Sven Eckelmann Sun, 08 Nov 2009 18:15:04 +0100 batctl (0.2~beta~svn1445-1) experimental; urgency=low * New Upstream Snapshot -- Sven Eckelmann Tue, 20 Oct 2009 20:02:00 +0200 batctl (0.2~beta~svn1431-1) experimental; urgency=low * New Upstream Snapshot * Upgraded to policy 3.8.3, no changes required * Add README.source with information about patch management * Remove unused lintian overrides -- Sven Eckelmann Sun, 13 Sep 2009 00:46:50 +0200 batctl (0.2~beta~svn1366-1) experimental; urgency=low * New Upstream Snapshot -- Sven Eckelmann Thu, 06 Aug 2009 19:13:31 +0200 batctl (0.2~beta~svn1318-1) experimental; urgency=low * New Upstream Snapshot (Closes: #534179) * Rename binary package batman-adv-kernelland to batctl * debian/control: - Rename source from battool to new new upstream name batctl - Add new transitional package batman-adv-battool - Depend on cdbs >= 0.4.52 for DEB_DH_GENCONTROL_ARGS_* * Install bat-hosts.sample as example configuration * Override lintian warning latest-debian-changelog-entry-without-new-version due to changed binary and source name, but kept debian/changelog -- Sven Eckelmann Tue, 23 Jun 2009 11:04:24 +0200 battool (1:0.1~beta+svn1236-4) unstable; urgency=low * Recommend either batman-adv-dkms or batman-adv-modules for batman-adv-battool in debian/control -- Sven Eckelmann Tue, 20 Oct 2009 19:56:16 +0200 battool (1:0.1~beta+svn1236-3) unstable; urgency=low * Upgraded to policy 3.8.3, no changes required * Add README.source with information about patch management -- Sven Eckelmann Thu, 15 Oct 2009 18:50:03 +0200 battool (1:0.1~beta+svn1236-2) unstable; urgency=low * Reduce debhelper dependency to 5 * Convert debian/copyright to new dep5 version * Upgraded to policy 3.8.2, no changes required * Add get-orig-source target to retrieve source in debian/rules * Add debian/get-orig-source.sh to get source from svn or via uscan -- Sven Eckelmann Sun, 21 Jun 2009 18:54:11 +0200 battool (1:0.1~beta+svn1236-1) unstable; urgency=low * Update to upstream revision 1236 * Rewrote debian/rules using cdbs * debian/control: - Move Vcs-* to git.debian.org - Add package batman-adv-battool-dbg with debug symbols - Upgraded to policy 3.8.1, no changes required - Allow Debian Maintainers to upload new versions of battool -- Sven Eckelmann Wed, 06 May 2009 13:08:36 +0200 battool (1:0.1~beta+svn1193-1) unstable; urgency=low * Update to upstream revision 1193 * Correct URL in watch file to match newer releases * debian/rules: Use CFLAGS from dpkg-buildpackage * debian/copyright: Update copyright years -- Sven Eckelmann Tue, 20 Jan 2009 00:17:50 +0100 battool (1:0.1~beta+svn1158-2) unstable; urgency=low * Correct description of battool in debian/README.Debian * Recommend batman-adv-modules and suggest batman-adv-source -- Sven Eckelmann Sun, 11 Jan 2009 14:08:08 +0100 battool (1:0.1~beta+svn1158-1) unstable; urgency=low * Split batman-adv source package in batman-adv-kernelland and battool to match with upstream released tar.gz * debian/rules: - Use dh_clean to remove *-stamp files - Use dh_installman to install manpages - Replace dh_clean -k with dh_prep * Change upstream url to http://www.open-mesh.net/ -- Sven Eckelmann Fri, 02 Jan 2009 14:20:44 +0100 batman-adv (0.1-1) unstable; urgency=low * New upstream release * Install upstream changelog for batman-adv-source -- Sven Eckelmann Sun, 28 Dec 2008 12:37:37 +0100 batman-adv (0.1~beta+svn1154-1) unstable; urgency=low * Support changed directory layout in upstream * Correct name of battool package in debian/Readme.DEBIAN * Fix installation of the renamed kernel module * Replace batman-adv@packages.debian.org maintainer with first Uploader in debian/control -- Sven Eckelmann Mon, 17 Nov 2008 11:28:35 +0100 batman-adv (0.1~beta+svn1141-1) unstable; urgency=low * Update to upstream revision 1141 * debian/copyright: - Add Andreas Langer who has also copyright to battool/* - Set copyright of debian/* to Simon Wunderlich and myself -- Sven Eckelmann Sun, 26 Oct 2008 09:42:25 +0100 batman-adv (0.1~beta+svn1105-3) unstable; urgency=low * reuse orig.tar.gz from 0.1~beta+svn1105-1 release -- Sven Eckelmann Sun, 14 Sep 2008 14:24:34 +0200 batman-adv (0.1~beta+svn1105-2) unstable; urgency=low * remove useless dh_install* and dh_shlibdeps -i from rules * move maintainer to uploaders field in control for multiple maintainers * add debian watch file for uscan/dehs -- Sven Eckelmann Sat, 13 Sep 2008 01:19:11 +0200 batman-adv (0.1~beta+svn1105-1) unstable; urgency=low * update to upstream revision 1105 (various fixes) -- Simon Wunderlich Mon, 11 Aug 2008 14:04:34 +0200 batman-adv (0.1~beta+svn1092-1) unstable; urgency=low [ Sven Eckelmann ] * clean up orig (some paths were only included for symlinked files) * remove dpatch prebuild dependency * fix copyright issues * clean up debian/rules, use dh_testroot * fix package descriptions * upstream fixes copyright notes -- Simon Wunderlich Mon, 07 Jul 2008 00:29:07 +0200 batman-adv (0.1~beta+svn1091-1) unstable; urgency=low [ Sven Eckelmann ] * update to latest upstream svn revision (fixes some bugs) * Use batman-adv as short name instead of batman-adv-source * Push module standard version to 3.8.0 * DEB_BUILD_OPTIONS support for noopt * Fix lintian warning latest-debian-changelog-entry-without-new-date * add git vcs to control file * clean up source package [ Simon Wunderlich ] * remove predependency of dialog for battool -- Simon Wunderlich Sat, 05 Jul 2008 18:12:25 +0200 batman-adv (0.1~beta+svn1082-2) unstable; urgency=low * fix Description for batman-adv-battool -- Simon Wunderlich Sun, 22 Jun 2008 20:51:13 +0200 batman-adv (0.1~beta+svn1082-1) unstable; urgency=low * Initial release (Closes: #478729) -- Simon Wunderlich Sun, 27 Apr 2008 21:02:23 +0200 debian/compat0000644000000000000000000000000212241734453010371 0ustar 9 debian/control0000644000000000000000000000345012241734453010600 0ustar Source: batctl Section: net Priority: extra Maintainer: Simon Wunderlich Uploaders: Sven Eckelmann Standards-Version: 3.9.5 Homepage: http://www.open-mesh.org/ Vcs-Git: git://anonscm.debian.org/collab-maint/batctl.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/batctl.git Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1.1), libnl-3-dev, pkg-config, Package: batctl Architecture: linux-any Depends: ${misc:Depends}, ${shlibs:Depends}, Description: B.A.T.M.A.N. advanced control and management tool This package contains batctl, which serves as configuration utility, monitoring and debugging application. It allows one to modify the module parameters, reading the logfiles and tables, decapsulate embedded packets on the fly, traceroute to and ping mac addresses, generate sequence number graphs for the Layer 2 Mesh B.A.T.M.A.N. . B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is a new routing protocol for multi-hop ad-hoc mesh networks. B.A.T.M.A.N.-advanced is the implementation of this protocol on ISO/OSI Layer 2, allowing mesh networks to be used as a virtual switch. With this approach, LANs and WANs can be easily integrated, and more protocols (like DHCP, IPv6) are supported. Package: batctl-dbg Section: debug Architecture: linux-any Depends: ${misc:Depends}, batctl (= ${binary:Version}), Description: B.A.T.M.A.N. advanced control and management tool (debug files) batctl serves as configuration utility, monitoring and debugging application. It allows one to modify the module parameters, reading the logfiles and tables, decapsulate embedded packets on the fly, traceroute to and ping mac addresses, generate sequence number graphs for the Layer 2 Mesh B.A.T.M.A.N. . This package contains the debug files. debian/copyright0000644000000000000000000000310412241734453011124 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: B.A.T.M.A.N. advanced control and management tool Upstream-Contact: Marek Lindner Source: http://www.open-mesh.org/ Files: * Copyright: 2007-2013, Andreas Langer 2006-2013, Marek Lindner 2006-2013, Simon Wunderlich 2009-2013, Andrew Lunn License: GPL-2 Files: debugfs.* Copyright: 2009, Clark Williams 2009, Xiao Guangrong License: GPL-2 Files: debian/* Copyright: 2008-2013, Simon Wunderlich 2008-2013, Sven Eckelmann License: GPL-2 License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/dirs0000644000000000000000000000001112241734453010047 0ustar usr/sbin debian/docs0000644000000000000000000000000712241734453010043 0ustar README debian/gbp.conf0000644000000000000000000000005712241734453010614 0ustar [DEFAULT] pristine-tar = True sign-tags = True debian/get-orig-source.sh0000755000000000000000000000124012241734453012542 0ustar #! /bin/sh set -e if [ -z "$DIR" ]; then DIR=batctl fi if [ -z "$OWNER" ]; then OWNER= fi # try to download source package if [ "$1" != "snapshot" ]; then uscan --verbose --force-download else MODULE=$(echo "${OWNER}/${DIR}" | sed 's/^\/*//') TMP="`mktemp -t -d`" git clone --bare "git://git.open-mesh.org/${MODULE}.git" "${TMP}" REV="$(git --git-dir "${TMP}" describe --long master | sed -e 's/^v*//' -e 's/-/+/g')" LONGREV="$(git --git-dir "${TMP}" rev-parse master)" TARNAME="${DIR}_${REV}.orig.tar" echo "${LONGREV}" git --git-dir "${TMP}" archive --format=tar --prefix="${DIR}-${REV}/" master -o "${TARNAME}" gzip -n -f "${TARNAME}" rm -rf "${TMP}" fi debian/patches/0000755000000000000000000000000012241734453010622 5ustar debian/patches/cflags_linker.patch0000644000000000000000000000162312241734453014450 0ustar Description: Add CFLAGS to the linker step The GCC manual states for different parameters that the options for compilation must also be used when linking. The options for compilation are stored in CFLAGS and added to LINK.o to fix the behavior. . Option which need this are for example -fPIC/-fPIE or -flto. Origin: upstream, http://git.open-mesh.org/batctl.git/commit/b80d07fbf5fb8f0e3d6d5fc1b3ae45bdb72b3b79 Author: Sven Eckelmann --- diff --git a/Makefile b/Makefile index cf810cd176cfac0a97a3cf6728441a792b68bc3e..9e7c5be4cd907f8c0548eb9556574cb2c63374ce 100755 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ RM ?= rm -f INSTALL ?= install MKDIR ?= mkdir -p COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH) +LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH) # standard install paths PREFIX = /usr/local debian/patches/const_assignment.patch0000644000000000000000000000546712241734453015235 0ustar Description: Avoid assigning const buffer to non-const pointer Strings in C are tried to be saved in the .rodata by the compiler/linker. This section is readonly as the name suggests. Pointer to these strings should therefore be const. Author: Sven Eckelmann --- diff --git a/functions.c b/functions.c index 2a2f39291382809e1da517f5661f9acaf4eeef79..bd4da59afed28e0a34e9fbd0b862c59bcd32e747 100644 --- a/functions.c +++ b/functions.c @@ -124,7 +124,8 @@ int file_exists(const char *fpath) return stat(fpath, &st) == 0; } -static void file_open_problem_dbg(char *dir, char *fname, char *full_path) +static void file_open_problem_dbg(const char *dir, const char *fname, + const char *full_path) { const char **ptr; struct stat st; @@ -162,7 +163,7 @@ static void file_open_problem_dbg(char *dir, char *fname, char *full_path) } } -int read_file(char *dir, char *fname, int read_opt, +int read_file(const char *dir, const char *fname, int read_opt, float orig_timeout, float watch_interval, size_t header_lines) { struct ether_addr *mac_addr; @@ -296,7 +297,8 @@ out: return res; } -int write_file(char *dir, char *fname, char *arg1, char *arg2) +int write_file(const char *dir, const char *fname, const char *arg1, + const char *arg2) { int fd = 0, res = EXIT_FAILURE; char full_path[500]; diff --git a/functions.h b/functions.h index d88c494871dc34fb6b27a512657f1da1b37acaa3..f9c8191e6c48b706d12eeee87c01a34dac299daf 100644 --- a/functions.h +++ b/functions.h @@ -34,9 +34,10 @@ char *ether_ntoa_long(const struct ether_addr *addr); char *get_name_by_macaddr(struct ether_addr *mac_addr, int read_opt); char *get_name_by_macstr(char *mac_str, int read_opt); int file_exists(const char *fpath); -int read_file(char *dir, char *path, int read_opt, +int read_file(const char *dir, const char *path, int read_opt, float orig_timeout, float watch_interval, size_t header_lines); -int write_file(char *dir, char *fname, char *arg1, char *arg2); +int write_file(const char *dir, const char *fname, const char *arg1, + const char *arg2); struct ether_addr *translate_mac(char *mesh_iface, struct ether_addr *mac); struct ether_addr *resolve_mac(const char *asc); diff --git a/tcpdump.c b/tcpdump.c index f5bb5741d8d50cd70e535c3275c25ef5ef9bf11d..5f35e15b3c9ea95cbeebd4af062c624bca175ef0 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -331,7 +331,8 @@ static void dump_vlan(unsigned char *packet_buff, ssize_t buff_len, int read_opt static void dump_batman_tt(unsigned char *packet_buff, ssize_t buff_len, int read_opt, int time_printed) { struct batadv_tt_query_packet *tt_query_packet; - char *tt_desc, *tt_data, tt_type; + const char *tt_desc, *tt_data; + char tt_type; LEN_CHECK((size_t)buff_len - sizeof(struct ether_header), sizeof(struct batadv_tt_query_packet), "BAT TT"); debian/patches/email_addresses.patch0000644000000000000000000002701412241734453014773 0ustar Description: Update author addresses Author: Sven Eckelmann --- diff --git a/allocate.h b/allocate.h index 0f335e2c048318cdfd3616dc2e5615cd5b17c604..29bdda1610b621fd99741e3e7413c8dd584f348f 100644 --- a/allocate.h +++ b/allocate.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/bat-hosts.c b/bat-hosts.c index 9d365314c81c3b6af6f0f32b5adb27695b7a1a93..e03353d572499474fd041d3206bfa0790b2ceae5 100644 --- a/bat-hosts.c +++ b/bat-hosts.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/bat-hosts.h b/bat-hosts.h index 96abfa9744a18c518d4b1fcb848840071b1ec692..88f93f954678516c1d2645c7f6baa609ba9ddeef 100644 --- a/bat-hosts.h +++ b/bat-hosts.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/bisect_iv.c b/bisect_iv.c index 917ffec3317562a2aaf113e2ee55afac46044bdf..8e9f01f7c2aff2ef3cf5d6262d6c74640456033f 100644 --- a/bisect_iv.c +++ b/bisect_iv.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/bisect_iv.h b/bisect_iv.h index c4e6df2fb84a28282a0b8f04e1efc99efab92b53..5c306ed62d372349df03c6d8a39cc34e2ad4850d 100644 --- a/bisect_iv.h +++ b/bisect_iv.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/debug.c b/debug.c index 76521662c052c1b019cfd983c6e2c6668572a35d..eab53de4df0ea48e26e69fb4d509be48fa89bd9f 100644 --- a/debug.c +++ b/debug.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/debug.h b/debug.h index 97157a0912676304e8bb41811b21de36aeec63a2..b1bd35d8840a6f56c3370497b12dfd3f22070497 100644 --- a/debug.h +++ b/debug.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/functions.c b/functions.c index 1a33d6df7d7f1568ff1b949f84c8f87a9e93d84a..14acbdbd364340493fce517f1873071c89001efe 100644 --- a/functions.c +++ b/functions.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/functions.h b/functions.h index a96b7ee880e07fcc90c8e1f95efe2ed322ca34ae..5409b38673b9496008ab14ab6d364cce7530cff9 100644 --- a/functions.h +++ b/functions.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/ioctl.c b/ioctl.c index cbb1aa5d0cf4770884cbdd43a1b6fc775e2d2743..0798060fd865b85ae6f8731cb3cb6de459336fe0 100644 --- a/ioctl.c +++ b/ioctl.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2012-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/ioctl.h b/ioctl.h index 5d62f72eb3b4dd4e7c4fd5743320e0a1552d636d..2d4801f33b64924711768a44357af79411deae65 100644 --- a/ioctl.h +++ b/ioctl.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2012-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/main.c b/main.c index e14d6bc8ef9df427c6097cd0bb40c38bdebe87d4..f6a30243b47455f5115f18baa01b968673c8513d 100644 --- a/main.c +++ b/main.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/main.h b/main.h index 8bd529cb922e918947c174f817fa73624d3ff6f3..af12f932131926c88ce32323386861aa803f6888 100644 --- a/main.h +++ b/main.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/man/batctl.8 b/man/batctl.8 index caec3ad2011aef03720f72e15b9a96b9ed9a0aac..2271b1c99bcb1e347036623ff21884c56e856176 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -306,7 +306,7 @@ addresses. .BR dmesg (1), .BR dot (1) .SH AUTHOR -batctl was written by Andreas Langer and Marek Lindner . +batctl was written by Andreas Langer and Marek Lindner . .PP -This manual page was written by Simon Wunderlich , Marek Lindner and +This manual page was written by Simon Wunderlich , Marek Lindner and Andrew Lunn diff --git a/ping.c b/ping.c index f5a1f422a961ccdd45612b0ca9fcf14806ab7686..7df694d886bb99f8dc261d3af9273984d36d2ba4 100644 --- a/ping.c +++ b/ping.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/ping.h b/ping.h index 7c91d5d40b8055cc7b7709965329d2155290d9a2..ce4553ac245d9d3b63ac743eff00b0c39908d774 100644 --- a/ping.h +++ b/ping.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/sys.c b/sys.c index 9c0ed50aa1e018368a935faa21fa18ffe0fa4847..2829e0012eadf43ec755e8d1b36be087478a8b20 100644 --- a/sys.c +++ b/sys.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/sys.h b/sys.h index 7a455d448e03d278a14e08c660024916c216099d..1b7ac2ec8e8b4d444d156209aa441fc3f6f72b42 100644 --- a/sys.h +++ b/sys.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/tcpdump.h b/tcpdump.h index dd377d309cc2217f46ef8333bc6f4f9337df947e..7ba61aa91e3c560a0c6a15288c2235ffca7fcd90 100644 --- a/tcpdump.h +++ b/tcpdump.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/traceroute.c b/traceroute.c index 05ca34ff0b8148c78d9e2896ec9ac62ef6f8309d..b7ae545b5d69195a9476649a4cae2db6179c62d8 100644 --- a/traceroute.c +++ b/traceroute.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/traceroute.h b/traceroute.h index 5ec13088e69e005eed04892daf5a8780c5784230..fc7d3191d2a23e133a814b01fcc9cd800d2a0dff 100644 --- a/traceroute.h +++ b/traceroute.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/translate.c b/translate.c index da6d593ed9134c8b5a52376786ab6f5a19ff9039..14fa04c394884fd97e2e0989c7a7fc1a5b790f06 100644 --- a/translate.c +++ b/translate.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2007-2013 B.A.T.M.A.N. contributors: * - * Andreas Langer , Marek Lindner + * Andreas Langer , Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public diff --git a/translate.h b/translate.h index 320ad0e3baa97a7071989aefc18fe332ea61d5cb..691d234345c696911ee5d2e288ecfb54f43cc884 100644 --- a/translate.h +++ b/translate.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2009-2013 B.A.T.M.A.N. contributors: * - * Marek Lindner + * Marek Lindner * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public debian/patches/gnu_source.patch0000644000000000000000000000260012241734453014012 0ustar Description: Fix inconsistent use of _GNU_SOURCE Either all or no source file should define _GNU_SOURCE to avoid incompatible types or function declarations. Author: Sven Eckelmann --- diff --git a/Makefile b/Makefile index 311e70e0c02870fa46e68860e4a6e8e562dbd69b..cf810cd176cfac0a97a3cf6728441a792b68bc3e 100755 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ MANPAGE = man/batctl.8 # batctl flags and options CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD +CPPFLAGS += -D_GNU_SOURCE LDLIBS += -lm # disable verbose output diff --git a/bat-hosts.c b/bat-hosts.c index f0adb9c781aa4fcc430a63f0df2e5b85b23714c8..ee862da88611c3755fd1ec67a0c2dfb57e95bbb4 100644 --- a/bat-hosts.c +++ b/bat-hosts.c @@ -21,7 +21,6 @@ -#define _GNU_SOURCE #include #include #include diff --git a/functions.c b/functions.c index 0359287a8efc1574567e1c72262ff5dc06750d9c..2a2f39291382809e1da517f5661f9acaf4eeef79 100644 --- a/functions.c +++ b/functions.c @@ -20,7 +20,6 @@ */ -#define _GNU_SOURCE #include #include #include diff --git a/vis.c b/vis.c index 33c7a7fe3c545ab1698f3ddffdb10cbaa0c00f68..add93fd528aa8bb67e7f7d7a5e3fac5f2eb817ba 100644 --- a/vis.c +++ b/vis.c @@ -19,7 +19,6 @@ * */ -#define _GNU_SOURCE #include #include #include debian/patches/include_guards.patch0000644000000000000000000001213612241734453014636 0ustar Description: Add include guards to avoid redundant declarations or include loops Author: Sven Eckelmann --- diff --git a/allocate.h b/allocate.h index 72a41f7e62eb3b1decbe560b5d464a2d69d5b2ab..0f335e2c048318cdfd3616dc2e5615cd5b17c604 100644 --- a/allocate.h +++ b/allocate.h @@ -20,8 +20,8 @@ */ -#ifndef _ALLOCATE_H -#define _ALLOCATE_H 1 +#ifndef _BATCTL_ALLOCATE_H +#define _BATCTL_ALLOCATE_H /* debug allocate wrapper to keep hash.c happy */ diff --git a/bat-hosts.h b/bat-hosts.h index 0439a46997d0afa1bb52f59c1dfc36e33e54ae8e..74a4ce5b0569db29ad041000b0c294fa4397a8f7 100644 --- a/bat-hosts.h +++ b/bat-hosts.h @@ -21,8 +21,8 @@ -#ifndef _BAT_HOSTS_H -#define _BAT_HOSTS_H 1 +#ifndef _BATCTL_BAT_HOSTS_H +#define _BATCTL_BAT_HOSTS_H #include diff --git a/bisect_iv.h b/bisect_iv.h index b2e14f6131b5292dd17856b3ad957153b9fcb3c8..c4e6df2fb84a28282a0b8f04e1efc99efab92b53 100644 --- a/bisect_iv.h +++ b/bisect_iv.h @@ -19,6 +19,9 @@ * */ +#ifndef _BATCTL_BISECT_IV_H +#define _BATCTL_BISECT_IV_H + #include "list-batman.h" #define NAME_LEN 18 @@ -95,3 +98,5 @@ struct seqno_trace { char print; struct seqno_trace_neigh seqno_trace_neigh; }; + +#endif diff --git a/debug.h b/debug.h index 2427eceaf657ce6c57038b08ecd014f98ce730aa..7b9cfc56dbe44b2440076b21e9ed1709e33ad53d 100644 --- a/debug.h +++ b/debug.h @@ -19,6 +19,8 @@ * */ +#ifndef _BATCTL_DEBUG_H +#define _BATCTL_DEBUG_H #define DEBUG_BATIF_PATH_FMT "%s/batman_adv/%s" #define DEBUG_VIS_DATA "vis_data" @@ -48,3 +50,5 @@ extern const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM]; int handle_debug_table(char *mesh_iface, int debug_table, int argc, char **argv); int log_print(char *mesh_iface, int argc, char **argv); + +#endif diff --git a/functions.h b/functions.h index f9c8191e6c48b706d12eeee87c01a34dac299daf..6720a1b6ac12d83f055d3833c545e2cc84d7df18 100644 --- a/functions.h +++ b/functions.h @@ -19,7 +19,8 @@ * */ - +#ifndef _BATCTL_FUNCTIONS_H +#define _BATCTL_FUNCTIONS_H #include @@ -55,3 +56,5 @@ enum { COMPAT_FILTER = 0x80, SKIP_HEADER = 0x100, }; + +#endif diff --git a/ioctl.h b/ioctl.h index 3bc20d7a40e11ae1e0290041c9bbb6b49208996a..5d62f72eb3b4dd4e7c4fd5743320e0a1552d636d 100644 --- a/ioctl.h +++ b/ioctl.h @@ -19,5 +19,9 @@ * */ +#ifndef _BATCTL_IOCTL_H +#define _BATCTL_IOCTL_H int ioctl_statistics_get(char *mesh_iface); + +#endif diff --git a/main.h b/main.h index b8fd0c4f3116b7006454022e66c9101f954c8835..8bd529cb922e918947c174f817fa73624d3ff6f3 100644 --- a/main.h +++ b/main.h @@ -19,6 +19,9 @@ * */ +#ifndef _BATCTL_MAIN_H +#define _BATCTL_MAIN_H + #ifndef SOURCE_VERSION #define SOURCE_VERSION "2013.4.0" #endif @@ -37,3 +40,5 @@ #define BIT(nr) (1UL << (nr)) /* linux kernel compat */ extern char module_ver_path[]; + +#endif diff --git a/ping.h b/ping.h index abe7da4116684df7a690df691cafdbfacdd597b4..7c91d5d40b8055cc7b7709965329d2155290d9a2 100644 --- a/ping.h +++ b/ping.h @@ -19,6 +19,9 @@ * */ - +#ifndef _BATCTL_PING_H +#define _BATCTL_PING_H int ping(char *mesh_iface, int argc, char **argv); + +#endif diff --git a/sys.h b/sys.h index a7187af4f4079995c600615dc287bef52d5e25a2..9ca1bec7c981810ecab90d7fed5b91c540c0a51f 100644 --- a/sys.h +++ b/sys.h @@ -19,6 +19,8 @@ * */ +#ifndef _BATCTL_SYS_H +#define _BATCTL_SYS_H #define SYS_BATIF_PATH_FMT "/sys/class/net/%s/mesh/" #define SYS_LOG_LEVEL "log_level" @@ -65,3 +67,5 @@ int interface(char *mesh_iface, int argc, char **argv); int handle_loglevel(char *mesh_iface, int argc, char **argv); int handle_sys_setting(char *mesh_iface, int setting, int argc, char **argv); int handle_gw_setting(char *mesh_iface, int argc, char **argv); + +#endif diff --git a/tcpdump.h b/tcpdump.h index 719f9982d71e6a38f208f3950365a75ba425a5ea..33d84e27bfc3f1ca7c971b0437d8252e9f4c81b9 100644 --- a/tcpdump.h +++ b/tcpdump.h @@ -19,6 +19,8 @@ * */ +#ifndef _BATCTL_TCPDUMP_H +#define _BATCTL_TCPDUMP_H #include #include @@ -107,3 +109,5 @@ struct prism_header { #define RADIOTAP_HEADER_LEN sizeof(struct radiotap_header) int tcpdump(int argc, char **argv); + +#endif diff --git a/traceroute.h b/traceroute.h index 8aae4684f4fc5ca872c2363fa543da26f1582712..5ec13088e69e005eed04892daf5a8780c5784230 100644 --- a/traceroute.h +++ b/traceroute.h @@ -19,6 +19,9 @@ * */ - +#ifndef _BATCTL_TRACEROUTE_H +#define _BATCTL_TRACEROUTE_H int traceroute(char *mesh_iface, int argc, char **argv); + +#endif diff --git a/translate.h b/translate.h index 1220a2043ddad572aca2127d3d0c49bfce8fb407..320ad0e3baa97a7071989aefc18fe332ea61d5cb 100644 --- a/translate.h +++ b/translate.h @@ -19,6 +19,9 @@ * */ - +#ifndef _BATCTL_TRANSLATE_H +#define _BATCTL_TRANSLATE_H int translate(char *mesh_iface, int argc, char **argv); + +#endif diff --git a/vis.h b/vis.h index 3a68363bb88aad051c65c8ecfd8c6a592996194c..7b89822048582ad9a4322c9e371745b3595804ff 100644 --- a/vis.h +++ b/vis.h @@ -19,5 +19,9 @@ * */ +#ifndef _BATCTL_VIS_H +#define _BATCTL_VIS_H + int vis_data(char *mesh_iface, int argc, char * argv[]); +#endif debian/patches/includes.patch0000644000000000000000000001776212241734453013466 0ustar Description: Add missing includes and remove unused includes Author: Sven Eckelmann --- diff --git a/bat-hosts.c b/bat-hosts.c index ee862da88611c3755fd1ec67a0c2dfb57e95bbb4..9d365314c81c3b6af6f0f32b5adb27695b7a1a93 100644 --- a/bat-hosts.c +++ b/bat-hosts.c @@ -21,14 +21,15 @@ -#include #include +#include #include #include #include #include +#include +#include -#include "main.h" #include "bat-hosts.h" #include "hash.h" #include "functions.h" diff --git a/bat-hosts.h b/bat-hosts.h index 74a4ce5b0569db29ad041000b0c294fa4397a8f7..96abfa9744a18c518d4b1fcb848840071b1ec692 100644 --- a/bat-hosts.h +++ b/bat-hosts.h @@ -24,7 +24,7 @@ #ifndef _BATCTL_BAT_HOSTS_H #define _BATCTL_BAT_HOSTS_H -#include +#include #define HOST_NAME_MAX_LEN 50 #define CONF_DIR_LEN 256 diff --git a/bisect_iv.c b/bisect_iv.c index c0f9420d5d4e9c733ad42485225c96b14ec80c60..917ffec3317562a2aaf113e2ee55afac46044bdf 100644 --- a/bisect_iv.c +++ b/bisect_iv.c @@ -19,14 +19,15 @@ * */ +#include #include #include -#include -#include #include #include +#include +#include +#include -#include "main.h" #include "bisect_iv.h" #include "bat-hosts.h" #include "hash.h" diff --git a/debug.c b/debug.c index 1e6807fc2c7cff749622918e9dedd31accf24707..76521662c052c1b019cfd983c6e2c6668572a35d 100644 --- a/debug.c +++ b/debug.c @@ -23,12 +23,7 @@ #include #include #include -#include -#include -#include -#include -#include "main.h" #include "debug.h" #include "debugfs.h" #include "functions.h" diff --git a/debug.h b/debug.h index 7b9cfc56dbe44b2440076b21e9ed1709e33ad53d..97157a0912676304e8bb41811b21de36aeec63a2 100644 --- a/debug.h +++ b/debug.h @@ -22,6 +22,9 @@ #ifndef _BATCTL_DEBUG_H #define _BATCTL_DEBUG_H +#include +#include "main.h" + #define DEBUG_BATIF_PATH_FMT "%s/batman_adv/%s" #define DEBUG_VIS_DATA "vis_data" #define DEBUG_TRANSTABLE_GLOBAL "transtable_global" diff --git a/debugfs.c b/debugfs.c index bfedcfe62fd4a8e84d7cd8dd26539e822b3f04cc..8033f8b45dd0b6f7070789a62192c3c7e520e1ed 100644 --- a/debugfs.c +++ b/debugfs.c @@ -19,14 +19,12 @@ */ #include "debugfs.h" -#include -#include #include -#include -#include +#include +#include +#include #include -#include -#include +#include #ifndef DEBUGFS_MAGIC #define DEBUGFS_MAGIC 0x64626720 diff --git a/debugfs.h b/debugfs.h index 3981b8be5ff6c1a704f3451222f6f2481a54320a..e608902f5941f79e9d458da88443d7ca41e1c021 100644 --- a/debugfs.h +++ b/debugfs.h @@ -21,9 +21,6 @@ #ifndef __DEBUGFS_H__ #define __DEBUGFS_H__ -#include -#include - #ifndef MAX_PATH # define MAX_PATH 256 #endif diff --git a/functions.c b/functions.c index bd4da59afed28e0a34e9fbd0b862c59bcd32e747..1a33d6df7d7f1568ff1b949f84c8f87a9e93d84a 100644 --- a/functions.c +++ b/functions.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include "main.h" #include "functions.h" diff --git a/functions.h b/functions.h index 6720a1b6ac12d83f055d3833c545e2cc84d7df18..a96b7ee880e07fcc90c8e1f95efe2ed322ca34ae 100644 --- a/functions.h +++ b/functions.h @@ -22,7 +22,8 @@ #ifndef _BATCTL_FUNCTIONS_H #define _BATCTL_FUNCTIONS_H -#include +#include +#include #define ETH_STR_LEN 17 diff --git a/ioctl.c b/ioctl.c index 3d5b50d20ebc1f1e0ecb70ed68fdd4adfbe25be0..cbb1aa5d0cf4770884cbdd43a1b6fc775e2d2743 100644 --- a/ioctl.c +++ b/ioctl.c @@ -26,15 +26,14 @@ #include #include #include +#include #include #include #include #include #include -#include "main.h" #include "ioctl.h" -#include "debugfs.h" /* code borrowed from ethtool */ static int statistics_custom_get(int fd, struct ifreq *ifr) diff --git a/list-batman.h b/list-batman.h index 7de5943af3af442b53cdad04c0fccf29ae6f3041..aea0f954d89d76f2dade7a921ffb840ce9f6da55 100644 --- a/list-batman.h +++ b/list-batman.h @@ -19,9 +19,6 @@ * */ - -#include /* offsetof() */ - #ifndef _LINUX_LIST_H #define _LINUX_LIST_H diff --git a/main.c b/main.c index 222a58f51e51defe0cb0320593b3256958267557..e14d6bc8ef9df427c6097cd0bb40c38bdebe87d4 100644 --- a/main.c +++ b/main.c @@ -21,9 +21,7 @@ -#include #include -#include #include #include #include @@ -39,7 +37,6 @@ #include "vis.h" #include "ioctl.h" #include "functions.h" -#include char mesh_dfl_iface[] = "bat0"; char module_ver_path[] = "/sys/module/batman_adv/version"; diff --git a/ping.c b/ping.c index 162458c5ec5ef7bf8938b304324e9e003050286b..f5a1f422a961ccdd45612b0ca9fcf14806ab7686 100644 --- a/ping.c +++ b/ping.c @@ -30,6 +30,11 @@ #include #include #include +#include +#include +#include +#include +#include #include "main.h" #include "ping.h" diff --git a/sys.c b/sys.c index 7c694a2b2c21484572485efef11b1133368dd25b..9c0ed50aa1e018368a935faa21fa18ffe0fa4847 100644 --- a/sys.c +++ b/sys.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include "main.h" diff --git a/sys.h b/sys.h index 9ca1bec7c981810ecab90d7fed5b91c540c0a51f..7a455d448e03d278a14e08c660024916c216099d 100644 --- a/sys.h +++ b/sys.h @@ -22,6 +22,8 @@ #ifndef _BATCTL_SYS_H #define _BATCTL_SYS_H +#include "main.h" + #define SYS_BATIF_PATH_FMT "/sys/class/net/%s/mesh/" #define SYS_LOG_LEVEL "log_level" #define SYS_LOG "log" diff --git a/tcpdump.c b/tcpdump.c index 5f35e15b3c9ea95cbeebd4af062c624bca175ef0..88c03017c25e163b48b1fb02b3aac45166308965 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -36,8 +36,12 @@ #include #include #include +#include +#include +#include +#include +#include -#include "main.h" #include "tcpdump.h" #include "packet.h" #include "bat-hosts.h" diff --git a/tcpdump.h b/tcpdump.h index 33d84e27bfc3f1ca7c971b0437d8252e9f4c81b9..dd377d309cc2217f46ef8333bc6f4f9337df947e 100644 --- a/tcpdump.h +++ b/tcpdump.h @@ -23,7 +23,10 @@ #define _BATCTL_TCPDUMP_H #include -#include +#include +#include +#include +#include "main.h" #include "list-batman.h" #ifndef ARPHRD_IEEE80211_PRISM diff --git a/traceroute.c b/traceroute.c index 9820a20de16d8df6226a191c1ba2331d5044a243..05ca34ff0b8148c78d9e2896ec9ac62ef6f8309d 100644 --- a/traceroute.c +++ b/traceroute.c @@ -28,6 +28,10 @@ #include #include #include +#include +#include +#include +#include #include "main.h" #include "traceroute.h" diff --git a/translate.c b/translate.c index 0b4fbc6fc9fa09af17e99af954a9342c49771529..da6d593ed9134c8b5a52376786ab6f5a19ff9039 100644 --- a/translate.c +++ b/translate.c @@ -19,7 +19,6 @@ * */ -#include #include #include diff --git a/vis.c b/vis.c index add93fd528aa8bb67e7f7d7a5e3fac5f2eb817ba..7c62965b9d72030e7e1b47552774d74103056d2a 100644 --- a/vis.c +++ b/vis.c @@ -21,12 +21,11 @@ #include #include -#include #include #include #include +#include -#include "main.h" #include "vis.h" #include "functions.h" #include "bat-hosts.h" debian/patches/ip_resolver_cleanup.patch0000644000000000000000000001122612241734453015705 0ustar Description: Reduce IPv4 focus of mac resolve functions The first implementation of the IP translation functions in "batctl: Allow to use IPv4 addresses for ping/traceroute" had its focus on implementing it only for IPv4. This is a limitation when other layer 3 protocols are used. . For example, a port to IPv6 would either have to copy the functionality or do a major refactoring when implementing the IPv6 resolve functionality. This is not necessary when the functions already expect different layer 3 protocols in the first place and make it easy to find the right place to modify them. Author: Sven Eckelmann --- diff --git a/functions.c b/functions.c index 14acbdbd364340493fce517f1873071c89001efe..f2adfc9325bd4a242e6b99bd99ced219220ffd62 100644 --- a/functions.c +++ b/functions.c @@ -416,49 +416,68 @@ out: return mac_result; } -static uint32_t resolve_ipv4(const char *asc) +static int resolve_l3addr(int ai_family, const char *asc, void *l3addr) { int ret; struct addrinfo hints; struct addrinfo *res; struct sockaddr_in *inet4; - uint32_t addr = 0; memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_INET; + hints.ai_family = ai_family; ret = getaddrinfo(asc, NULL, &hints, &res); if (ret) - return 0; + return -EADDRNOTAVAIL; if (res) { - inet4 = (struct sockaddr_in *)res->ai_addr; - addr = inet4->sin_addr.s_addr; + switch (ai_family) { + case AF_INET: + inet4 = (struct sockaddr_in *)res->ai_addr; + memcpy(l3addr, &inet4->sin_addr.s_addr, + sizeof(inet4->sin_addr.s_addr)); + break; + default: + ret = -EINVAL; + } } freeaddrinfo(res); - return addr; + return ret; } -static void request_arp(uint32_t ipv4_addr) +static void request_mac_resolve(int ai_family, const void *l3addr) { + const struct sockaddr *sockaddr; struct sockaddr_in inet4; + size_t sockaddr_len; int sock; char t = 0; - memset(&inet4, 0, sizeof(inet4)); - sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + sock = socket(ai_family, SOCK_DGRAM, IPPROTO_UDP); if (sock < 0) return; - inet4.sin_family = AF_INET; - inet4.sin_port = htons(9); - inet4.sin_addr.s_addr = ipv4_addr; - sendto(sock, &t, sizeof(t), 0, (const struct sockaddr *)&inet4, - sizeof(inet4)); + switch (ai_family) { + case AF_INET: + memset(&inet4, 0, sizeof(inet4)); + inet4.sin_family = ai_family; + inet4.sin_port = htons(9); + memcpy(&inet4.sin_addr.s_addr, l3addr, + sizeof(inet4.sin_addr.s_addr)); + sockaddr = (const struct sockaddr *)&inet4; + sockaddr_len = sizeof(inet4); + break; + default: + close(sock); + return; + } + + sendto(sock, &t, sizeof(t), 0, sockaddr, sockaddr_len); close(sock); } -static struct ether_addr *resolve_mac_from_arp(uint32_t ipv4_addr) +static struct ether_addr *resolve_mac_from_cache(int ai_family, + const void *l3addr) { struct ether_addr mac_empty; struct ether_addr *mac_result = NULL, *mac_tmp = NULL; @@ -471,7 +490,12 @@ static struct ether_addr *resolve_mac_from_arp(uint32_t ipv4_addr) size_t column; char *token, *input, *saveptr; int line_invalid; + uint32_t ipv4_addr; + if (ai_family != AF_INET) + return NULL; + + memcpy(&ipv4_addr, l3addr, sizeof(ipv4_addr)); memset(&mac_empty, 0, sizeof(mac_empty)); f = fopen("/proc/net/arp", "r"); @@ -527,20 +551,30 @@ static struct ether_addr *resolve_mac_from_arp(uint32_t ipv4_addr) return mac_result; } -static struct ether_addr *resolve_mac_from_ipv4(const char *asc) +static struct ether_addr *resolve_mac_from_addr(int ai_family, const char *asc) { - uint32_t ipv4_addr; + uint8_t ipv4_addr[4]; + void *l3addr; + int ret; int retries = 5; struct ether_addr *mac_result = NULL; - ipv4_addr = resolve_ipv4(asc); - if (!ipv4_addr) + switch (ai_family) { + case AF_INET: + l3addr = ipv4_addr; + break; + default: + return NULL; + } + + ret = resolve_l3addr(ai_family, asc, l3addr); + if (ret < 0) return NULL; while (retries-- && !mac_result) { - mac_result = resolve_mac_from_arp(ipv4_addr); + mac_result = resolve_mac_from_cache(ai_family, l3addr); if (!mac_result) { - request_arp(ipv4_addr); + request_mac_resolve(ai_family, l3addr); usleep(200000); } } @@ -551,12 +585,18 @@ static struct ether_addr *resolve_mac_from_ipv4(const char *asc) struct ether_addr *resolve_mac(const char *asc) { struct ether_addr *mac_result = NULL; + static const int ai_families[] = {AF_INET}; + size_t i; mac_result = ether_aton(asc); if (mac_result) goto out; - mac_result = resolve_mac_from_ipv4(asc); + for (i = 0; i < sizeof(ai_families) / sizeof(*ai_families); i++) { + mac_result = resolve_mac_from_addr(ai_families[i], asc); + if (mac_result) + goto out; + } out: return mac_result; debian/patches/ip_resolver_ipv6.patch0000644000000000000000000001671412241734453015151 0ustar Description: Add support for IPv6 to address resolver Author: Sven Eckelmann --- diff --git a/README b/README index fd421e1b01680bc5cdd2eb7068bfd0be6eb14a0e..308b85a8206c044669a36d39c58bf4caa730fa8c 100644 --- a/README +++ b/README @@ -78,10 +78,10 @@ $ batctl statistics batctl translate ================ -Translates a destination (hostname, IPv4, MAC, bat_host-name) to the originator -mac address responsible for it. +Translates a destination (hostname, IPv4, IPv6, MAC, bat_host-name) to the +originator mac address responsible for it. -Usage: batctl translate mac|bat-host|host-name|IPv4-address +Usage: batctl translate mac|bat-host|host-name|IP-address Example: @@ -93,13 +93,15 @@ $ batctl translate 192.168.1.2 02:ca:fe:af:fe:05 $ batctl translate fe:fe:00:00:09:01 02:ca:fe:af:fe:05 +$ batctl translate 2001::1 +02:ca:fe:af:fe:05 batctl ping ============ Sends a Layer 2 batman-adv ping to check round trip time and connectivity -Usage: batctl ping [parameters] mac|bat-host|host-name|IPv4-address +Usage: batctl ping [parameters] mac|bat-host|host-name|IP-address parameters: -c ping packet count -h print this help @@ -125,7 +127,7 @@ batctl traceroute Traceroute sends 3 packets to each hop, awaits the answers and prints out the response times. -Usage: batctl traceroute [parameters] mac|bat-host|host-name|IPv4-address +Usage: batctl traceroute [parameters] mac|bat-host|host-name|IP-address Example: diff --git a/functions.c b/functions.c index cc2884643cf31bf6b036c92010b69c5abf93e45e..f2b23f2988ba886496e43785ac2b4d79ce3168e3 100644 --- a/functions.c +++ b/functions.c @@ -427,6 +427,7 @@ static int resolve_l3addr(int ai_family, const char *asc, void *l3addr) struct addrinfo hints; struct addrinfo *res; struct sockaddr_in *inet4; + struct sockaddr_in6 *inet6; memset(&hints, 0, sizeof(hints)); hints.ai_family = ai_family; @@ -441,6 +442,11 @@ static int resolve_l3addr(int ai_family, const char *asc, void *l3addr) memcpy(l3addr, &inet4->sin_addr.s_addr, sizeof(inet4->sin_addr.s_addr)); break; + case AF_INET6: + inet6 = (struct sockaddr_in6 *)res->ai_addr; + memcpy(l3addr, &inet6->sin6_addr.s6_addr, + sizeof(inet6->sin6_addr.s6_addr)); + break; default: ret = -EINVAL; } @@ -454,6 +460,7 @@ static void request_mac_resolve(int ai_family, const void *l3addr) { const struct sockaddr *sockaddr; struct sockaddr_in inet4; + struct sockaddr_in6 inet6; size_t sockaddr_len; int sock; char t = 0; @@ -472,6 +479,15 @@ static void request_mac_resolve(int ai_family, const void *l3addr) sockaddr = (const struct sockaddr *)&inet4; sockaddr_len = sizeof(inet4); break; + case AF_INET6: + memset(&inet6, 0, sizeof(inet6)); + inet6.sin6_family = ai_family; + inet6.sin6_port = htons(9); + memcpy(&inet6.sin6_addr.s6_addr, l3addr, + sizeof(inet6.sin6_addr.s6_addr)); + sockaddr = (const struct sockaddr *)&inet6; + sockaddr_len = sizeof(inet6); + break; default: close(sock); return; @@ -630,6 +646,9 @@ static struct ether_addr *resolve_mac_from_cache(int ai_family, case AF_INET: l3_len = 4; break; + case AF_INET6: + l3_len = 16; + break; default: l3_len = 0; } @@ -681,6 +700,7 @@ err: static struct ether_addr *resolve_mac_from_addr(int ai_family, const char *asc) { uint8_t ipv4_addr[4]; + uint8_t ipv6_addr[16]; void *l3addr; int ret; int retries = 5; @@ -690,6 +710,9 @@ static struct ether_addr *resolve_mac_from_addr(int ai_family, const char *asc) case AF_INET: l3addr = ipv4_addr; break; + case AF_INET6: + l3addr = ipv6_addr; + break; default: return NULL; } @@ -712,7 +735,7 @@ static struct ether_addr *resolve_mac_from_addr(int ai_family, const char *asc) struct ether_addr *resolve_mac(const char *asc) { struct ether_addr *mac_result = NULL; - static const int ai_families[] = {AF_INET}; + static const int ai_families[] = {AF_INET, AF_INET6}; size_t i; mac_result = ether_aton(asc); diff --git a/man/batctl.8 b/man/batctl.8 index 2271b1c99bcb1e347036623ff21884c56e856176..f24d27470ee7fe97c514fb1f17d63ce77980cdb4 100644 --- a/man/batctl.8 +++ b/man/batctl.8 @@ -210,9 +210,9 @@ List of debug tables: .RE .RE .br -.IP "\fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIPv4_address\fP" +.IP "\fBtranslate\fP|\fBt\fP \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP" -Translates a destination (hostname, IPv4, MAC, bat_host-name) to the originator +Translates a destination (hostname, IP, MAC, bat_host-name) to the originator mac address responsible for it. .br .IP "\fBstatistics\fP|\fBs\fP" @@ -230,22 +230,22 @@ tt - translation table counters All counters without a prefix concern payload (pure user data) traffic. .RE .br -.IP "\fBping\fP|\fBp\fP [\fB\-c count\fP][\fB\-i interval\fP][\fB\-t time\fP][\fB\-R\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIPv4_address\fP" +.IP "\fBping\fP|\fBp\fP [\fB\-c count\fP][\fB\-i interval\fP][\fB\-t time\fP][\fB\-R\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP" Layer 2 ping of a MAC address or bat\-host name. batctl will try to find the bat\-host name if the given parameter was -not a MAC address. It can also try to guess the MAC address using an IPv4 address or a hostname when -the IPv4 address was configured on top of the batman-adv interface of the destination device and both source and -destination devices are in the same IPv4 subnet. +not a MAC address. It can also try to guess the MAC address using an IPv4/IPv6 address or a hostname when +the IPv4/IPv6 address was configured on top of the batman-adv interface of the destination device and both source and +destination devices are in the same IP subnet. The "\-c" option tells batctl how man pings should be sent before the program exits. Without the "\-c" option batctl will continue pinging without end. Use CTRL + C to stop it. With "\-i" and "\-t" you can set the default interval between pings and the timeout time for replies, both in seconds. When run with "\-R", the route taken by the ping messages will be recorded. With "\-T" you can disable the automatic translation of a client MAC address to the originator address which is responsible for this client. .br -.IP "\fBtraceroute\fP|\fBtr\fP [\fB\-n\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIPv4_address\fP" +.IP "\fBtraceroute\fP|\fBtr\fP [\fB\-n\fP][\fB\-T\fP] \fBMAC_address\fP|\fBbat\-host_name\fP|\fBhost_name\fP|\fBIP_address\fP" Layer 2 traceroute to a MAC address or bat\-host name. batctl will try to find the bat\-host name if the given parameter -was not a MAC address. It can also try to guess the MAC address using an IPv4 address or a hostname when -the IPv4 address was configured on top of the batman-adv interface of the destination device and both source and -destination devices are in the same IPv4 subnet. +was not a MAC address. It can also try to guess the MAC address using an IPv4/IPv6 address or a hostname when +the IPv4/IPv6 address was configured on top of the batman-adv interface of the destination device and both source and +destination devices are in the same IP subnet. batctl will send 3 packets to each host and display the response time. If "\-n" is given batctl will not replace the MAC addresses with bat\-host names in the output. With "\-T" you can disable the automatic translation of a client MAC address to the originator address which is responsible for this client. debian/patches/ip_resolver_libnl.patch0000644000000000000000000001730712241734453015364 0ustar Description: Use libnl to implement mac resolver It is not necessary to have code duplicated which is already available in libraries like libnl-3.0 or libnl-tiny. Author: Sven Eckelmann --- diff --git a/Makefile b/Makefile index 166dcf8caa402cdd40d76119fd54fd693bbe0f7f..8e8c3e0a8e7efc97dd1d19a387977fc22148f0f1 100755 --- a/Makefile +++ b/Makefile @@ -43,6 +43,24 @@ ifndef V endif endif +ifeq ($(origin PKG_CONFIG), undefined) + PKG_CONFIG = pkg-config + ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),) + $(error $(PKG_CONFIG) not found) + endif +endif + +ifeq ($(origin LIBNL_CFLAGS) $(origin LIBNL_LDLIBS), undefined undefined) + LIBNL_NAME ?= libnl-3.0 + ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBNL_NAME) 2>/dev/null),) + $(error No $(LIBNL_NAME) development libraries found!) + endif + LIBNL_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBNL_NAME)) + LIBNL_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBNL_NAME)) +endif +CFLAGS += $(LIBNL_CFLAGS) +LDLIBS += $(LIBNL_LDLIBS) + # standard build tools ifeq ($(CONFIG_BATCTL_BISECT),y) OBJ += $(OBJ_BISECT) diff --git a/functions.c b/functions.c index f2b23f2988ba886496e43785ac2b4d79ce3168e3..a189d7d8d4f938efc254086ee0a714d578bc52b0 100644 --- a/functions.c +++ b/functions.c @@ -38,8 +38,12 @@ #include #include #include -#include #include +#include +#include +#include +#include +#include #include "main.h" #include "functions.h" @@ -497,152 +501,38 @@ static void request_mac_resolve(int ai_family, const void *l3addr) close(sock); } -static int resolve_mac_from_cache_open(int ai_family) +struct resolve_mac_nl_arg { + int ai_family; + const void *l3addr; + struct ether_addr *mac_result; + int found; +}; + +static struct nla_policy neigh_policy[NDA_MAX+1] = { + [NDA_CACHEINFO] = { .minlen = sizeof(struct nda_cacheinfo) }, + [NDA_PROBES] = { .type = NLA_U32 }, +}; + +static int resolve_mac_from_parse(struct nl_msg *msg, void *arg) { - int socknl; + struct nlattr *tb[NDA_MAX + 1]; + struct ndmsg *nm; int ret; - struct { - struct nlmsghdr hdr; - struct ndmsg msg; - } nlreq; - struct sockaddr_nl addrnl; - static uint32_t nr_call = 0; - uint32_t pid = (++nr_call + getpid()) & 0x3FFFFF; + int l3_len; + struct resolve_mac_nl_arg *nl_arg = arg; + uint8_t *mac; + uint8_t *l3addr; - memset(&addrnl, 0, sizeof(addrnl)); - addrnl.nl_family = AF_NETLINK; - addrnl.nl_pid = pid; - addrnl.nl_groups = 0; - - memset(&nlreq, 0, sizeof(nlreq)); - nlreq.hdr.nlmsg_len = NLMSG_LENGTH(sizeof(nlreq.msg)); - nlreq.hdr.nlmsg_type = RTM_GETNEIGH; - nlreq.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; - nlreq.msg.ndm_family = ai_family; - - socknl = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); - if (socknl < 0) - goto out; - - ret = bind(socknl, (struct sockaddr*)&addrnl, sizeof(addrnl)); - if (ret < 0) - goto outclose; - - ret = send(socknl, &nlreq, nlreq.hdr.nlmsg_len, 0); - if (ret < 0) - goto outclose; -out: - return socknl; -outclose: - close(socknl); - return ret; -} - -static ssize_t resolve_mac_from_cache_dump(int sock, void **buf, size_t *buflen) -{ - struct iovec iov; - struct msghdr msg; - ssize_t ret = -1; - int flags = MSG_PEEK | MSG_TRUNC; - - memset(&msg, 0, sizeof(msg)); - memset(&iov, 0, sizeof(iov)); - - msg.msg_iov = &iov; - msg.msg_iovlen = 1; - msg.msg_controllen = 0; - msg.msg_control = NULL; - msg.msg_flags = 0; - - iov.iov_len = *buflen; - iov.iov_base = *buf; - - ret = recvmsg(sock, &msg, flags); + nm = nlmsg_data(nlmsg_hdr(msg)); + ret = nlmsg_parse(nlmsg_hdr(msg), sizeof(*nm), tb, NDA_MAX, + neigh_policy); if (ret < 0) goto err; - if (msg.msg_flags & MSG_TRUNC) { - if ((size_t)ret <= *buflen) { - ret = -ENOBUFS; - goto err; - } - - while (*buflen <= (size_t)ret) { - if (*buflen == 0) - *buflen = 1; - *buflen *= 2; - } - - *buf = realloc(*buf, *buflen); - if (!*buf) { - ret = -ENOMEM; - *buflen = 0; - goto err; - } - } - flags = 0; - - ret = recvmsg(sock, &msg, flags); - if (ret < 0) + if (nl_arg->ai_family != nm->ndm_family) goto err; - return ret; -err: - free(*buf); - *buf = NULL; - return ret; -} - -static int resolve_mac_from_cache_parse(struct ndmsg *ndmsg, size_t len_payload, - struct ether_addr *mac_addr, - uint8_t *l3addr, - size_t l3_len) -{ - int l3found, llfound; - struct rtattr *rtattr; - struct ether_addr mac_empty; - - l3found = 0; - llfound = 0; - memset(&mac_empty, 0, sizeof(mac_empty)); - - for (rtattr = RTM_RTA(ndmsg); RTA_OK(rtattr, len_payload); - rtattr = RTA_NEXT(rtattr, len_payload)) { - switch (rtattr->rta_type) { - case NDA_DST: - memcpy(l3addr, RTA_DATA(rtattr), l3_len); - l3found = 1; - break; - case NDA_LLADDR: - memcpy(mac_addr, RTA_DATA(rtattr), ETH_ALEN); - if (memcmp(mac_addr, &mac_empty, - sizeof(mac_empty)) == 0) - llfound = 0; - else - llfound = 1; - break; - } - } - - return l3found && llfound; -} - -static struct ether_addr *resolve_mac_from_cache(int ai_family, - const void *l3addr) -{ - uint8_t l3addr_tmp[16]; - static struct ether_addr mac_tmp; - struct ether_addr *mac_result = NULL; - void *buf = NULL; - size_t buflen; - struct nlmsghdr *nh; - ssize_t len; - size_t l3_len, mlen; - int socknl; - int parsed; - int finished = 0; - - switch (ai_family) { + switch (nl_arg->ai_family) { case AF_INET: l3_len = 4; break; @@ -653,47 +543,82 @@ static struct ether_addr *resolve_mac_from_cache(int ai_family, l3_len = 0; } - buflen = 8192; - buf = malloc(buflen); - if (!buf) + if (l3_len == 0) goto err; - socknl = resolve_mac_from_cache_open(ai_family); - if (socknl < 0) + if (!tb[NDA_LLADDR] || !tb[NDA_DST]) goto err; + if (nla_len(tb[NDA_LLADDR]) != ETH_ALEN) + goto err; - while (!finished) { - len = resolve_mac_from_cache_dump(socknl, &buf, &buflen); - if (len < 0) - goto err_sock; - mlen = len; + if (nla_len(tb[NDA_DST]) != l3_len) + goto err; - for (nh = buf; NLMSG_OK(nh, mlen); nh = NLMSG_NEXT(nh, mlen)) { - if (nh->nlmsg_type == NLMSG_DONE) { - finished = 1; - break; - } + mac = nla_data(tb[NDA_LLADDR]); + l3addr = nla_data(tb[NDA_DST]); - parsed = resolve_mac_from_cache_parse(NLMSG_DATA(nh), - RTM_PAYLOAD(nh), - &mac_tmp, - l3addr_tmp, - l3_len); - if (parsed) { - if (memcmp(&l3addr_tmp, l3addr, l3_len) == 0) { - mac_result = &mac_tmp; - finished = 1; - break; - } - } - } + if (memcmp(nl_arg->l3addr, l3addr, l3_len) == 0) { + memcpy(nl_arg->mac_result, mac, ETH_ALEN); + nl_arg->found = 1; } -err_sock: - close(socknl); err: - free(buf); + if (nl_arg->found) + return NL_STOP; + else + return NL_OK; +} + +static struct ether_addr *resolve_mac_from_cache(int ai_family, + const void *l3addr) +{ + struct nl_sock *sock; + struct ether_addr *mac_result = NULL; + static struct ether_addr mac_tmp; + int ret; + struct rtgenmsg gmsg = { + .rtgen_family = ai_family, + }; + struct nl_cb *cb = NULL; + struct resolve_mac_nl_arg arg = { + .ai_family = ai_family, + .l3addr = l3addr, + .mac_result = &mac_tmp, + .found = 0, + }; + + sock = nl_socket_alloc(); + if (!sock) + goto err; + + ret = nl_connect(sock, NETLINK_ROUTE); + if (ret < 0) + goto err; + + ret = nl_send_simple(sock, RTM_GETNEIGH, NLM_F_REQUEST | NLM_F_DUMP, + &gmsg, sizeof(gmsg)); + if (ret < 0) + goto err; + + cb = nl_cb_alloc(NL_CB_DEFAULT); + if (!cb) + goto err; + + nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, resolve_mac_from_parse, &arg); + ret = nl_recvmsgs(sock, cb); + if (ret < 0) + goto err; + + if (arg.found) + mac_result = &mac_tmp; + +err: + if (cb) + nl_cb_put(cb); + if (sock) + nl_socket_free(sock); + return mac_result; } debian/patches/ip_resolver_rtnl.patch0000644000000000000000000001447712241734453015250 0ustar Description: Replace /proc/net/arp based resolver with rtnl The /proc/net/arp based solution to resolve mac addresses from IP adresses is limited to IPv4 addresses. The table for IPv6 addresses to MAC addresses is only available through rtnetlink. rtnetlink also provides the IPv4 neighbor table and should therefore be prefered over the /proc/net/arp solution to build an infrastructure for further work on the resolver. Author: Sven Eckelmann --- diff --git a/functions.c b/functions.c index f2adfc9325bd4a242e6b99bd99ced219220ffd62..cc2884643cf31bf6b036c92010b69c5abf93e45e 100644 --- a/functions.c +++ b/functions.c @@ -21,7 +21,6 @@ #include -#include #include #include #include @@ -35,6 +34,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include "main.h" #include "functions.h" @@ -476,78 +481,200 @@ static void request_mac_resolve(int ai_family, const void *l3addr) close(sock); } -static struct ether_addr *resolve_mac_from_cache(int ai_family, - const void *l3addr) +static int resolve_mac_from_cache_open(int ai_family) { - struct ether_addr mac_empty; - struct ether_addr *mac_result = NULL, *mac_tmp = NULL; - struct sockaddr_in inet4; + int socknl; int ret; - FILE *f; - size_t len = 0; - char *line = NULL; - int skip_line = 1; - size_t column; - char *token, *input, *saveptr; - int line_invalid; - uint32_t ipv4_addr; + struct { + struct nlmsghdr hdr; + struct ndmsg msg; + } nlreq; + struct sockaddr_nl addrnl; + static uint32_t nr_call = 0; + uint32_t pid = (++nr_call + getpid()) & 0x3FFFFF; - if (ai_family != AF_INET) - return NULL; + memset(&addrnl, 0, sizeof(addrnl)); + addrnl.nl_family = AF_NETLINK; + addrnl.nl_pid = pid; + addrnl.nl_groups = 0; - memcpy(&ipv4_addr, l3addr, sizeof(ipv4_addr)); + memset(&nlreq, 0, sizeof(nlreq)); + nlreq.hdr.nlmsg_len = NLMSG_LENGTH(sizeof(nlreq.msg)); + nlreq.hdr.nlmsg_type = RTM_GETNEIGH; + nlreq.hdr.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + nlreq.msg.ndm_family = ai_family; + + socknl = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + if (socknl < 0) + goto out; + + ret = bind(socknl, (struct sockaddr*)&addrnl, sizeof(addrnl)); + if (ret < 0) + goto outclose; + + ret = send(socknl, &nlreq, nlreq.hdr.nlmsg_len, 0); + if (ret < 0) + goto outclose; +out: + return socknl; +outclose: + close(socknl); + return ret; +} + +static ssize_t resolve_mac_from_cache_dump(int sock, void **buf, size_t *buflen) +{ + struct iovec iov; + struct msghdr msg; + ssize_t ret = -1; + int flags = MSG_PEEK | MSG_TRUNC; + + memset(&msg, 0, sizeof(msg)); + memset(&iov, 0, sizeof(iov)); + + msg.msg_iov = &iov; + msg.msg_iovlen = 1; + msg.msg_controllen = 0; + msg.msg_control = NULL; + msg.msg_flags = 0; + + iov.iov_len = *buflen; + iov.iov_base = *buf; + + ret = recvmsg(sock, &msg, flags); + if (ret < 0) + goto err; + + if (msg.msg_flags & MSG_TRUNC) { + if ((size_t)ret <= *buflen) { + ret = -ENOBUFS; + goto err; + } + + while (*buflen <= (size_t)ret) { + if (*buflen == 0) + *buflen = 1; + *buflen *= 2; + } + + *buf = realloc(*buf, *buflen); + if (!*buf) { + ret = -ENOMEM; + *buflen = 0; + goto err; + } + } + flags = 0; + + ret = recvmsg(sock, &msg, flags); + if (ret < 0) + goto err; + + return ret; +err: + free(*buf); + *buf = NULL; + return ret; +} + +static int resolve_mac_from_cache_parse(struct ndmsg *ndmsg, size_t len_payload, + struct ether_addr *mac_addr, + uint8_t *l3addr, + size_t l3_len) +{ + int l3found, llfound; + struct rtattr *rtattr; + struct ether_addr mac_empty; + + l3found = 0; + llfound = 0; memset(&mac_empty, 0, sizeof(mac_empty)); - f = fopen("/proc/net/arp", "r"); - if (!f) - return NULL; - - while (getline(&line, &len, f) != -1) { - if (skip_line) { - skip_line = 0; - continue; - } - - line_invalid = 0; - column = 0; - input = line; - while ((token = strtok_r(input, " \t", &saveptr))) { - input = NULL; - - if (column == 0) { - ret = inet_pton(AF_INET, token, &inet4.sin_addr); - if (ret != 1) { - line_invalid = 1; - break; - } - } - - if (column == 3) { - mac_tmp = ether_aton(token); - if (!mac_tmp || memcmp(mac_tmp, &mac_empty, - sizeof(mac_empty)) == 0) { - line_invalid = 1; - break; - } - } - - column++; - } - - if (column < 4) - line_invalid = 1; - - if (line_invalid) - continue; - - if (ipv4_addr == inet4.sin_addr.s_addr) { - mac_result = mac_tmp; + for (rtattr = RTM_RTA(ndmsg); RTA_OK(rtattr, len_payload); + rtattr = RTA_NEXT(rtattr, len_payload)) { + switch (rtattr->rta_type) { + case NDA_DST: + memcpy(l3addr, RTA_DATA(rtattr), l3_len); + l3found = 1; + break; + case NDA_LLADDR: + memcpy(mac_addr, RTA_DATA(rtattr), ETH_ALEN); + if (memcmp(mac_addr, &mac_empty, + sizeof(mac_empty)) == 0) + llfound = 0; + else + llfound = 1; break; } } - free(line); - fclose(f); + return l3found && llfound; +} + +static struct ether_addr *resolve_mac_from_cache(int ai_family, + const void *l3addr) +{ + uint8_t l3addr_tmp[16]; + static struct ether_addr mac_tmp; + struct ether_addr *mac_result = NULL; + void *buf = NULL; + size_t buflen; + struct nlmsghdr *nh; + ssize_t len; + size_t l3_len, mlen; + int socknl; + int parsed; + int finished = 0; + + switch (ai_family) { + case AF_INET: + l3_len = 4; + break; + default: + l3_len = 0; + } + + buflen = 8192; + buf = malloc(buflen); + if (!buf) + goto err; + + socknl = resolve_mac_from_cache_open(ai_family); + if (socknl < 0) + goto err; + + + while (!finished) { + len = resolve_mac_from_cache_dump(socknl, &buf, &buflen); + if (len < 0) + goto err_sock; + mlen = len; + + for (nh = buf; NLMSG_OK(nh, mlen); nh = NLMSG_NEXT(nh, mlen)) { + if (nh->nlmsg_type == NLMSG_DONE) { + finished = 1; + break; + } + + parsed = resolve_mac_from_cache_parse(NLMSG_DATA(nh), + RTM_PAYLOAD(nh), + &mac_tmp, + l3addr_tmp, + l3_len); + if (parsed) { + if (memcmp(&l3addr_tmp, l3addr, l3_len) == 0) { + mac_result = &mac_tmp; + finished = 1; + break; + } + } + } + } + +err_sock: + close(socknl); +err: + free(buf); return mac_result; } debian/patches/legacy_types.patch0000644000000000000000000000421712241734453014337 0ustar Description: Remove legacy types u64 and caddr_t The definition of u64 was not obtained from the correct source to always use 64 bit. Instead uint64_t can be used. . Also caddr_t is obsolete BSDism and void* should be used instead. Author: Sven Eckelmann --- diff --git a/ioctl.c b/ioctl.c index 26bb48299f93db3ccd4e27870b00d2ed17768991..3d5b50d20ebc1f1e0ecb70ed68fdd4adfbe25be0 100644 --- a/ioctl.c +++ b/ioctl.c @@ -30,13 +30,12 @@ #include #include #include +#include #include "main.h" #include "ioctl.h" #include "debugfs.h" -typedef unsigned long long u64; - /* code borrowed from ethtool */ static int statistics_custom_get(int fd, struct ifreq *ifr) { @@ -47,7 +46,7 @@ static int statistics_custom_get(int fd, struct ifreq *ifr) int err, ret = EXIT_FAILURE; drvinfo.cmd = ETHTOOL_GDRVINFO; - ifr->ifr_data = (caddr_t)&drvinfo; + ifr->ifr_data = (void *)&drvinfo; err = ioctl(fd, SIOCETHTOOL, ifr); if (err < 0) { fprintf(stderr, "Error - can't open driver information: %s\n", strerror(errno)); @@ -59,7 +58,7 @@ static int statistics_custom_get(int fd, struct ifreq *ifr) goto success; sz_str = n_stats * ETH_GSTRING_LEN; - sz_stats = n_stats * sizeof(u64); + sz_stats = n_stats * sizeof(uint64_t); strings = calloc(1, sz_str + sizeof(struct ethtool_gstrings)); stats = calloc(1, sz_stats + sizeof(struct ethtool_stats)); @@ -71,7 +70,7 @@ static int statistics_custom_get(int fd, struct ifreq *ifr) strings->cmd = ETHTOOL_GSTRINGS; strings->string_set = ETH_SS_STATS; strings->len = n_stats; - ifr->ifr_data = (caddr_t)strings; + ifr->ifr_data = (void *)strings; err = ioctl(fd, SIOCETHTOOL, ifr); if (err < 0) { fprintf(stderr, "Error - can't get stats strings information: %s\n", strerror(errno)); @@ -80,7 +79,7 @@ static int statistics_custom_get(int fd, struct ifreq *ifr) stats->cmd = ETHTOOL_GSTATS; stats->n_stats = n_stats; - ifr->ifr_data = (caddr_t) stats; + ifr->ifr_data = (void *) stats; err = ioctl(fd, SIOCETHTOOL, ifr); if (err < 0) { fprintf(stderr, "Error - can't get stats information: %s\n", strerror(errno)); debian/patches/make_header_depends.patch0000644000000000000000000000210112241734453015564 0ustar Description: Don't fail rebuild when header is removed The *.d depends files for make just list the files used when building an object file. Removing a file listed in such a dependency file causes make to search for a way to recreate it. This usually cannot work because these files aren't autogenerated. . The gcc option -MP can be used to generate empty rule for these files. Removing a file in a dependency list will then execute this empty rule and continue with the execution of the creation of the object file. This compilation process will then automatically correct the dependency file. Author: Sven Eckelmann --- diff --git a/Makefile b/Makefile index 9e7c5be4cd907f8c0548eb9556574cb2c63374ce..166dcf8caa402cdd40d76119fd54fd693bbe0f7f 100755 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ OBJ_BISECT = bisect_iv.o MANPAGE = man/batctl.8 # batctl flags and options -CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD +CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD -MP CPPFLAGS += -D_GNU_SOURCE LDLIBS += -lm debian/patches/series0000644000000000000000000000052112241734453012035 0ustar strncat_bufferoverflow.patch gnu_source.patch const_assignment.patch static_functions.patch include_guards.patch legacy_types.patch includes.patch cflags_linker.patch make_header_depends.patch email_addresses.patch ip_resolver_cleanup.patch ip_resolver_rtnl.patch ip_resolver_ipv6.patch ip_resolver_libnl.patch vis_removal_warning.patch debian/patches/static_functions.patch0000644000000000000000000000371512241734453015230 0ustar Description: Mark all local functions as static Author: Sven Eckelmann --- diff --git a/debug.c b/debug.c index c879603e75dda26f28c1c856138913c59c7296f3..1e6807fc2c7cff749622918e9dedd31accf24707 100644 --- a/debug.c +++ b/debug.c @@ -84,7 +84,7 @@ const struct debug_table_data batctl_debug_tables[BATCTL_TABLE_NUM] = { }, }; -void debug_table_usage(int debug_table) +static void debug_table_usage(int debug_table) { fprintf(stderr, "Usage: batctl [options] %s|%s [parameters]\n", batctl_debug_tables[debug_table].opt_long, batctl_debug_tables[debug_table].opt_short); diff --git a/main.c b/main.c index 7d667d3b2f875561b5db373f81648d5b61d1a398..222a58f51e51defe0cb0320593b3256958267557 100644 --- a/main.c +++ b/main.c @@ -44,7 +44,7 @@ char mesh_dfl_iface[] = "bat0"; char module_ver_path[] = "/sys/module/batman_adv/version"; -void print_usage(void) +static void print_usage(void) { int i, opt_indent; diff --git a/ping.c b/ping.c index 5d6b7e97ac23dda3fb88be90065d0168f52a2bc7..162458c5ec5ef7bf8938b304324e9e003050286b 100644 --- a/ping.c +++ b/ping.c @@ -42,7 +42,7 @@ char is_aborted = 0; -void ping_usage(void) +static void ping_usage(void) { fprintf(stderr, "Usage: batctl [options] ping [parameters] mac|bat-host|host_name|IPv4_address \n"); fprintf(stderr, "parameters:\n"); @@ -54,7 +54,7 @@ void ping_usage(void) fprintf(stderr, " \t -T don't try to translate mac to originator address\n"); } -void sig_handler(int sig) +static void sig_handler(int sig) { switch (sig) { case SIGINT: diff --git a/traceroute.c b/traceroute.c index 38d37960d8daf547ca217449b40448a98f5e344a..9820a20de16d8df6226a191c1ba2331d5044a243 100644 --- a/traceroute.c +++ b/traceroute.c @@ -41,7 +41,7 @@ #define NUM_PACKETS 3 -void traceroute_usage(void) +static void traceroute_usage(void) { fprintf(stderr, "Usage: batctl [options] traceroute [parameters] mac|bat-host|host_name|IPv4_address \n"); fprintf(stderr, "parameters:\n"); debian/patches/strncat_bufferoverflow.patch0000644000000000000000000000322712241734453016442 0ustar Description: Fix possible buffer overflow when using strncat The length field (n) of strncat is used to specify the length of the buffer without the \0 delimiter. strncat will add it even when it will write it to the limit of n bytes was written. Author: Sven Eckelmann --- diff --git a/bat-hosts.c b/bat-hosts.c index 04e7a9b9acd8f9e28ad9a2abcaa14a93fc40380a..f0adb9c781aa4fcc430a63f0df2e5b85b23714c8 100644 --- a/bat-hosts.c +++ b/bat-hosts.c @@ -194,7 +194,7 @@ void bat_hosts_init(int read_opt) strncpy(confdir, homedir, CONF_DIR_LEN); confdir[CONF_DIR_LEN - 1] = '\0'; - strncat(confdir, &bat_hosts_path[i][1], CONF_DIR_LEN - strlen(confdir)); + strncat(confdir, &bat_hosts_path[i][1], CONF_DIR_LEN - strlen(confdir) - 1); } else { strncpy(confdir, bat_hosts_path[i], CONF_DIR_LEN); confdir[CONF_DIR_LEN - 1] = '\0'; diff --git a/functions.c b/functions.c index cc05a48cf6cc186a12413a976b090121b4e3afa0..0359287a8efc1574567e1c72262ff5dc06750d9c 100644 --- a/functions.c +++ b/functions.c @@ -180,7 +180,7 @@ int read_file(char *dir, char *fname, int read_opt, strncpy(full_path, dir, strlen(dir)); full_path[strlen(dir)] = '\0'; - strncat(full_path, fname, sizeof(full_path) - strlen(full_path)); + strncat(full_path, fname, sizeof(full_path) - strlen(full_path) - 1); open: line = 0; @@ -305,7 +305,7 @@ int write_file(char *dir, char *fname, char *arg1, char *arg2) strncpy(full_path, dir, strlen(dir)); full_path[strlen(dir)] = '\0'; - strncat(full_path, fname, sizeof(full_path) - strlen(full_path)); + strncat(full_path, fname, sizeof(full_path) - strlen(full_path) - 1); fd = open(full_path, O_WRONLY); debian/patches/vis_removal_warning.patch0000644000000000000000000000205512241734453015720 0ustar Description: Warn about upcoming removal of vis functionality Author: Sven Eckelmann --- diff --git a/vis.c b/vis.c index 7c62965b9d72030e7e1b47552774d74103056d2a..205191aa315192a4b89a1ee4261f48e5d042a1b8 100644 --- a/vis.c +++ b/vis.c @@ -56,6 +56,8 @@ static bool with_names = true; static void usage(void) { + fprintf(stderr, "Warning - The batctl and kernel module version 2013.5.0 (Linux v3.13) won't have vis support. The vis functionality will be moved to the userspace daemon 'alfred'.\n\n"); + fprintf(stderr, "batctl vis_data dot {-h}{--no-TT|-T} {--no-2nd|-2} {--numbers|-n}\n"); fprintf(stderr, "or\n"); fprintf(stderr, "batctl vis_data json {-h}{--no-TT|-T} {--no-2nd|-2} {--numbers|-n}\n"); @@ -103,6 +105,7 @@ static void dot_print_2nd(char *orig, char *from) static void dot_print_header(void) { + fprintf(stderr, "// Warning - The batctl and kernel module version 2013.5.0 (Linux v3.13) won't have vis support. The vis functionality will be moved to the userspace daemon 'alfred'.\n"); printf("digraph {\n"); } debian/rules0000755000000000000000000000201312241734453010247 0ustar #!/usr/bin/make -f # -*- makefile -*- export DEB_BUILD_MAINT_OPTIONS=hardening=+all export DEB_CFLAGS_MAINT_APPEND = -fdata-sections -ffunction-sections -flto export DEB_LDFLAGS_MAINT_APPEND = -Wl,--gc-sections REVISION=$(shell dpkg-parsechangelog|grep '^Version: '|sed 's/^Version:\s*//') MAKEOPTIONS = V="1" REVISION="debian-$(REVISION)" PREFIX="/usr" CONFIG_BATCTL_BISECT=y DBG_PACKAGE=$(shell dpkg-parsechangelog|grep '^Source: '|sed 's/^Source:\s*//')-dbg binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep: dh $@ --parallel --list-missing get-orig-source: $(CURDIR)/debian/get-orig-source.sh override_dh_auto_build: dh_auto_build -- $(MAKEOPTIONS) override_dh_auto_install: dh_auto_install -- $(MAKEOPTIONS) override_dh_strip: dh_strip -a --dbg-package="$(DBG_PACKAGE)" .PHONY: binary binary-arch binary-indep build build-arch build-indep clean install install-arch install-indep \ get-orig-source override_dh_auto_build override_dh_auto_install override_dh_strip debian/source/0000755000000000000000000000000012241734453010473 5ustar debian/source/format0000644000000000000000000000001412241734453011701 0ustar 3.0 (quilt) debian/source/include-binaries0000644000000000000000000000004012241734453013625 0ustar debian/upstream-signing-key.pgp debian/upstream-signing-key.pgp0000644000000000000000000000132512241734453013766 0ustar Bif*$+P g-z'#@ Jgx}M jEt($fȎ;L ʾmf_滽- d&Gqrt=(y,n|$}r7QTcs`k3[mXN@9i"`*po[u@$ai(nIJz*34vhG:"bi7K=\Ƣ,Ap^1Ԑ͝7RN{yoȄ,&$ ?~#HRKw`疱l? tapdHdF}l{hPFu.W~@^8~ņ]K +i;M%ڝ Wi)'|^b"N=   8?|Y;ks~n"žႊF<sEh9J˲Ũ28Simon Wunderlich ^C©   8?|Y;kݲd.F2ky3y&,>a=}jPnNdebian/watch0000644000000000000000000000024412241734453010224 0ustar version=3 opts="uversionmangle=s/-(alpha|beta|rc)/~$1/,pgpsigurlmangle=s/$/.asc/" \ http://downloads.open-mesh.org/batman/stable/sources/batctl/batctl-(.*).tar.gz