rpms/tcpdump/FC-6 arpwatch-arp2ethers.patch, NONE, 1.1 libpcap-0.9.4-off_ll.patch, NONE, 1.1 .cvsignore, 1.11, 1.12 sources, 1.11, 1.12 tcpdump.spec, 1.55, 1.56 arpwatch-ethcodes.patch.bz2, 1.1, NONE

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Nov 17 09:24:33 UTC 2006


Author: mlichvar

Update of /cvs/dist/rpms/tcpdump/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv13509

Modified Files:
	.cvsignore sources tcpdump.spec 
Added Files:
	arpwatch-arp2ethers.patch libpcap-0.9.4-off_ll.patch 
Removed Files:
	arpwatch-ethcodes.patch.bz2 
Log Message:
- fix processing of Prism and AVS headers (#206686)
- fix arp2ethers script
- update ethercodes.dat
- move pcap man page to devel package
Resolves: #206686


arpwatch-arp2ethers.patch:
 arp2ethers |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE arpwatch-arp2ethers.patch ---
--- arpwatch-2.1a15/arp2ethers.arp2ethers	2002-01-05 20:40:48.000000000 +0100
+++ arpwatch-2.1a15/arp2ethers	2006-11-02 17:28:29.000000000 +0100
@@ -13,7 +13,7 @@
 #	- sort
 #
 
-sort +2rn arp.dat | \
+sort -k 2 -rn arp.dat | \
     awk 'NF == 4 { print }' | \
     awk -f p.awk | \
     egrep -v '\.[0-9][0-9]*$' | \

libpcap-0.9.4-off_ll.patch:
 gencode.c |  125 +++++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 88 insertions(+), 37 deletions(-)

--- NEW FILE libpcap-0.9.4-off_ll.patch ---
Index: libpcap/gencode.c
===================================================================
RCS file: /tcpdump/master/libpcap/gencode.c,v
retrieving revision 1.221.2.39
retrieving revision 1.221.2.40
retrieving revision 1.221.2.42
retrieving revision 1.221.2.43
--- libpcap/gencode.c
+++ libpcap/gencode.c
@@ -668,20 +668,26 @@
 static int reg_ll_size;
 
 /*
- * This is the offset of the beginning of the link-layer header.
+ * This is the offset of the beginning of the link-layer header from
+ * the beginning of the raw packet data.
+ *
  * It's usually 0, except for 802.11 with a fixed-length radio header.
+ * (For 802.11 with a variable-length radio header, we have to generate
+ * code to compute that offset; off_ll is 0 in that case.)
  */
 static u_int off_ll;
 
 /*
  * This is the offset of the beginning of the MAC-layer header.
- * It's usually 0, except for ATM LANE.
+ * It's usually 0, except for ATM LANE, where it's the offset, relative
+ * to the beginning of the raw packet data, of the Ethernet header.
  */
 static u_int off_mac;
 
 /*
  * "off_linktype" is the offset to information in the link-layer header
- * giving the packet type.
+ * giving the packet type.  This offset is relative to the beginning
+ * of the link-layer header (i.e., it doesn't include off_ll).
  *
  * For Ethernet, it's the offset of the Ethernet type field.
  *
@@ -734,6 +740,8 @@
 
 /*
  * These are offsets to the beginning of the network-layer header.
+ * They are relative to the beginning of the link-layer header (i.e.,
+ * they don't include off_ll).
  *
  * If the link layer never uses 802.2 LLC:
  *
@@ -956,9 +964,9 @@
 		 * the Prism header is fixed-length.
 		 */
 		off_ll = 144;
-		off_linktype = 144+24;
-		off_nl = 144+32;	/* Prism+802.11+802.2+SNAP */
-		off_nl_nosnap = 144+27;	/* Prism+802.11+802.2 */
+		off_linktype = 24;
+		off_nl = 32;	/* Prism+802.11+802.2+SNAP */
+		off_nl_nosnap = 27;	/* Prism+802.11+802.2 */
 		return;
 
 	case DLT_IEEE802_11_RADIO_AVS:
@@ -974,12 +982,23 @@
 		 * more so; this header is also variable-length,
 		 * with the length being the 32-bit big-endian
 		 * number at an offset of 4 from the beginning
-		 * of the radio header.
+		 * of the radio header.  We should handle that the
+		 * same way we handle the length at the beginning
+		 * of the radiotap header.
+		 *
+		 * XXX - in Linux, do any drivers that supply an AVS
+		 * header supply a link-layer type other than
+		 * ARPHRD_IEEE80211_PRISM?  If so, we should map that
+		 * to DLT_IEEE802_11_RADIO_AVS; if not, or if there are
+		 * any drivers that supply an AVS header but supply
+		 * an ARPHRD value of ARPHRD_IEEE80211_PRISM, we'll
+		 * have to check the header in the generated code to
+		 * determine whether it's Prism or AVS.
 		 */
 		off_ll = 64;
-		off_linktype = 64+24;
-		off_nl = 64+32;		/* Radio+802.11+802.2+SNAP */
-		off_nl_nosnap = 64+27;	/* Radio+802.11+802.2 */
+		off_linktype = 24;
+		off_nl = 32;		/* Radio+802.11+802.2+SNAP */
+		off_nl_nosnap = 27;	/* Radio+802.11+802.2 */
 		return;
 
 	case DLT_IEEE802_11_RADIO:
@@ -1229,14 +1248,29 @@
 	 * If "s" is non-null, it has code to arrange that the X register
 	 * contains the length of the prefix preceding the link-layer
 	 * header.
+	 *
+	 * Otherwise, the length of the prefix preceding the link-layer
+	 * header is "off_ll".
 	 */
 	if (s != NULL) {
+		/*
+		 * There's a variable-length prefix preceding the
+		 * link-layer header.  "s" points to a list of statements
+		 * that put the length of that prefix into the X register.
+		 * do an indirect load, to use the X register as an offset.
+		 */
 		s2 = new_stmt(BPF_LD|BPF_IND|size);
 		s2->s.k = offset;
 		sappend(s, s2);
 	} else {
+		/*
+		 * There is no variable-length header preceding the
+		 * link-layer header; add in off_ll, which, if there's
+		 * a fixed-length header preceding the link-layer header,
+		 * is the length of that header.
+		 */
 		s = new_stmt(BPF_LD|BPF_ABS|size);
-		s->s.k = offset;
+		s->s.k = offset + off_ll;
 	}
 	return s;
 }
