[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: N.A.D.S. tech... broken decoder dispatch



On Thu, 2004-02-12 at 13:04, Gianni Tedesco wrote:
> > also, my macwatch preprocessor no longer works.  Initial poking found
> > that the init function is ok, but the arp callback is never actually
> > executed.  
> 
> Works for me(tm). Are the ARP packets being decoded OK?

Yeh, but the dispatch code is messed up.  A few other decoders are like
this.  Attached patch fixes the ones I spotted (only tested the arp one
though).

John.
-- 
GPG: B89C D450 5B2C 74D8 58FB A360 9B06 B5C2 26F0 3047
WEB: http://www.johnleach.co.uk
diff -ru firestorm-snapshot/decode_plugins/arp.c firestorm-fixed/decode_plugins/arp.c
--- firestorm-snapshot/decode_plugins/arp.c	2004-02-07 20:35:06.000000000 +0000
+++ firestorm-fixed/decode_plugins/arp.c	2004-02-12 15:38:51.411112232 +0000
@@ -75,12 +75,11 @@
 	struct layer *l=&p->layer[p->llen];
 
 	if ( l->h.raw+sizeof(struct pkt_arphdr) > p->end ) {
+		p->llen++;
 		dispatch(p);
 		return;
 	}
 
-	p->llen++;
-
 	dispatch(p);
 }
 
diff -ru firestorm-snapshot/decode_plugins/igmp.c firestorm-fixed/decode_plugins/igmp.c
--- firestorm-snapshot/decode_plugins/igmp.c	2004-02-07 20:35:06.000000000 +0000
+++ firestorm-fixed/decode_plugins/igmp.c	2004-02-12 15:41:23.495991816 +0000
@@ -19,11 +19,11 @@
 	struct layer *l=&p->layer[p->llen];
 
 	if ( l->h.raw+sizeof(struct pkt_igmphdr) > p->end ) {
+		p->llen++;
 		dispatch(p);
 		return;
 	}
 
-	p->llen++;
 	dispatch(p);
 }
 
diff -ru firestorm-snapshot/decode_plugins/irda.c firestorm-fixed/decode_plugins/irda.c
--- firestorm-snapshot/decode_plugins/irda.c	2004-02-07 20:35:06.000000000 +0000
+++ firestorm-fixed/decode_plugins/irda.c	2004-02-12 15:42:08.617132360 +0000
@@ -20,11 +20,11 @@
 	struct layer *l=&p->layer[p->llen];
 
 	if ( l->h.raw+IRDA_MIN_SIZE > p->end ) {
+		p->llen++;
 		dispatch(p);
 		return;
 	}
 
-	p->llen++;
 	dispatch(p);
 }
 
diff -ru firestorm-snapshot/decode_plugins/sap.c firestorm-fixed/decode_plugins/sap.c
--- firestorm-snapshot/decode_plugins/sap.c	2004-02-07 20:35:06.000000000 +0000
+++ firestorm-fixed/decode_plugins/sap.c	2004-02-12 15:42:18.672603696 +0000
@@ -45,11 +45,11 @@
 	struct layer *l=&p->layer[p->llen];
 
 	if ( l->h.raw+sizeof(struct pkt_sap) > p->end ) {
+		p->llen++;
 		dispatch(p);
 		return;
 	}
 
-	p->llen++;
 	dispatch(p);
 }

Attachment: signature.asc
Description: This is a digitally signed message part