changeset 10689:a067a728d369

6876238 Snoop should not warn of packet length against di_max_sdu which might be stale
author Roamer <Roamer@Sun.COM>
date Tue, 29 Sep 2009 20:41:29 -0700
parents d09279551f94
children c9e94c239e8c
files usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop.h usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_capture.c
diffstat 2 files changed, 1 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop.h	Tue Sep 29 18:46:22 2009 -0700
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop.h	Tue Sep 29 20:41:29 2009 -0700
@@ -65,8 +65,6 @@
 
 #define	MAXLINE		(1088)		/* max len of detail line */
 
-#define	MAX_HDRTRAILER	(64)		/* max hdr/trailer packet slack */
-
 /*
  * The RPC XID cache structure.
  * When analyzing RPC protocols we
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_capture.c	Tue Sep 29 18:46:22 2009 -0700
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_capture.c	Tue Sep 29 20:41:29 2009 -0700
@@ -69,7 +69,6 @@
 void convert_from_network();
 static void convert_old(struct ohdr *);
 extern sigjmp_buf jmp_env, ojmp_env;
-static dlpi_info_t dlinfo;
 static char *bufp;	/* pointer to read buffer */
 
 static int strioctl(int, int, int, int, void *);
@@ -119,6 +118,7 @@
 	int retval;
 	int flags = DLPI_PASSIVE | DLPI_RAW;
 	dlpi_walk_arg_t dwa;
+	dlpi_info_t dlinfo;
 
 	if (linkname == NULL) {
 		/*
@@ -162,10 +162,6 @@
 		    "not supported\n", dlinfo.di_mactype);
 	}
 
-	/* for backward compatibility, allow known interface mtu_sizes */
-	if (interface->mtu_size > dlinfo.di_max_sdu)
-		dlinfo.di_max_sdu = interface->mtu_size;
-
 	return (interface->try_kernel_filter);
 }
 
@@ -417,19 +413,6 @@
 			goto err;
 		}
 
-		if (nhdrp->sbh_totlen >
-		    (dlinfo.di_max_sdu + MAX_HDRTRAILER)) {
-			if (cap)
-				(void) fprintf(stderr, "(warning) packet length"
-				    " greater than MTU in capture file");
-			else
-				(void) fprintf(stderr, "(warning) packet length"
-				    " greater than MTU in buffer");
-
-			(void) fprintf(stderr, " offset %d: length=%d\n",
-			    bp - buf, nhdrp->sbh_totlen);
-		}
-
 		/*
 		 * Check for incomplete packet.  We are conservative here,
 		 * since we don't know how good the checking is in other
@@ -689,7 +672,6 @@
 		if (mprotect(cap_buffp, cap_len, PROT_READ | PROT_WRITE) < 0)
 			pr_err("mprotect: %s: %m", name);
 	}
-	dlinfo.di_max_sdu = MAXINT;	/* Decode any stored packet. */
 }
 
 void