@@ -1258,7 +1292,7 @@
 		break;
 
 	case OR_LINK:
-		s = gen_load_llrel(off_ll + offset, size);
+		s = gen_load_llrel(offset, size);
 		break;
 
 	case OR_NET:
@@ -1271,17 +1305,24 @@
 
 	case OR_TRAN_IPV4:
 		/*
-		 * Load the X register with the length of the IPv4 header,
-		 * in bytes.
+		 * Load the X register with the length of the IPv4 header
+		 * (plus the offset of the link-layer header, if it's
+		 * preceded by a variable-length header such as a radio
+		 * header), in bytes.
 		 */
 		s = gen_loadx_iphdrlen();
 
 		/*
-		 * Load the item at {length of the link-layer header} +
-		 * {length of the IPv4 header} + {specified offset}.
+		 * Load the item at {offset of the link-layer header} +
+		 * {offset, relative to the start of the link-layer
+		 * header, of the IPv4 header} + {length of the IPv4 header} +
+		 * {specified offset}.
+		 *
+		 * (If the link-layer is variable-length, it's included
+		 * in the value in the X register, and off_ll is 0.)
 		 */
 		s2 = new_stmt(BPF_LD|BPF_IND|size);
-		s2->s.k = off_nl + offset;
+		s2->s.k = off_ll + off_nl + offset;
 		sappend(s, s2);
 		break;
 
