After the binary match change, is it so that there is no need to change this test?
/* Store tag and flags and return result */ if((res != NULL) && ((transport == PROTO_NONE) || (res->transport_code == transport)) && ((src_port == 0) || (res->port == src_port))) {
Yes, you're right. Since the updated bsearch() already has ports comparison, I think the following part looks excessive (doesn't break anything though): `&& ((src_port == 0) || (res->port == src_port))) {`
I'll remove it.