ipfwadm 2.3.0 icmp fix

Chris Wedgwood (chris@f00f.org)
Thu, 27 Nov 1997 13:58:38 +1300


This is not the best place for it, but its vaguely relevant...

Here is a small fix to allow ipfwadm-2.3.0 to display ICMP masquerades.

-Chris

file: /tmp/ipfwadm-2.30-icmp-fix.diff
--- ipfwadm.c.orig Tue Jul 30 23:54:22 1996
+++ ipfwadm.c Thu Nov 27 13:53:14 1997
@@ -1,5 +1,5 @@
/*
- * $Id: ipfwadm.c,v 1.15 1996/07/30 11:52:33 jos Exp $
+ * $Id: ipfwadm.c,v 1.16 1997/11/27 13:01:17 chris Exp $
*
*
* ipfwadm -- IP firewall and accounting administration
@@ -91,6 +91,8 @@
* Include <sys/param.h> instead of <asm/param.h> and use HZ
* instead of 100 when reading the masquerading timeout values.
* [ipfwadm 2.3.0]
+ * 1.16 Chris Wedgwood <chris@f00f.org>. Small fix so that output
+ * of ICMP masquerade entries is displayed.
*
*/

@@ -197,8 +199,8 @@
int udp_timeout;
} timeouts;

-char ipfwadm_version[] = "$Id: ipfwadm.c,v 1.15 1996/07/30 11:52:33 jos Exp $";
-char package_version[] = "ipfwadm 2.3.0, 1996/07/30";
+char ipfwadm_version[] = "$Id: ipfwadm.c,v 1.16 1997/11/27 13:01:17 chris Exp $";
+char package_version[] = "ipfwadm 2.3.0.1, 1997/11/27";

int ssocmd_insert[4] =
{IP_FW_INSERT_FWD, IP_FW_INSERT_IN, IP_FW_INSERT_OUT, IP_ACCT_INSERT};
@@ -1571,6 +1573,9 @@
case IP_FW_F_UDP:
fprintf(fp, "%-5s", "udp");
break;
+ case IP_FW_F_ICMP:
+ fprintf(fp, "%-5s", "icmp");
+ break;
}

sec100s = ms->expires % HZ;
@@ -1668,6 +1673,8 @@
ms->kind = IP_FW_F_TCP;
else if (strcmp("UDP", buf) == 0)
ms->kind = IP_FW_F_UDP;
+ else if (strcmp("ICMP", buf) == 0)
+ ms->kind = IP_FW_F_ICMP;
else
exit_error(1, "unexpected input data");