@@ -1339,12 +1380,12 @@
 	} else {
 		/*
 		 * There is no variable-length header preceding the
-		 * link-layer header; if there's a fixed-length
-		 * header preceding it, its length is included in
-		 * the off_ variables, so it doesn't need to be added.
+		 * link-layer header; add in off_ll, which, if there's
+		 * a fixed-length header preceding the link-layer header,
+		 * is the length of that header.
 		 */
 		s = new_stmt(BPF_LDX|BPF_MSH|BPF_B);
-		s->s.k = off_nl;
+		s->s.k = off_ll + off_nl;
 	}
 	return s;
 }
@@ -4177,11 +4218,11 @@
 
 		/* A = ip->ip_p */
 		s[i] = new_stmt(BPF_LD|BPF_ABS|BPF_B);
-		s[i]->s.k = off_nl + 9;
+		s[i]->s.k = off_ll + off_nl + 9;
 		i++;
 		/* X = ip->ip_hl << 2 */
 		s[i] = new_stmt(BPF_LDX|BPF_MSH|BPF_B);
-		s[i]->s.k = off_nl;
+		s[i]->s.k = off_ll + off_nl;
 		i++;
 		break;
 #ifdef INET6
@@ -4190,7 +4231,7 @@
 
 		/* A = ip6->ip_nxt */
 		s[i] = new_stmt(BPF_LD|BPF_ABS|BPF_B);
-		s[i]->s.k = off_nl + 6;
+		s[i]->s.k = off_ll + off_nl + 6;
 		i++;
 		/* X = sizeof(struct ip6_hdr) */
 		s[i] = new_stmt(BPF_LDX|BPF_IMM);
@@ -4270,7 +4311,7 @@
 		i++;
 		/* A = P[X + packet head] */
 		s[i] = new_stmt(BPF_LD|BPF_IND|BPF_B);
-		s[i]->s.k = off_nl;
+		s[i]->s.k = off_ll + off_nl;
 		i++;
 		/* MEM[reg2] = A */
 		s[i] = new_stmt(BPF_ST);
@@ -4288,7 +4329,7 @@
 		i++;
 		/* A = P[X + packet head]; */
 		s[i] = new_stmt(BPF_LD|BPF_IND|BPF_B);
-		s[i]->s.k = off_nl;
+		s[i]->s.k = off_ll + off_nl;
 		i++;
 		/* A += 1 */
 		s[i] = new_stmt(BPF_ALU|BPF_ADD|BPF_K);
@@ -4347,7 +4388,7 @@
 	i++;
 	/* A = P[X + packet head]; */
 	s[i] = new_stmt(BPF_LD|BPF_IND|BPF_B);
-	s[i]->s.k = off_nl;
+	s[i]->s.k = off_ll + off_nl;
 	i++;
 	/* MEM[reg2] = A */
 	s[i] = new_stmt(BPF_ST);
@@ -4365,7 +4406,7 @@
 	i++;
 	/* A = P[X + packet head] */
 	s[i] = new_stmt(BPF_LD|BPF_IND|BPF_B);
-	s[i]->s.k = off_nl;
+	s[i]->s.k = off_ll + off_nl;
 	i++;
 	/* A += 2 */
 	s[i] = new_stmt(BPF_ALU|BPF_ADD|BPF_K);
@@ -5386,11 +5427,14 @@
 
 		/*
 		 * Load the item at the sum of the offset we've put in the
-		 * X register and the offset of the start of the network
-		 * layer header.
+		 * X register, the offset of the start of the network
+		 * layer header, and the offset of the start of the link
+		 * layer header (which is 0 if the radio header is
+		 * variable-length; that header length is what we put
+		 * into the X register and then added to the index).
 		 */
 		tmp = new_stmt(BPF_LD|BPF_IND|size);
-		tmp->s.k = off_nl;
+		tmp->s.k = off_ll + off_nl;
 		sappend(s, tmp);
 		sappend(index->s, s);
 
