- update to 3.9.8
- don't use gethostbyaddr - fix default user in man page
This commit is contained in:
parent
913d20d77c
commit
0b97fc6175
@ -1,2 +1,2 @@
|
||||
tcpslice-1.2a3.tar.gz
|
||||
tcpdump-3.9.7.tar.gz
|
||||
tcpdump-3.9.8.tar.gz
|
||||
|
2
sources
2
sources
@ -1,2 +1,2 @@
|
||||
e329cbeb7e589f132d92c3447c477190 tcpslice-1.2a3.tar.gz
|
||||
2aacf4dc9a3bc500a8b4f3887a32cdd5 tcpdump-3.9.7.tar.gz
|
||||
c491a78c52fe73f1f7271aa5d8c6ab2e tcpdump-3.9.8.tar.gz
|
||||
|
@ -38,7 +38,7 @@
|
||||
.IR user .
|
||||
.IP
|
||||
-This behavior can also be enabled by default at compile time.
|
||||
+This behavior is enabled by default (\fB\-Z pcap\fR), and can
|
||||
+This behavior is enabled by default (\fB\-Z tcpdump\fR), and can
|
||||
+be disabled by \fB\-Z root\fR.
|
||||
+
|
||||
.IP "\fI expression\fP"
|
||||
|
93
tcpdump-3.9.8-gethostby.patch
Normal file
93
tcpdump-3.9.8-gethostby.patch
Normal file
@ -0,0 +1,93 @@
|
||||
diff -up tcpdump-3.9.8/addrtoname.c.gethostby tcpdump-3.9.8/addrtoname.c
|
||||
--- tcpdump-3.9.8/addrtoname.c.gethostby 2007-10-24 14:50:28.000000000 +0200
|
||||
+++ tcpdump-3.9.8/addrtoname.c 2007-10-24 16:58:04.000000000 +0200
|
||||
@@ -225,7 +225,6 @@ static u_int32_t f_localnet;
|
||||
const char *
|
||||
getname(const u_char *ap)
|
||||
{
|
||||
- register struct hostent *hp;
|
||||
u_int32_t addr;
|
||||
static struct hnamemem *p; /* static for longjmp() */
|
||||
|
||||
@@ -247,6 +246,28 @@ getname(const u_char *ap)
|
||||
*/
|
||||
if (!nflag &&
|
||||
(addr & f_netmask) == f_localnet) {
|
||||
+#ifdef HAVE_GETNAMEINFO
|
||||
+ struct sockaddr_in sa;
|
||||
+ char hbuf[NI_MAXHOST];
|
||||
+
|
||||
+ memset(&sa, 0, sizeof (sa));
|
||||
+ sa.sin_family = AF_INET;
|
||||
+ sa.sin_addr.s_addr = addr;
|
||||
+ if (!getnameinfo((struct sockaddr *)&sa, sizeof (sa),
|
||||
+ hbuf, sizeof (hbuf), NULL, 0, 0)) {
|
||||
+ if (Nflag) {
|
||||
+ char *dotp;
|
||||
+
|
||||
+ /* Remove domain qualifications */
|
||||
+ dotp = strchr(hbuf, '.');
|
||||
+ if (dotp)
|
||||
+ *dotp = '\0';
|
||||
+ }
|
||||
+ p->name = strdup(hbuf);
|
||||
+ return p->name;
|
||||
+ }
|
||||
+#else
|
||||
+ register struct hostent *hp;
|
||||
hp = gethostbyaddr((char *)&addr, 4, AF_INET);
|
||||
if (hp) {
|
||||
char *dotp;
|
||||
@@ -260,6 +281,7 @@ getname(const u_char *ap)
|
||||
}
|
||||
return (p->name);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
p->name = strdup(intoa(addr));
|
||||
return (p->name);
|
||||
@@ -273,7 +295,6 @@ getname(const u_char *ap)
|
||||
const char *
|
||||
getname6(const u_char *ap)
|
||||
{
|
||||
- register struct hostent *hp;
|
||||
struct in6_addr addr;
|
||||
static struct h6namemem *p; /* static for longjmp() */
|
||||
register const char *cp;
|
||||
@@ -292,6 +313,28 @@ getname6(const u_char *ap)
|
||||
* Do not print names if -n was given.
|
||||
*/
|
||||
if (!nflag) {
|
||||
+#ifdef HAVE_GETNAMEINFO
|
||||
+ struct sockaddr_in6 sa;
|
||||
+ char hbuf[NI_MAXHOST];
|
||||
+
|
||||
+ memset(&sa, 0, sizeof (sa));
|
||||
+ sa.sin6_family = AF_INET6;
|
||||
+ sa.sin6_addr = addr;
|
||||
+ if (!getnameinfo((struct sockaddr *)&sa, sizeof (sa),
|
||||
+ hbuf, sizeof (hbuf), NULL, 0, 0)) {
|
||||
+ if (Nflag) {
|
||||
+ char *dotp;
|
||||
+
|
||||
+ /* Remove domain qualifications */
|
||||
+ dotp = strchr(hbuf, '.');
|
||||
+ if (dotp)
|
||||
+ *dotp = '\0';
|
||||
+ }
|
||||
+ p->name = strdup(hbuf);
|
||||
+ return p->name;
|
||||
+ }
|
||||
+#else
|
||||
+ register struct hostent *hp;
|
||||
hp = gethostbyaddr((char *)&addr, sizeof(addr), AF_INET6);
|
||||
if (hp) {
|
||||
char *dotp;
|
||||
@@ -305,6 +348,7 @@ getname6(const u_char *ap)
|
||||
}
|
||||
return (p->name);
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
cp = inet_ntop(AF_INET6, &addr, ntop_buf, sizeof(ntop_buf));
|
||||
p->name = strdup(cp);
|
13
tcpdump.spec
13
tcpdump.spec
@ -1,8 +1,8 @@
|
||||
Summary: A network traffic monitoring tool
|
||||
Name: tcpdump
|
||||
Epoch: 14
|
||||
Version: 3.9.7
|
||||
Release: 5%{?dist}
|
||||
Version: 3.9.8
|
||||
Release: 1%{?dist}
|
||||
License: BSD with advertising
|
||||
URL: http://www.tcpdump.org
|
||||
Group: Applications/Internet
|
||||
@ -18,6 +18,7 @@ Patch3: tcpdump-3.9.7-crypto.patch
|
||||
Patch4: tcpdump-3.9.7-ikev2.patch
|
||||
Patch5: tcpslice-1.2a3-time.patch
|
||||
Patch6: tcpslice-CVS.20010207-bpf.patch
|
||||
Patch7: tcpdump-3.9.8-gethostby.patch
|
||||
|
||||
%define tcpslice_dir tcpslice-1.2a3
|
||||
|
||||
@ -36,6 +37,7 @@ Install tcpdump if you need a program to monitor network traffic.
|
||||
%patch2 -p1 -b .portnumbers
|
||||
%patch3 -p1 -b .crypto
|
||||
%patch4 -p1 -b .ikev2
|
||||
%patch7 -p1 -b .gethostby
|
||||
|
||||
pushd %{tcpslice_dir}
|
||||
%patch5 -p1 -b .time
|
||||
@ -47,7 +49,7 @@ find . -name '*.c' -o -name '*.h' | xargs chmod 644
|
||||
%build
|
||||
export CFLAGS="$RPM_OPT_FLAGS $(getconf LFS_CFLAGS)"
|
||||
|
||||
pushd %tcpslice_dir
|
||||
pushd %{tcpslice_dir}
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
popd
|
||||
@ -91,6 +93,11 @@ exit 0
|
||||
%{_mandir}/man8/tcpdump.8*
|
||||
|
||||
%changelog
|
||||
* Wed Oct 24 2007 Miroslav Lichvar <mlichvar@redhat.com> - 14:3.9.8-1
|
||||
- update to 3.9.8
|
||||
- don't use gethostbyaddr
|
||||
- fix default user in man page
|
||||
|
||||
* Tue Sep 18 2007 Miroslav Lichvar <mlichvar@redhat.com> - 14:3.9.7-5
|
||||
- support decoding IKEv2 packets
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user