Systems can have multiple ethernet cards and thus multiple IP addresses but usually only a single gateway. If you don't want to run the risk receiving an invalid IP or one that is not assigned a gateway and thus cannot be used to access the internet then you should filter gateway first && then IP.