summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2016-01-15 03:03:07 +0000
committermmcc <mmcc@openbsd.org>2016-01-15 03:03:07 +0000
commit540987945433cba8f7f7bf2e515b994fc9cc42ba (patch)
treeb163d1fc1625a0dd474f1b20f1ca9eeaa864871a
parentrs_malloc() does not need to be cast (diff)
downloadwireguard-openbsd-540987945433cba8f7f7bf2e515b994fc9cc42ba.tar.xz
wireguard-openbsd-540987945433cba8f7f7bf2e515b994fc9cc42ba.zip
Remove preprocessor conditions (checking for ancient OSs) that try to
divine whether a file handle was generated on the current host. More simplifications to come. supported by deraadt@
-rw-r--r--usr.sbin/tcpdump/nfsfh.h4
-rw-r--r--usr.sbin/tcpdump/parsenfsfh.c37
-rw-r--r--usr.sbin/tcpdump/print-nfs.c4
3 files changed, 7 insertions, 38 deletions
diff --git a/usr.sbin/tcpdump/nfsfh.h b/usr.sbin/tcpdump/nfsfh.h
index 8b24e2cdd78..656ff158bd6 100644
--- a/usr.sbin/tcpdump/nfsfh.h
+++ b/usr.sbin/tcpdump/nfsfh.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsfh.h,v 1.8 2001/06/15 01:11:26 itojun Exp $ */
+/* $OpenBSD: nfsfh.h,v 1.9 2016/01/15 03:03:07 mmcc Exp $ */
/*
* Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation,
@@ -64,4 +64,4 @@ typedef struct {
#define fsid_eq(a,b) ((a.fsid_code == b.fsid_code) &&\
dev_eq(a.Fsid_dev, b.Fsid_dev))
-extern void Parse_fh(caddr_t *, my_fsid *, ino_t *, char **, char **, int);
+extern void Parse_fh(caddr_t *, my_fsid *, ino_t *, char **, char **);
diff --git a/usr.sbin/tcpdump/parsenfsfh.c b/usr.sbin/tcpdump/parsenfsfh.c
index e2918378b8f..03b414add9b 100644
--- a/usr.sbin/tcpdump/parsenfsfh.c
+++ b/usr.sbin/tcpdump/parsenfsfh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parsenfsfh.c,v 1.12 2015/11/18 15:36:20 mmcc Exp $ */
+/* $OpenBSD: parsenfsfh.c,v 1.13 2016/01/15 03:03:07 mmcc Exp $ */
/*
* Copyright (c) 1993, 1994 Jeffrey C. Mogul, Digital Equipment Corporation,
@@ -75,12 +75,7 @@
#define FHT_AIX32 10
#define FHT_HPUX9 11
-#ifdef ultrix
-/* Nasty hack to keep the Ultrix C compiler from emitting bogus warnings */
-#define XFF(x) ((u_int32_t)(x))
-#else
#define XFF(x) (x)
-#endif
#define make_uint32(msb,b,c,lsb)\
(XFF(lsb) + (XFF(c)<<8) + (XFF(b)<<16) + (XFF(msb)<<24))
@@ -104,46 +99,21 @@
static int is_UCX(unsigned char *);
void
-Parse_fh(fh, fsidp, inop, osnamep, fsnamep, ourself)
+Parse_fh(fh, fsidp, inop, osnamep, fsnamep)
caddr_t *fh;
my_fsid *fsidp;
ino_t *inop;
char **osnamep; /* if non-NULL, return OS name here */
char **fsnamep; /* if non-NULL, return server fs name here (for VMS) */
-int ourself; /* true if file handle was generated on this host */
{
unsigned char *fhp = (unsigned char *)fh;
u_int32_t temp;
int fhtype = FHT_UNKNOWN;
- if (ourself) {
- /* File handle generated on this host, no need for guessing */
-#if defined(IRIX40)
- fhtype = FHT_IRIX4;
-#endif
-#if defined(IRIX50)
- fhtype = FHT_IRIX5;
-#endif
-#if defined(IRIX51)
- fhtype = FHT_IRIX5;
-#endif
-#if defined(SUNOS4)
- fhtype = FHT_SUNOS4;
-#endif
-#if defined(SUNOS5)
- fhtype = FHT_SUNOS5;
-#endif
-#if defined(ultrix)
- fhtype = FHT_ULTRIX;
-#endif
-#if defined(__osf__)
- fhtype = FHT_DECOSF;
-#endif
- }
/*
* This is basically a big decision tree
*/
- else if ((fhp[0] == 0) && (fhp[1] == 0)) {
+ if ((fhp[0] == 0) && (fhp[1] == 0)) {
/* bytes[0,1] == (0,0); rules out Ultrix, IRIX5, SUNOS5 */
/* probably rules out HP-UX, AIX unless they allow major=0 */
if ((fhp[2] == 0) && (fhp[3] == 0)) {
@@ -393,7 +363,6 @@ int ourself; /* true if file handle was generated on this host */
case FHT_UNKNOWN:
#ifdef DEBUG
{
- /* XXX debugging */
int i;
for (i = 0; i < 32; i++)
(void)fprintf(stderr, "%x.", fhp[i]);
diff --git a/usr.sbin/tcpdump/print-nfs.c b/usr.sbin/tcpdump/print-nfs.c
index b3741808409..1fdc56af4f7 100644
--- a/usr.sbin/tcpdump/print-nfs.c
+++ b/usr.sbin/tcpdump/print-nfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-nfs.c,v 1.21 2015/11/16 00:16:39 mmcc Exp $ */
+/* $OpenBSD: print-nfs.c,v 1.22 2016/01/15 03:03:07 mmcc Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -719,7 +719,7 @@ nfs_printfh(const u_int32_t *dp, const u_int len)
ino_t ino;
char *sfsname = NULL;
- Parse_fh((caddr_t *)dp, &fsid, &ino, NULL, &sfsname, 0);
+ Parse_fh((caddr_t *)dp, &fsid, &ino, NULL, &sfsname);
if (sfsname) {
/* file system ID is ASCII, not numeric, for this server OS */