[PATCHES] fix ICMP logging and logging of non tcp,udp, icmp proto

Martin Josefsson gandalf@wlug.westbo.se
27 Apr 2002 20:14:58 +0200


--=-HJwkE9sP8FFA4qlXXslk
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi,

Attached are two patches, the first one fixes the problem with ICMP
logging. And the second one adds PROTO=<number> for non tcp, udp or icmp
protocols, just like ipt_LOG does.

-- 
/Martin

Never argue with an idiot. They drag you down to their level, then beat
you with experience.

--=-HJwkE9sP8FFA4qlXXslk
Content-Disposition: attachment; filename=ulogd_BASE-icmp-fix.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=ulogd_BASE-icmp-fix.diff; charset=ISO-8859-15

--- ulog/ulogd/extensions/ulogd_BASE.c.orig	Sat Apr 27 19:59:14 2002
+++ ulog/ulogd/extensions/ulogd_BASE.c	Sat Apr 27 19:59:49 2002
@@ -309,7 +309,7 @@
 				ulog_packet_msg_t *pkt)
 {
 	struct iphdr *iph =3D (struct iphdr *) pkt->payload;
-	void *protoh =3D (u_int32_t *) (iph + iph->ihl);
+	void *protoh =3D (u_int32_t *)iph + iph->ihl;
 	struct icmphdr *icmph =3D protoh;
 	ulog_iret_t *ret =3D ip->result;
=20

--=-HJwkE9sP8FFA4qlXXslk
Content-Disposition: attachment; filename=ulogd_LOGEMU-proto-fix.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; name=ulogd_LOGEMU-proto-fix.diff; charset=ISO-8859-15

--- ulog/ulogd/extensions/ulogd_LOGEMU.c.orig	Sat Apr 27 19:26:45 2002
+++ ulog/ulogd/extensions/ulogd_LOGEMU.c	Sat Apr 27 19:49:07 2002
@@ -231,6 +231,9 @@
 					break;
 			}
 			break;
+		default:
+
+			fprintf(of, "PROTO=3D%u ", GET_VALUE(11).ui8);
 	}
 	fprintf(of,"\n");
=20

--=-HJwkE9sP8FFA4qlXXslk--