--- dhcpdump-1.8.orig/CHANGES +++ dhcpdump-1.8/CHANGES @@ -2,6 +2,7 @@ version 1.8 - Use pcap instead of tcpdump output + - Remove support for autofoo version 1.7 - Support for tcpdump 3.8.x --- dhcpdump-1.8.orig/debian/NMU-Disclaimer +++ dhcpdump-1.8/debian/NMU-Disclaimer @@ -0,0 +1,45 @@ +Non Maintainer Upload of this Package +------------------------------------- + +If you plan to work on an NMU for this package, read the following +closely. It can save you and me some grief. + + 1. At first, contact the maintainer (i.e. send a mail to + joey@debian.org, do not cc or bounce a mail, send a plain mail, + not copied to any mailing list or the BTS) and ask about the + status of the bug you are considering to work on. + + 2. In this mail include all information relevant for this problem, + i.e. include a description of the bug and not only its bug + number. + + 3. If the maintainer is not able or willing to fix the problem or + does not respond within four days, continue with step 4. + + 4. Work on the bug and prepare a patch. Do not upload into the + Debian archive. + + 5. Send the entire patch, together with enough explanations, to the + maintainer for reviewing and ask him for permission of an NMU + using this patch. + + 6. IF AND ONLY IF the maintainer approves the patch (or doesn't + respond within four days), upload the NMU to the incoming + directory and send the patch to the BTS. If the NMU is not + approved, go back to 4. or add the NMU to your homepage, but do + not upload it to the Debian archive. + + 7. Properly sized and well-written patches sent to the BTS are always + appreciated, even if they are rejected later. They demonstrate a + potential solution which could probably improved into a real + solution. + + 8. NEVER change the way a package is maintained in an NMU, i.e. don't + remove dh_* stuff or switch to dh_* respectively. This rule + applies to all NMU's, not only to an NMU for this package. + +These rules always apply. They even apply if somebody declares NMUs +as ok and reduces regular NMU rules to a delay of zero days. Unless +I'm on vacation or on a show I am reachable via mail, so there is +hardly a reason not to contact me. + --- dhcpdump-1.8.orig/debian/changelog +++ dhcpdump-1.8/debian/changelog @@ -0,0 +1,89 @@ +dhcpdump (1.8-2.2) unstable; urgency=medium + + * Non-maintainer upload. + * Upload to unstable + + -- Manuel A. Fernandez Montecelo Tue, 18 Apr 2017 14:50:01 +0200 + +dhcpdump (1.8-2.1) experimental; urgency=low + + [ Manuel A. Fernandez Montecelo ] + * Non-maintainer upload. + + [ Svante Signell ] + * Fix to make dhcpdump build on GNU/Hurd (Closes: #622267) + - modified by mafm@d.o to support kFreeBSD arches + + [ Chris Lamb ] + * Fix for reproducible builds (Closes: #777309) + + [ Helmut Grohne ] + * Fix FTCBFS: use the host arch compiler (Closes: #793893) + + -- Manuel A. Fernandez Montecelo Thu, 13 Apr 2017 17:34:33 +0200 + +dhcpdump (1.8-2) unstable; urgency=low + + * Bump standards-version + * Added missing build depends against libpcap (closes: Bug#488816) + + -- Joey Schulze Wed, 02 Jul 2008 13:22:21 +0200 + +dhcpdump (1.8-1) unstable; urgency=low + + * Incorporate NMU by Amaya Rodrigo Sastre, thanks a lot + * New upstream version + . Moved manpage into section 8 + * Fixed typo in NMU-Disclaimer, thanks to Petter Reinholdtsen (See: + Bug#225895) + * Added support for the nostrip option (closes: Bug#436762) + * Added support for debug compilation + * Forward ported patch by Olivier Chirossel + to display option 82 (Relay Agent Information) with two sub-options + (closes: Bug#317440) + + -- Joey Schulze Sat, 28 Jun 2008 13:52:32 +0200 + +dhcpdump (1.7-1) unstable; urgency=low + + * New upstream version + - Support for tcpdump 3.8.x + + -- Martin Schulze Mon, 6 Mar 2006 09:07:15 +0100 + +dhcpdump (1.6-1) unstable; urgency=low + + * New upstream version + * Applied rewritten patch so that dhcpdump can parse newstyle tcpdump + output as well (closes: Bug#255556) + + -- Martin Schulze Sun, 7 Nov 2004 15:59:13 +0100 + +dhcpdump (1.4-2) unstable; urgency=low + + * Added a note about the packages' cvs directory + + -- Martin Schulze Sun, 7 Nov 2004 15:14:29 +0100 + +dhcpdump (1.4-1) unstable; urgency=low + + * Added a disclaimer for those people who plan to NMU this package + * New upstream version + * Corrected highlight of references in manpage + * Added support for auto-configure script + * Corrected spelling error in manpage + + -- Martin Schulze Tue, 12 Feb 2002 09:55:57 +0100 + +dhcpdump (1.3-2) unstable; urgency=low + + * Whoops, forgot to add the postinst and prerm scripts + * Added -isp to dpkg-gencontrol + + -- Martin Schulze Sat, 8 Dec 2001 15:27:02 +0100 + +dhcpdump (1.3-1) unstable; urgency=low + + * Initial version + + -- Martin Schulze Sun, 18 Nov 2001 20:32:34 +0100 --- dhcpdump-1.8.orig/debian/control +++ dhcpdump-1.8/debian/control @@ -0,0 +1,13 @@ +Source: dhcpdump +Section: admin +Priority: optional +Maintainer: Joey Schulze +Build-Depends: libpcap0.8-dev +Standards-Version: 3.8.0.1 + +Package: dhcpdump +Architecture: any +Depends: ${shlibs:Depends}, tcpdump +Description: Parse DHCP packets from tcpdump + This package provides a tool for visualization of DHCP packets as + recorded and output by tcpdump to analyze DHCP server responses. --- dhcpdump-1.8.orig/debian/copyright +++ dhcpdump-1.8/debian/copyright @@ -0,0 +1,14 @@ +This is the Debian GNU prepackaged version of dhcpdump, an +administrative tool visualization of DHCP packets. + +The source of the Debian package is managed through CVS. It is publically +available at or as +<:pserver:anonymous@cvs.infodrom.org/var/cvs/debian/dhcpdump/>. + +This package was put together by Martin Schulze , +from sources obtained from: + + http://www.mavetju.org/download/dhcpdump-1.4.tar.gz + +dhcpdump has been released under the BSD license as quoted below. + --- dhcpdump-1.8.orig/debian/rules +++ dhcpdump-1.8/debian/rules @@ -0,0 +1,114 @@ +#! /usr/bin/make -f + +# Copyright 1994-99,2001 joey@infodrom.org (Martin Schulze) +# +# 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; version 2 dated June, 1991. +# +# 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 program; if not, write to the Free Software +# Foundation Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA +# +SHELL=/bin/bash + +DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +# The name and version of the source +# +source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g') +package = $(shell grep "^Package: " debian/control|head -1|sed 's/Package: \(.*\)/\1/g') +version = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g') +revision = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*([^\-]*\-\(.*\)).*/\1/g') + +installbin = install -g root -o root -m 755 +installdoc = install -g root -o root -m 644 + +# support non-Linux arches, see #622267 +EXTRAFLAG = $(shell dpkg-architecture -ilinux-any || echo "-D_BSD_SOURCE") + +ifeq ($(origin CC),default) +CC = $(DEB_HOST_GNU_TYPE)-gcc +endif + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +CFLAGS = -g -O2 -Wall +else +CFLAGS = -O2 -Wall +endif +STRIP = $(DEB_HOST_GNU_TYPE)-strip +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +STRIP = : strip +endif + +build: + $(MAKE) CC=$(CC) CFLAGS="$(CFLAGS) $(EXTRAFLAG) -DHAVE_STRSEP" + touch stamp-build + cat debian/copyright LICENSE > copyright.txt + +clean: debclean + rm -f stamp-build + $(MAKE) clean + rm -rf *~ copyright.txt + +debclean: +# Cleans debian binary directories to allow binary creation + rm -rf debian/tmp + rm -f debian/{files,substvars} + +binary-indep: +# Nothing to be done here + +binary-arch: debclean + test -f stamp-build || $(MAKE) -f debian/rules build + $(installbin) -d debian/tmp/DEBIAN + chown -R root.root debian/tmp + chmod -R g-ws debian/tmp + $(installbin) -d debian/tmp/usr/share/doc/$(package) + $(installdoc) debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian + # + $(installdoc) copyright.txt debian/tmp/usr/share/doc/$(package)/copyright + gzip -9nf debian/tmp/usr/share/doc/$(package)/changelog.Debian + # + $(installbin) -d debian/tmp/usr/sbin + $(STRIP) dhcpdump + $(installbin) dhcpdump debian/tmp/usr/sbin + # + $(installbin) -d debian/tmp/usr/share/man/man8 + $(installdoc) dhcpdump.8 debian/tmp/usr/share/man/man8 + gzip -9n debian/tmp/usr/share/man/man?/* + # + dpkg-shlibdeps debian/tmp/usr/sbin/dhcpdump + dpkg-gencontrol -isp + dpkg --build debian/tmp .. + +binary: binary-indep binary-arch + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b' or dsc; false + +dsc: + -test -d debian/tmp && $(MAKE) -f debian/rules clean + if [ ! -f ../$(source)_$(version).orig.tar.gz -a -f ../orig/$(source)_$(version).orig.tar.gz ]; \ + then \ + ln -s orig/$(source)_$(version).orig.tar.gz ../$(source)_$(version).orig.tar.gz; \ + touch /tmp/stamp-$(source)-link; \ + fi; \ + cd .. && dpkg-source -b $(source)-$(version) + if [ -f /tmp/stamp-$(source)-link ]; then \ + rm ../$(source)_$(version).orig.tar.gz /tmp/stamp-$(source)-link; \ + fi + +checkroot: + $(checkdir) + test root = "`whoami`" + +dist: binary dsc + +.PHONY: binary binary-arch binary-indep clean checkroot + --- dhcpdump-1.8.orig/dhcpdump.c +++ dhcpdump-1.8/dhcpdump.c @@ -16,11 +16,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -38,11 +40,11 @@ #define LARGESTRING 1024 // header variables -u_char timestamp[40]; // timestamp on header -u_char mac_origin[40]; // mac address of origin -u_char mac_destination[40]; // mac address of destination -u_char ip_origin[40]; // ip address of origin -u_char ip_destination[40]; // ip address of destination +char timestamp[40]; // timestamp on header +char mac_origin[40]; // mac address of origin +char mac_destination[40]; // mac address of destination +char ip_origin[40]; // ip address of origin +char ip_destination[40]; // ip address of destination int max_data_len; // maximum size of a packet int tcpdump_style = -1; @@ -160,13 +162,21 @@ strcpy(mac_destination, ether_ntoa((struct ether_addr *)eh->ether_dhost)); - strcpy(ip_origin, (u_char *)inet_ntoa(ip->ip_src)); - strcpy(ip_destination, (u_char *)inet_ntoa(ip->ip_dst)); + strcpy(ip_origin, (char *)inet_ntoa(ip->ip_src)); + strcpy(ip_destination, (char *)inet_ntoa(ip->ip_dst)); +#ifdef __linux__ + if (hmask && check_ch((u_char *)(sp + offset), ntohs(udp->len))) + return; + + printdata((u_char *)(sp + offset), ntohs(udp->len)); +#else if (hmask && check_ch((u_char *)(sp + offset), ntohs(udp->uh_ulen))) return; printdata((u_char *)(sp + offset), ntohs(udp->uh_ulen)); +#endif + } // check for matching CHADDR (Peter Apian-Bennewitz ) @@ -301,7 +311,7 @@ // print the header and the options. int printdata(u_char *data, int data_len) { int j, i; - u_char buf[LARGESTRING]; + char buf[LARGESTRING]; if (data_len == 0) return 0; @@ -364,7 +374,7 @@ case 60: // Domain name case 86: // NDS Tree name case 87: // NDS context - strncpy(buf, &data[j + 2], data[j + 1]); + strncpy(buf, (char *)&data[j + 2], data[j + 1]); buf[data[j + 1]] = 0; printf("%s", buf); break; @@ -510,7 +520,7 @@ printf("-"); print8bits(data + j + 4); printf(" "); - strncpy(buf, &data[j + 5], data[j + 1] - 3); + strncpy(buf, (char *)&data[j + 5], data[j + 1] - 3); buf[data[j + 1] - 3]=0; printf("%s", buf); break; @@ -518,6 +528,9 @@ case 82: // Relay Agent Information printf("\n"); for (i = j + 2; i < j + data[j + 1]; ) { + if (i != j+2) { + printf("\n"); + } printf("%-17s %-13s ", " ", data[i] > sizeof(relayagent_suboptions) ? "*wrong value*" : @@ -527,7 +540,7 @@ break; } printHexColon(data + i + 2, data[i + 1]); - i += data[i + 1]; + i += data[i + 1] + 2; } break;