backport from trunk:
- fixed GW matching (in is_from_gw() ) when the using the "n" flag for ignoring the port part.
  Reported by Miguel J. López Valverde