diff -ur honeyd-1.0.old/ipfrag.c honeyd-1.0/ipfrag.c --- honeyd-1.0.old/ipfrag.c 2006-01-06 17:37:02.000000000 -0500 +++ honeyd-1.0/ipfrag.c 2006-01-06 18:31:22.000000000 -0500 @@ -81,6 +81,7 @@ DIFF(a->ip_src, b->ip_src); DIFF(a->ip_dst, b->ip_dst); DIFF(a->ip_id, b->ip_id); + DIFF(a->ip_proto, b->ip_proto); return (0); } @@ -105,13 +106,14 @@ } struct fragment * -ip_fragment_find(ip_addr_t src, ip_addr_t dst, u_short id) +ip_fragment_find(ip_addr_t src, ip_addr_t dst, u_short id, uint8_t proto) { struct fragment tmp, *frag; tmp.ip_src = src; tmp.ip_dst = dst; tmp.ip_id = id; + tmp.ip_proto = proto; frag = SPLAY_FIND(fragtree, &fragments, &tmp); @@ -161,8 +163,8 @@ addr_pack(&src, ADDR_TYPE_IP, IP_ADDR_BITS, &tmp->ip_src, IP_ADDR_LEN); - syslog(LOG_DEBUG, "Expiring fragment from %s, id %d", - addr_ntoa(&src), ntohs(tmp->ip_id)); + syslog(LOG_DEBUG, "Expiring fragment from %s, id %d, proto %d", + addr_ntoa(&src), ntohs(tmp->ip_id), tmp->ip_proto); ip_fragment_free(tmp); } @@ -179,7 +181,8 @@ } struct fragment * -ip_fragment_new(ip_addr_t src, ip_addr_t dst, u_short id, enum fragpolicy pl) +ip_fragment_new(ip_addr_t src, ip_addr_t dst, u_short id, uint8_t proto, + enum fragpolicy pl) { struct fragment *tmp = NULL; struct timeval tv = { IPFRAG_TIMEOUT, 0}; @@ -202,6 +205,7 @@ tmp->ip_src = src; tmp->ip_dst = dst; tmp->ip_id = id; + tmp->ip_proto = proto; tmp->fragp = pl; TAILQ_INIT(&tmp->fraglist); @@ -358,7 +362,7 @@ if (fragp == FRAG_DROP) goto drop; - fragq = ip_fragment_find(ip->ip_src, ip->ip_dst, ip->ip_id); + fragq = ip_fragment_find(ip->ip_src, ip->ip_dst, ip->ip_id, ip->ip_p); /* Nothing here for now */ off = ntohs(ip->ip_off); @@ -383,7 +387,7 @@ goto freeall; if (fragq == NULL) { - fragq = ip_fragment_new(ip->ip_src, ip->ip_dst, ip->ip_id, fragp); + fragq = ip_fragment_new(ip->ip_src, ip->ip_dst, ip->ip_id, ip->ip_p, fragp); if (fragq == NULL) goto drop; } @@ -401,8 +405,8 @@ memcpy(ent->data, dat, len); nfragmem += len; - syslog(LOG_DEBUG, "Received fragment from %s, id %d: %d@%d", - addr_ntoa(&src), ntohs(ip->ip_id), len, off); + syslog(LOG_DEBUG, "Received fragment from %s, id %d, proto %d: %d@%d", + addr_ntoa(&src), ntohs(ip->ip_id), ip->ip_p, len, off); if (ip_fragment_insert(fragq, ent, mf)) { ip = (struct ip_hdr *)buf; @@ -417,9 +421,9 @@ return (-1); freeall: - syslog(LOG_DEBUG, "%s fragment from %s, id %d: %d@%d", + syslog(LOG_DEBUG, "%s fragment from %s, id %d, proto %d: %d@%d", fragq ? "Freeing" : "Dropping", - addr_ntoa(&src), ntohs(ip->ip_id), len, off); + addr_ntoa(&src), ntohs(ip->ip_id), ip->ip_p, len, off); if (fragq) ip_fragment_free(fragq); diff -ur honeyd-1.0.old/ipfrag.h honeyd-1.0/ipfrag.h --- honeyd-1.0.old/ipfrag.h 2006-01-06 17:37:02.000000000 -0500 +++ honeyd-1.0/ipfrag.h 2006-01-06 17:43:42.000000000 -0500 @@ -52,6 +52,7 @@ ip_addr_t ip_src; /* Network order */ ip_addr_t ip_dst; /* Network order */ u_short ip_id; /* Network order */ + uint8_t ip_proto; u_short maxlen; u_short hadlastpacket;