[arptables_jf] arptables-save was swapping bytes in the arpop (#891769)

Jiří Popelka jpopelka at fedoraproject.org
Tue Jan 8 18:28:46 UTC 2013


commit 8d9a45441aef0682f813cb480e3fa4906c3ae9b9
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Tue Jan 8 19:27:00 2013 +0100

    arptables-save was swapping bytes in the arpop (#891769)

 arptables_jf-0.0.8-byteorder.patch |   19 +++++++++++++++++++
 arptables_jf.spec                  |    7 +++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
---
diff --git a/arptables_jf-0.0.8-byteorder.patch b/arptables_jf-0.0.8-byteorder.patch
index 91c3ad4..7d7275e 100644
--- a/arptables_jf-0.0.8-byteorder.patch
+++ b/arptables_jf-0.0.8-byteorder.patch
@@ -48,3 +48,22 @@ diff -Naur arptables_jf-0.0.8.orig/arptables.c arptables_jf-0.0.8.new/arptables.
  	if ( *p == '/' ) {
  	    p++;
  	    ch1 = p[0];
+diff -up arptables_jf-0.0.8/arptables-save.c.byteorder arptables_jf-0.0.8/arptables-save.c
+--- arptables_jf-0.0.8/arptables-save.c.byteorder	2013-01-08 19:14:01.000000000 +0100
++++ arptables_jf-0.0.8/arptables-save.c	2013-01-08 19:16:39.333712621 +0100
+@@ -171,12 +171,12 @@ static void print_rule(const struct arpt
+         print_uint8 ( "-a", e->arp.arhln, e->arp.arhln_mask,
+  e->arp.invflags & ARPT_INV_ARPHLN );
+ 
+-	print_uint16 ( "-p", e->arp.arpop, e->arp.arpop_mask,
++	print_uint16 ( "-p", ntohs(e->arp.arpop), ntohs(e->arp.arpop_mask),
+  e->arp.invflags & ARPT_INV_ARPOP );
+ 
+-        print_uint16 ( "-H", e->arp.arhrd, e->arp.arhrd_mask,
++        print_uint16 ( "-H", ntohs(e->arp.arhrd), ntohs(e->arp.arhrd_mask),
+  e->arp.invflags & ARPT_INV_ARPHRD );
+-        print_uint16 ( "-w", e->arp.arpro, e->arp.arpro_mask,
++        print_uint16 ( "-w", ntohs(e->arp.arpro), ntohs(e->arp.arpro_mask),
+  e->arp.invflags & ARPT_INV_ARPPRO );
+ 
+         print_hwaddr_and_mask ( "-z", e->arp.src_devaddr.addr, e->arp.src_devaddr.mask,
diff --git a/arptables_jf.spec b/arptables_jf.spec
index eb700b9..d03db84 100644
--- a/arptables_jf.spec
+++ b/arptables_jf.spec
@@ -1,7 +1,7 @@
 Summary: User-space control program for the arptables network filter
 Name:    arptables_jf
 Version: 0.0.8
-Release: 30%{?dist}
+Release: 31%{?dist}
 License: GPLv2+
 Group:   System Environment/Base
 
@@ -44,7 +44,7 @@ written by Jay Fenlason.
 %patch7 -p1 -b .dbl-opt
 
 %build
-make all BINDIR=%{_sbindir} 'COPT_FLAGS=%{optflags} -fno-strict-aliasing' %{_smp_mflags}
+make all 'COPT_FLAGS=%{optflags} -fno-strict-aliasing' %{_smp_mflags}
 
 %install
 make install DESTDIR=%{buildroot} BINDIR=%{_sbindir}
@@ -83,6 +83,9 @@ echo '#Configure prior to use' > %{buildroot}%{_sysconfdir}/sysconfig/arptables
 %config(noreplace) %{_sysconfdir}/sysconfig/arptables
 
 %changelog
+* Tue Jan 08 2013 Jiri Popelka <jpopelka at redhat.com> - 0.0.8-31
+- arptables-save was swapping bytes in the arpop (#891769)
+
 * Wed Nov 28 2012 Jiri Popelka <jpopelka at redhat.com> - 0.0.8-30
 - /usr move: use _sbindir macro
 - removed unused initscript.patch


More information about the scm-commits mailing list