This logic is hard for me to follow. What is the implied case here? and_port != sig_port_range[i] and and_port != pp_port_range[i]. Why is that a reason to toss out the sig?

Comment would be helpful here.