@@ -5415,6 +5459,11 @@
 		/*
 		 * The offset is relative to the beginning of
 		 * the transport-layer header.
+		 *
+		 * Load the X register with the length of the IPv4 header
+		 * (plus the offset of the link-layer header, if it's
+		 * a variable-length header), in bytes.
+		 *
 		 * XXX - are there any cases where we want
 		 * off_nl_nosnap?
 		 * XXX - we should, if we're built with
@@ -5424,22 +5473,24 @@
 		s = gen_loadx_iphdrlen();
 
 		/*
-		 * The X register now contains the sum of the offset
-		 * of the beginning of the link-layer header and
-		 * the length of the network-layer header.  Load
-		 * into the A register the offset relative to
+		 * The X register now contains the sum of the length
+		 * of any variable-length header preceding the link-layer
+		 * header and the length of the network-layer header.
+		 * Load into the A register the offset relative to
 		 * the beginning of the transport layer header,
 		 * add the X register to that, move that to the
 		 * X register, and load with an offset from the
 		 * X register equal to the offset of the network
 		 * layer header relative to the beginning of
-		 * the link-layer header.
+		 * the link-layer header plus the length of any
+		 * fixed-length header preceding the link-layer
+		 * header.
 		 */
 		sappend(s, xfer_to_a(index));
 		sappend(s, new_stmt(BPF_ALU|BPF_ADD|BPF_X));
 		sappend(s, new_stmt(BPF_MISC|BPF_TAX));
 		sappend(s, tmp = new_stmt(BPF_LD|BPF_IND|size));
