diff options
| author | Roy Marples <roy@marples.name> | 2020-01-02 11:14:13 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-01-02 11:14:13 +0000 |
| commit | c95266be7384a6e87aa9c95332e695f0b8eca50f (patch) | |
| tree | 161cabf85eb11c524f3888631f14a146a388bd8f | |
| parent | 51880d726a2b15039f0b4f8a052c9b3254eb0691 (diff) | |
| download | dhcpcd-c95266be7384a6e87aa9c95332e695f0b8eca50f.tar.xz | |
inet: Allow forcing a host route from an interface without a lease
| -rw-r--r-- | src/ipv4.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -429,7 +429,10 @@ inet_routerhostroute(rb_tree_t *routes, struct interface *ifp) in.s_addr = INADDR_ANY; sa_in_init(&rth->rt_gateway, &in); rth->rt_mtu = dhcp_get_mtu(ifp); - sa_in_init(&rth->rt_ifa, &state->addr->addr); + if (state->addr != NULL) + sa_in_init(&rth->rt_ifa, &state->addr->addr); + else + rth->rt_ifa.sa_family = AF_UNSPEC; /* We need to insert the host route just before the router. */ while ((rtp = RB_TREE_MAX(routes)) != NULL) { |
