Fix failure to launch in network without gateway

Check if gateway ip is specified before we try to use it

Closes-Bug: #1381780
Change-Id: I7f8703365e5920f0c04804b2aa6207b91d5f749e
Merge "Fix failure to launch in network without gateway"