debian/0000775000000000000000000000000012243642223007170 5ustar debian/docs0000664000000000000000000000000712157626637010057 0ustar THANKS debian/compat0000664000000000000000000000000212157626637010405 0ustar 9 debian/stamp-autotools-files0000664000000000000000000000000012157626637013373 0ustar debian/patches/0000775000000000000000000000000012157626637010636 5ustar debian/patches/debian_defaultconfig.patch0000664000000000000000000000324012157626637015772 0ustar Description: Debian enhancements to the ebtables "sysconfig" default settings. From: Jan Christoph Nordholz --- --- a/ebtables-config +++ b/ebtables-config @@ -1,17 +1,3 @@ -# Save (and possibly restore) in text format. -# Value: yes|no, default: yes -# Save the firewall rules in text format to __SYSCONFIG__/ebtables -# If EBTABLES_BINARY_FORMAT="no" then restoring the firewall rules -# is done using this text format. -EBTABLES_TEXT_FORMAT="yes" - -# Save (and restore) in binary format. -# Value: yes|no, default: yes -# Save (and restore) the firewall rules in binary format to (and from) -# __SYSCONFIG__/ebtables.. Enabling this option will make -# firewall initialisation a lot faster. -EBTABLES_BINARY_FORMAT="yes" - # Unload modules on restart and stop # Value: yes|no, default: yes # This option has to be 'yes' to get to a sane state for a firewall @@ -19,6 +5,12 @@ # modules. EBTABLES_MODULES_UNLOAD="yes" +# Load firewall rules on system startup. +# Value: yes|no, default: no +# Restores the ebtables rulesets from the last saved state when the +# system boots up. +EBTABLES_LOAD_ON_START="no" + # Save current firewall rules on stop. # Value: yes|no, default: no # Saves all firewall rules if firewall gets stopped @@ -35,3 +27,9 @@ # Save rule counters when saving a kernel table to a file. If the # rule counters were saved, they will be restored when restoring the table. EBTABLES_SAVE_COUNTER="no" + +# Backup suffix for ruleset save files. +# Value: , default: "~" +# Keep one backup level of saved rules. +# Set this variable to the empty string to disable backups. +EBTABLES_BACKUP_SUFFIX="~" debian/patches/makefile_adjustments.patch0000664000000000000000000000574412157626637016067 0ustar Description: makefile_adjustments Adjust the installation paths to Debian-compatible values, and drag all install incovations to the install target because $(DESTDIR) (i.e. debian/ebtables) isn't available before. Also fix an FTBFS bug on HPPA by calling $(CC) instead of $(LD). From: Jan Christoph Nordholz --- --- a/Makefile +++ b/Makefile @@ -10,11 +10,11 @@ # default paths LIBDIR:=/usr/lib -MANDIR:=/usr/local/man -BINDIR:=/usr/local/sbin +MANDIR:=/usr/share/man +BINDIR:=/sbin ETCDIR:=/etc -INITDIR:=/etc/rc.d/init.d -SYSCONFIGDIR:=/etc/sysconfig +INITDIR:=/etc/init.d +SYSCONFIGDIR:=/etc/default DESTDIR:= CFLAGS:=-Wall -Wunused -Werror @@ -157,21 +157,14 @@ scripts: ebtables-save ebtables.sysv ebtables-config cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_ mkdir -p $(DESTDIR)$(BINDIR) - install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi - if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi - if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi - rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g') $(MANDIR)/man8/ebtables.8: ebtables.8 - mkdir -p $(DESTDIR)$(@D) sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' ebtables.8 > ebtables.8_ - install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@ - rm -f ebtables.8_ $(DESTDIR)$(ETHERTYPESFILE): ethertypes mkdir -p $(@D) @@ -179,12 +172,16 @@ .PHONY: exec exec: ebtables ebtables-restore - mkdir -p $(DESTDIR)$(BINDIR) - install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME) + mkdir -p $(DESTDIR)$(LIBDIR) $(DESTDIR)$(INITDIR) $(DESTDIR)$(SYSCONFIGDIR) $(DESTDIR)$(MANDIR)/man8 + install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR) install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore + install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save + install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables + install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config + install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$(MANDIR)/man8/ebtables.8 .PHONY: install -install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts +install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) scripts exec mkdir -p $(DESTDIR)$(LIBDIR) install -m 0755 extensions/*.so $(DESTDIR)$(LIBDIR) install -m 0755 *.so $(DESTDIR)$(LIBDIR) debian/patches/series0000664000000000000000000000021212157626637012046 0ustar debian_defaultconfig.patch makefile_adjustments.patch manpage.patch compensate-for-missing-aligned-u64.patch link_with_no-as-needed.patch debian/patches/compensate-for-missing-aligned-u64.patch0000664000000000000000000000101512157626637020262 0ustar Description: Fix FTBFS due to missing __aligned_u64 definition Bug-Debian: http://bugs.debian.org/661449 From: Cyril Brulebois --- --- a/extensions/ebt_pkttype.c +++ b/extensions/ebt_pkttype.c @@ -12,6 +12,11 @@ #include #include #include "../include/ebtables_u.h" +/* BEGIN: Workaround */ +#ifndef __aligned_u64 +#define __aligned_u64 __u64 __attribute__((aligned(8))) +#endif +/* END: Workaround */ #include #include debian/patches/link_with_no-as-needed.patch0000664000000000000000000000122312141247030016137 0ustar Bug-Ubuntu: https://bugs.launchpad.net/bugs/899315 Index: b/Makefile =================================================================== --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ $(CC) -shared $(LDFLAGS) -Wl,-soname,libebtc.so -o libebtc.so -lc $(OBJECTS2) ebtables: $(OBJECTS) ebtables-standalone.o libebtc.so - $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ + $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -Wl,--no-as-needed $(EXT_LIBSI) -lebtc \ -Wl,-rpath,$(LIBDIR) ebtablesu: ebtablesu.c debian/patches/manpage.patch0000664000000000000000000000072212157626637013270 0ustar Description: Drop the version number from the manpage header. From: Jan Christoph Nordholz --- --- a/ebtables.8 +++ b/ebtables.8 @@ -24,7 +24,7 @@ .\" .\" .SH NAME -ebtables (v2.0.10-4) \- Ethernet bridge frame table administration +ebtables \- Ethernet bridge frame table administration .SH SYNOPSIS .BR "ebtables " [ -t " table ] " - [ ACDI "] chain rule specification [match extensions] [watcher extensions] target" .br debian/rules0000775000000000000000000000173212157626637010272 0ustar #!/usr/bin/make -f export DEB_BUILD_HARDENING = 1 MAKE_PATH_REDIRECTIONS:=LIBDIR=/lib/ebtables \ BINDIR=/sbin \ DESTDIR=debian/ebtables include /usr/share/cdbs/1/rules/debhelper.mk CFLAGS+=$(HARDENING_CFLAGS) -fstack-protector-all LDFLAGS+=$(HARDENING_LDFLAGS) DEB_DH_INSTALLINIT_ARGS:=-- start 20 S . stop 80 0 1 6 . build/ebtables:: make CFLAGS="$(CFLAGS)" $(MAKE_PATH_REDIRECTIONS) clean:: dh_testdir rm -f build-stamp make clean rm -f ebtables.8_ ebtables.sysv_ ebtables-config_ ebtables-save_ dh_clean install/ebtables:: build dh_testdir dh_testroot dh_clean dh_installdirs make install $(MAKE_PATH_REDIRECTIONS) rm -f debian/ebtables/sbin/ebtables-save debian/ebtables/sbin/ebtables-restore mv debian/ebtables/etc/default/ebtables-config debian/ebtables/etc/default/ebtables rm -f debian/ebtables/etc/init.d/ebtables mkdir -p debian/ebtables/usr/share/lintian/overrides cp debian/ebtables.override debian/ebtables/usr/share/lintian/overrides/ebtables debian/source/0000775000000000000000000000000012157626637010507 5ustar debian/source/format0000664000000000000000000000001412157626637011715 0ustar 3.0 (quilt) debian/watch0000664000000000000000000000014312157626637010236 0ustar version=3 opts="uversionmangle=s/-/./g" http://sf.net/ebtables/ebtables-v([[:digit:].-]*)\.tar\.gz debian/control0000664000000000000000000000130612157626637010612 0ustar Source: ebtables Section: net Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Jochen Friedrich Uploaders: William Dauchy Standards-Version: 3.9.3 Build-Depends: debhelper (>= 9), cdbs, hardening-wrapper Homepage: http://ebtables.sourceforge.net Package: ebtables Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: iptables, kmod Description: Ethernet bridge frame table administration Ebtables is used to set up, maintain, and inspect the tables of Ethernet frame rules in the Linux kernel. It is analogous to iptables, but operates at the MAC layer rather than the IP layer. debian/copyright0000664000000000000000000000253712157626637011151 0ustar This package was debianized by David Kimdon on Fri, 17 Jan 2003 20:05:00 -0800. It is currently maintained by Jochen Friedrich and Jan Christoph Nordholz . It was downloaded from http://ebtables.sourceforge.net Upstream Authors: Bart De Schuymer Nick Fedchik Grzegorz Borowiak Copyright: Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling Copyright (C) 2001, 2002, 2004 Bart De Schuymer License: This package 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; version 2 dated June, 1991. This package 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 GNU/Linux systems, the complete text of the GNU General Public License, version 2, can be found in `/usr/share/common-licenses/GPL-2'. debian/changelog0000664000000000000000000001712012243642223011043 0ustar ebtables (2.0.10.4-3ubuntu1) trusty; urgency=low * Merge with Debian. Remaining changes: - Link ebtables with --no-as-needed and adjust the link order to fix crash when running ebtables. -- Iain Lane Fri, 22 Nov 2013 11:42:46 +0000 ebtables (2.0.10.4-3) unstable; urgency=low * packaging update: - fix missing dot in DEB_DH_INSTALLINIT_ARGS (Closes: #706885) -- William Dauchy Mon, 06 May 2013 14:06:02 +0000 ebtables (2.0.10.4-2ubuntu2) saucy; urgency=low * Add trailing "." to update-rc.d arguments (LP: #1176436) -- Iain Lane Sun, 05 May 2013 20:14:40 +0100 ebtables (2.0.10.4-2ubuntu1) saucy; urgency=low * Resynchronise with Debian. Remaining changes: - Link ebtables with --no-as-needed and adjust the link order to fix crash when running ebtables. -- Colin Watson Sat, 04 May 2013 11:06:40 -0700 ebtables (2.0.10.4-2) unstable; urgency=low * packaging update: - add install init args in rules to fix install warning (Closes: #697275) - module-init-tools is a transitional package. replacing it with kmod (Closes: #697276) - "init script returns 1 when ebtables is removed" (Closes: #684592) -- William Dauchy Tue, 20 Mar 2013 15:46:02 +0000 ebtables (2.0.10.4-1ubuntu1) raring; urgency=low * Resynchronise with Debian. Remaining changes: - Link ebtables with --no-as-needed and adjust the link order to fix crash when running ebtables. -- Colin Watson Mon, 26 Nov 2012 17:42:18 +0000 ebtables (2.0.10.4-1) unstable; urgency=low * New upstream release - "v2.0.10-1 wish for ipv6-icmp and security" (Closes: #643594). * packaging update: * use debhelper & compat version 9. * standards to 3.9.3 - "ebtables may use modprobe, so it should recommend module-init-tools" (Closes: #614919) * missing cdbs build dependency * add hardening to debian rules. * init: add run level 1 to Default-Stop rule * patchworks: + refresh patches with new release + refresh patch headers * Adding myself as uploaders * Removing Jan Christoph Nordholz from uploaders -- William Dauchy Thu, 24 May 2012 12:24:02 +0000 ebtables (2.0.9.2-2.1) unstable; urgency=high * Non-maintainer upload. * Fix FTBFS due to missing __aligned_u64 definition (Closes: #661449): - 04compensate-for-missing-aligned-u64.patch * Set urgency to “high” for RC bug fix. -- Cyril Brulebois Sat, 03 Mar 2012 15:24:02 +0000 ebtables (2.0.9.2-2ubuntu3) quantal; urgency=low * Rebuild for new armel compiler default of ARMv5t. -- Colin Watson Mon, 01 Oct 2012 21:01:35 +0100 ebtables (2.0.9.2-2ubuntu2) precise; urgency=low * Add patch 05link_with_no-as-needed.patch to link ebtables with --no-as-needed and adjust the link order to fix crash when running ebtables (LP: #899315) * debian/rules: add -g option to DEBCFLAGS, so symbols can be extracted into an ebtables-dbgsym package -- Albert Damen Sun, 04 Dec 2011 21:19:58 +0100 ebtables (2.0.9.2-2ubuntu1) precise; urgency=low * Add 04define__aligned_u64.patch to define __aligned_u64 before including linux/if_packet.h, resolving FTBFS. -- Adam Conrad Fri, 02 Dec 2011 00:25:41 -0700 ebtables (2.0.9.2-2) unstable; urgency=low * Add a lintian override concerning the usage of -rpath that got lost in the last revision. -- Jochen Friedrich Mon, 10 May 2010 14:08:01 +0200 ebtables (2.0.9.2-1) unstable; urgency=low * New upstream release * Refresh patches * Switch to dpkg-source 3.0 (quilt) format * Bump Standards version to 3.8.4 * Added homepage tag -- Jochen Friedrich Fri, 07 May 2010 16:50:04 +0200 ebtables (2.0.9.1-1) unstable; urgency=low * New upstream release: * New modules for ip6 and nflog. * Bump Standards version to 3.8.2: * Catch postrm errors. * Specify GPL version and cleanup copyright file. * Bump debhelper level to 7. -- Jan Christoph Nordholz Sun, 28 Jun 2009 20:01:25 +0200 ebtables (2.0.8.2-4) unstable; urgency=low * Don't have the initscript probe for kernel support if it is not going to actually do something. Thanks to Patrick McHardy for report and patch! Closes: #476429. * While I'm at it, make a few minor (unrelated) improvements to the initscript. -- Jan Christoph Nordholz Sun, 20 Apr 2008 00:56:39 +0200 ebtables (2.0.8.2-3) unstable; urgency=low * Fix NAME section in ebtables(8) manpage. -- Jan Christoph Nordholz Fri, 11 Apr 2008 01:48:33 +0200 ebtables (2.0.8.2-2) unstable; urgency=low * Replace call to $(LD) with $(CC) to fix FTBFS on hppa. -- Jan Christoph Nordholz Sun, 04 Nov 2007 14:38:12 +0100 ebtables (2.0.8.2-1) unstable; urgency=low * New upstream release. * Replace dpatches 10-12 with new 02makefile_adjustments as upstream has incorporated most of our changes. -- Jan Christoph Nordholz Sun, 23 Sep 2007 15:28:36 +0200 ebtables (2.0.8.1-2) unstable; urgency=low * Thoroughly clean up the installation logic of upstream's Makefile. Closes: #431345. -- Jan Christoph Nordholz Mon, 02 Jul 2007 23:05:34 +0200 ebtables (2.0.8.1-1) unstable; urgency=low * New upstream release. Closes: #428924, #403674. (428924: FTBFS with linux-libc-dev) (403674: wishlist bug: new upstream available) * Bump Standards version to 3.7.2. * Replace debhelper+cdbs with debhelper+dpatch (personal preference). * Write a debian-specific initscript. The upstream one is too closely tied to redhat. * Add a lintian override concerning the usage of -rpath for the time being, as fixing this will require invasive upstream code changes. * Fix watch file. * Add myself as uploader. -- Jan Christoph Nordholz Sat, 23 Jun 2007 22:54:05 +0200 ebtables (2.0.6-3) unstable; urgency=low * Applied patch from Andreas Jochens to make ebtables compile with gcc-4.0 (Closes: #288975). -- Jochen Friedrich Sat, 29 Jan 2005 22:55:59 +0100 ebtables (2.0.6-2) unstable; urgency=low * Fix FTBFS with gcc-3.4 (Closes: #258636). Thanks to Andreas Jochens for the patch. -- Jochen Friedrich Wed, 14 Jul 2004 17:21:49 +0200 ebtables (2.0.6-1) unstable; urgency=low * New upstream release + added arpreply and among modules + added limit match -- Jochen Friedrich Fri, 2 Jan 2004 22:29:45 +0100 ebtables (2.0.5-2) unstable; urgency=low * The "I should really check what i upload" revision * New maintainer (Closes: #211788) * Changed build system to cdbs * Bumped policy to 3.6.1 * New upstream homepage * Removed conffiles, files in /etc are automatically flagged as conffiles in compat level 4 used by cdbs -- Jochen Friedrich Mon, 29 Sep 2003 19:46:31 +0200 ebtables (2.0.5-1) unstable; urgency=low * New upstream release -- Jochen Friedrich Thu, 25 Sep 2003 23:29:34 +0200 ebtables (2.0.3-1) unstable; urgency=low * New upstream release. -- David Kimdon Fri, 23 May 2003 22:00:36 -0700 ebtables (2.0.2-1) unstable; urgency=low * Initial Release. -- David Kimdon Fri, 17 Jan 2003 20:05:00 -0800 debian/ebtables.override0000664000000000000000000000021312157626637012525 0ustar ebtables: init.d-script-possible-missing-stop /etc/init.d/ebtables 1 ebtables: binary-or-shlib-defines-rpath ./sbin/ebtables /lib/ebtables debian/ebtables.init0000664000000000000000000001040012157626637011650 0ustar #!/bin/bash # # init script for the Ethernet Bridge filter tables # # Written by Dag Wieers # Modified by Rok Papez # Bart De Schuymer # Adapted to Debian by Jan Christoph Nordholz # # chkconfig: - 15 85 # description: Ethernet Bridge filtering tables # ### BEGIN INIT INFO # Provides: ebtables # Required-Start: # Required-Stop: # Should-Start: $local_fs # Should-Stop: $local_fs # Default-Start: S # Default-Stop: 0 1 6 # Short-Description: ebtables ruleset management # Description: Saves and restores the state of the ebtables rulesets. ### END INIT INFO . /lib/lsb/init-functions test -f /sbin/ebtables || exit 0 EBTABLES_DUMPFILE_STEM=/etc/ebtables RETVAL=0 prog="ebtables" desc="Ethernet bridge filtering" umask 0077 #default configuration EBTABLES_MODULES_UNLOAD="yes" EBTABLES_LOAD_ON_START="no" EBTABLES_SAVE_ON_STOP="no" EBTABLES_SAVE_ON_RESTART="no" EBTABLES_SAVE_COUNTER="no" EBTABLES_BACKUP_SUFFIX="~" config=/etc/default/$prog [ -f "$config" ] && . "$config" function get_supported_tables() { EBTABLES_SUPPORTED_TABLES= /sbin/ebtables -t filter -L 2>&1 1>/dev/null | grep -q permission if [ $? -eq 0 ]; then log_failure_msg "Error: insufficient privileges to access the ebtables rulesets." exit 1 fi for table in filter nat broute; do /sbin/ebtables -t $table -L &> /dev/null if [ $? -eq 0 ]; then EBTABLES_SUPPORTED_TABLES="${EBTABLES_SUPPORTED_TABLES} $table" fi done } function load() { RETVAL=0 get_supported_tables log_daemon_msg "Restoring ebtables rulesets" for table in $EBTABLES_SUPPORTED_TABLES; do log_progress_msg "$table" if [ -s ${EBTABLES_DUMPFILE_STEM}.$table ]; then /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-commit RET=$? if [ $RET -ne 0 ]; then log_progress_msg "(failed)" RETVAL=$RET fi else log_progress_msg "(no saved state)" fi done if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then log_progress_msg "no kernel support" else log_progress_msg "done" fi log_end_msg $RETVAL } function clear() { RETVAL=0 get_supported_tables log_daemon_msg "Clearing ebtables rulesets" for table in $EBTABLES_SUPPORTED_TABLES; do log_progress_msg "$table" /sbin/ebtables -t $table --init-table done if [ "$EBTABLES_MODULES_UNLOAD" = "yes" ]; then for mod in $(grep -E '^(ebt|ebtable)_' /proc/modules | cut -d' ' -f1) ebtables; do rmmod $mod 2> /dev/null done fi if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then log_progress_msg "no kernel support" else log_progress_msg "done" fi log_end_msg $RETVAL } function save() { RETVAL=0 get_supported_tables log_daemon_msg "Saving ebtables rulesets" for table in $EBTABLES_SUPPORTED_TABLES; do log_progress_msg "$table" [ -n "$EBTABLES_BACKUP_SUFFIX" ] && [ -s ${EBTABLES_DUMPFILE_STEM}.$table ] && \ mv ${EBTABLES_DUMPFILE_STEM}.$table ${EBTABLES_DUMPFILE_STEM}.$table$EBTABLES_BACKUP_SUFFIX /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-save RET=$? if [ $RET -ne 0 ]; then log_progress_msg "(failed)" RETVAL=$RET else if [ "$EBTABLES_SAVE_COUNTER" = "no" ]; then /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table -Z fi fi done if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then log_progress_msg "no kernel support" else log_progress_msg "done" fi log_end_msg $RETVAL } case "$1" in start) [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load ;; stop) [ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save clear ;; restart|reload|force-reload) [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save clear [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load ;; load) load ;; save) save ;; status) get_supported_tables if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then log_failure_msg "No kernel support for ebtables." RETVAL=1 else log_daemon_msg "Ebtables support available, number of installed rules" for table in $EBTABLES_SUPPORTED_TABLES; do COUNT=$(( $(/sbin/ebtables -t $table -L | sed -e "/^Bridge chain/! d" -e "s/^.*entries: //" -e "s/,.*$/ +/") 0 )) log_progress_msg "$table($COUNT)" done log_end_msg 0 RETVAL=0 fi ;; *) echo "Usage: $0 {start|stop|restart|reload|force-reload|load|save|status}" >&2 RETVAL=1 esac exit $RETVAL debian/ebtables.postrm0000664000000000000000000000021612157626637012235 0ustar #!/bin/bash set -e #DEBHELPER# if [ "$1" == purge ]; then rm -f /etc/ebtables.filter* /etc/ebtables.nat* /etc/ebtables.broute* fi exit 0