Gentoo Archives: gentoo-commits

From: "Thilo Bangert (bangert)" <bangert@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-analyzer/dhcpdump/files: dhcpdump-1.8-Makefile.patch dhcpdump-1.8-debian.patch
Date: Tue, 04 Nov 2008 19:38:45
Message-Id: E1KxRje-0005OQ-Eo@stork.gentoo.org
1 bangert 08/11/04 19:38:42
2
3 Added: dhcpdump-1.8-Makefile.patch
4 dhcpdump-1.8-debian.patch
5 Log:
6 version bump and warning fixes by Jeroen Roovers - bug #244388
7 (Portage version: 2.1.4.5)
8
9 Revision Changes Path
10 1.1 net-analyzer/dhcpdump/files/dhcpdump-1.8-Makefile.patch
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/dhcpdump/files/dhcpdump-1.8-Makefile.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/dhcpdump/files/dhcpdump-1.8-Makefile.patch?rev=1.1&content-type=text/plain
14
15 Index: dhcpdump-1.8-Makefile.patch
16 ===================================================================
17 --- Makefile.orig 2008-06-24 05:26:52.000000000 +0200
18 +++ Makefile 2008-10-26 01:22:32.000000000 +0200
19 @@ -1,6 +1,6 @@
20 -CFLAGS= -Wall -g
21 -LDFLAGS= -g
22 -LIBS= -lpcap
23 +#CFLAGS = -Wall -g
24 +#LDFLAGS = -g
25 +LIBS = -lpcap
26
27 all: dhcpdump dhcpdump.8
28
29 @@ -15,7 +15,7 @@
30 dhcpdump.pod dhcpdump.8
31
32 dhcpdump: dhcpdump.o
33 - ${CC} ${LDFLAGS} -o $@ dhcpdump.o ${LIBS}
34 + $(CC) -DHAVE_STRSEP $(LDFLAGS) -o $@ dhcpdump.o $(LIBS)
35
36 dhcpdump.o: dhcpdump.c dhcp_options.h Makefile
37 - ${CC} ${CFLAGS} -c -o $@ dhcpdump.c
38 + $(CC) -DHAVE_STRSEP $(CFLAGS) -c -o $@ dhcpdump.c
39
40
41
42 1.1 net-analyzer/dhcpdump/files/dhcpdump-1.8-debian.patch
43
44 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/dhcpdump/files/dhcpdump-1.8-debian.patch?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/dhcpdump/files/dhcpdump-1.8-debian.patch?rev=1.1&content-type=text/plain
46
47 Index: dhcpdump-1.8-debian.patch
48 ===================================================================
49 --- dhcpdump-1.8.orig/dhcpdump.c
50 +++ dhcpdump-1.8/dhcpdump.c
51 @@ -16,11 +16,13 @@
52 #include <netinet/in.h>
53 #include <netinet/ip.h>
54 #include <netinet/udp.h>
55 +#include <netinet/ether.h>
56 #include <arpa/inet.h>
57 #include <stdio.h>
58 #include <stdlib.h>
59 #include <string.h>
60 #include <ctype.h>
61 +#include <time.h>
62 #include <pcap.h>
63 #include <err.h>
64 #include <regex.h>
65 @@ -38,11 +40,11 @@
66 #define LARGESTRING 1024
67
68 // header variables
69 -u_char timestamp[40]; // timestamp on header
70 -u_char mac_origin[40]; // mac address of origin
71 -u_char mac_destination[40]; // mac address of destination
72 -u_char ip_origin[40]; // ip address of origin
73 -u_char ip_destination[40]; // ip address of destination
74 +char timestamp[40]; // timestamp on header
75 +char mac_origin[40]; // mac address of origin
76 +char mac_destination[40]; // mac address of destination
77 +char ip_origin[40]; // ip address of origin
78 +char ip_destination[40]; // ip address of destination
79 int max_data_len; // maximum size of a packet
80
81 int tcpdump_style = -1;
82 @@ -160,13 +162,21 @@
83 strcpy(mac_destination,
84 ether_ntoa((struct ether_addr *)eh->ether_dhost));
85
86 - strcpy(ip_origin, (u_char *)inet_ntoa(ip->ip_src));
87 - strcpy(ip_destination, (u_char *)inet_ntoa(ip->ip_dst));
88 + strcpy(ip_origin, (char *)inet_ntoa(ip->ip_src));
89 + strcpy(ip_destination, (char *)inet_ntoa(ip->ip_dst));
90
91 +#ifdef __linux__
92 + if (hmask && check_ch((u_char *)(sp + offset), ntohs(udp->len)))
93 + return;
94 +
95 + printdata((u_char *)(sp + offset), ntohs(udp->len));
96 +#else
97 if (hmask && check_ch((u_char *)(sp + offset), ntohs(udp->uh_ulen)))
98 return;
99
100 printdata((u_char *)(sp + offset), ntohs(udp->uh_ulen));
101 +#endif
102 +
103 }
104
105 // check for matching CHADDR (Peter Apian-Bennewitz <apian@×××××××.de>)
106 @@ -301,7 +311,7 @@
107 // print the header and the options.
108 int printdata(u_char *data, int data_len) {
109 int j, i;
110 - u_char buf[LARGESTRING];
111 + char buf[LARGESTRING];
112
113 if (data_len == 0)
114 return 0;
115 @@ -364,7 +374,7 @@
116 case 60: // Domain name
117 case 86: // NDS Tree name
118 case 87: // NDS context
119 - strncpy(buf, &data[j + 2], data[j + 1]);
120 + strncpy(buf, (char *)&data[j + 2], data[j + 1]);
121 buf[data[j + 1]] = 0;
122 printf("%s", buf);
123 break;
124 @@ -510,7 +520,7 @@
125 printf("-");
126 print8bits(data + j + 4);
127 printf(" ");
128 - strncpy(buf, &data[j + 5], data[j + 1] - 3);
129 + strncpy(buf, (char *)&data[j + 5], data[j + 1] - 3);
130 buf[data[j + 1] - 3]=0;
131 printf("%s", buf);
132 break;
133 @@ -518,6 +528,9 @@
134 case 82: // Relay Agent Information
135 printf("\n");
136 for (i = j + 2; i < j + data[j + 1]; ) {
137 + if (i != j+2) {
138 + printf("\n");
139 + }
140 printf("%-17s %-13s ", " ",
141 data[i] > sizeof(relayagent_suboptions) ?
142 "*wrong value*" :
143 @@ -527,7 +540,7 @@
144 break;
145 }
146 printHexColon(data + i + 2, data[i + 1]);
147 - i += data[i + 1];
148 + i += data[i + 1] + 2;
149 }
150 break;