Added service hash for resolving port/protocol numbers to names.

Minor fix to handling of netmasks end /32.
This commit is contained in:
pdw
2002-10-10 14:11:12 +00:00
parent acad1ac4b5
commit c1f017231c
8 changed files with 137 additions and 23 deletions

View File

@@ -193,12 +193,12 @@ static void handle_ip_packet(struct ip* iptr, int hw_dir)
/*
* Net filter on, assign direction according to netmask
*/
if(in_filter_net(iptr->ip_src) & !in_filter_net(iptr->ip_dst)) {
if(in_filter_net(iptr->ip_src) && !in_filter_net(iptr->ip_dst)) {
/* out of network */
assign_addr_pair(&ap, iptr, 0);
direction = 1;
}
else if(in_filter_net(iptr->ip_dst) & !in_filter_net(iptr->ip_src)) {
else if(in_filter_net(iptr->ip_dst) && !in_filter_net(iptr->ip_src)) {
/* into network */
assign_addr_pair(&ap, iptr, 1);
direction = 0;
@@ -209,6 +209,8 @@ static void handle_ip_packet(struct ip* iptr, int hw_dir)
}
}
ap.protocol = iptr->ip_p;
/* Add the addresses to be resolved */
resolve(&iptr->ip_dst, NULL, 0);
resolve(&iptr->ip_src, NULL, 0);