-		tmp->s.k = off_nl;
+		tmp->s.k = off_ll + off_nl;
 		sappend(index->s, s);
 
 		/*


Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/tcpdump/FC-6/.cvsignore,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- .cvsignore	10 Nov 2005 13:46:36 -0000	1.11
+++ .cvsignore	17 Nov 2006 09:24:31 -0000	1.12
@@ -9,3 +9,4 @@
 libpcap-0.9.3.tar.gz
 tcpdump-3.9.4.tar.gz
 libpcap-0.9.4.tar.gz
+ethercodes-2.1a15.dat.bz2


Index: sources
===================================================================
RCS file: /cvs/dist/rpms/tcpdump/FC-6/sources,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- sources	10 Nov 2005 13:46:36 -0000	1.11
+++ sources	17 Nov 2006 09:24:31 -0000	1.12
@@ -3,3 +3,4 @@
 6e65ea04ab6773c937986098028c8f21  rpc.tar.gz
 4b64755bbc8ba1af49c747271a6df5b8  tcpdump-3.9.4.tar.gz
 79025766e8027df154cb1f32de8a7974  libpcap-0.9.4.tar.gz
+4df4ce9cfedcc0bac894dfac61190f89  ethercodes-2.1a15.dat.bz2


Index: tcpdump.spec
===================================================================
RCS file: /cvs/dist/rpms/tcpdump/FC-6/tcpdump.spec,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- tcpdump.spec	12 Jul 2006 08:26:27 -0000	1.55
+++ tcpdump.spec	17 Nov 2006 09:24:31 -0000	1.56
@@ -2,8 +2,8 @@
 %define PCAP_UID 77
 %define PCAP_GID 77
 
-%define releaseno        8
-%define arpwatch_release 15.%{releaseno}
+%define releaseno        9%{?dist}
+%define arpwatch_release 16%{?dist}
 %define pcap_release %{releaseno}
 %define tcpdump_release %{releaseno}
 
@@ -19,7 +19,7 @@
 Version: %{tcpdump_version}
 %define	tcpdump_dir	tcpdump-%{tcpdump_version}
 %define tcpslice_dir	tcpslice
-Release: %{tcpdump_release}.1
+Release: %{tcpdump_release}
 
 # XXX epoch is necessary to obsolete tcpdump-3.4a5
 Epoch: 14
@@ -34,6 +34,7 @@
 Source4: tcpslice-CVS.20010207.tar.gz
 Source5: arpwatch.sysconfig
 Source6: rpc.tar.gz
+Source7: ethercodes-2.1a15.dat.bz2
 
 Patch5:  tcpdump-3.6.2-tcpslice-time.patch
 Patch7:  tcpdump-3.9.1-redhat.patch
@@ -51,11 +52,12 @@
 Patch39: arpwatch-drop-man.patch
 Patch41: arpwatch-addr.patch
 Patch42: arpwatch-dir-man.patch
-Patch43: arpwatch-ethcodes.patch.bz2
+Patch43: arpwatch-arp2ethers.patch
 
 Patch50: libpcap-shared.patch
 Patch52: tcpdump-3.7.2-s390.patch
 Patch53: libpcap-0.8.3-ppp.patch
+Patch54: libpcap-0.9.4-off_ll.patch
 
 Patch70: tcpslice-CVS.20010207-bpf.patch
 
@@ -77,13 +79,12 @@
 # if you change the Version, don't forget to edit libpcap-shared.patch
 # could be sed'd automatically
 Version: %{pcap_version}
-Release: %{pcap_release}.1
+Release: %{pcap_release}
 %define	libpcap_dir	libpcap-%{pcap_version}
 Summary: A system-independent interface for user-level packet capture.
 Group: Development/Libraries
 License: BSD
 URL: http://www.tcpdump.org
-Requires: openssl
 
 %description -n libpcap
 Libpcap provides a portable framework for low-level network
@@ -99,7 +100,7 @@
 
 %package -n libpcap-devel
 Version: %{pcap_version}
-Release: %{pcap_release}.1
+Release: %{pcap_release}
 Summary: A pcap library.
 Group: Development/Libraries
 License: BSD
@@ -120,7 +121,7 @@
  
 %package -n arpwatch
 Version: 2.1a13
-Release: %{arpwatch_release}.1
+Release: %{arpwatch_release}
 %define	arpwatch_dir	arpwatch-2.1a13
 Summary: Network monitoring tools for tracking IP addresses on a network.
 Group: Applications/System
@@ -149,6 +150,7 @@
 %patch50 -p1 -b .shared 
 %patch52 -p1 -b .s390
 %patch53 -p0 -b .ppp
+%patch54 -p1 -b .off_ll
 popd
 
 pushd %tcpdump_dir
@@ -169,7 +171,9 @@
 %patch39 -p0 -b .droprootman
 %patch41 -p1 -b .mailuser
 %patch42 -p1 -b .dirman
-%patch43 -p1
+%patch43 -p1 -b .arp2ethers
+bzip2 -dc %{SOURCE7} > ethercodes.dat
+> missingcodes.txt
 popd
 
 pushd tcpslice
@@ -313,13 +317,13 @@
 %defattr(-,root,root)
 %doc	%libpcap_dir/LICENSE %libpcap_dir/README %libpcap_dir/CHANGES
 %{_libdir}/libpcap.so.*
-%{_mandir}/man3/pcap.3*
 
 %files -n libpcap-devel
 %defattr(-,root,root)
 %{_includedir}/*
 %{_libdir}/libpcap.so
 %{_libdir}/libpcap.a
+%{_mandir}/man3/pcap.3*
 
 %files -n arpwatch
 %defattr(-,root,root)
@@ -342,6 +346,12 @@
 %{_vararpwatch}/massagevendor-old
 
 %changelog
+* Fri Nov 17 2006 Miroslav Lichvar <mlichvar at redhat.com> - 14:3.9.4-9
+- fix processing of Prism and AVS headers (#206686)
+- fix arp2ethers script
+- update ethercodes.dat
+- move pcap man page to devel package
+
 * Wed Jul 12 2006 Jesse Keating <jkeating at redhat.com> - 14:3.9.4-8.1
 - rebuild
 


--- arpwatch-ethcodes.patch.bz2 DELETED ---




More information about the fedora-cvs-commits mailing list