Skip to content
Commit 91333788 authored by gary-wzl77's avatar gary-wzl77
Browse files

net: fix NPE when reading IP configurations



When the default gateway is not used in IP configurations,
for example the gateway info in ip configurations was fed with
custom gateway address

```
    out.writeUTF(GATEWAY_KEY);
    out.writeInt(0);  // Default route.
    out.writeInt(1);  // Have a gateway.
    out.writeUTF(staticIpConfiguration.getGateway().getHostAddress());
```

A NPE occurred.

When there is no destination, assume it is default route and use
the gateway address in all cases.

Test: manual
Change-Id: I5904efad5d277de6724f81d99e62c21ff8347caa
Signed-off-by: default avatargary-wzl77 <gary.wang@canonical.com>
parent 61c79dbc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment