changeset 4434:7d588b6cb52d draft

sun: Use lo0 if we can't find an interface for our route We need to operate on the route, and dhcpcd needs an interface for each route. This seems to work for now.
author Roy Marples <roy@marples.name>
date Sun, 14 Apr 2019 13:48:29 +0300
parents 4262dbc903e8
children 3adc126c82e3
files src/if-sun.c
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/if-sun.c	Sun Apr 14 12:54:16 2019 +0300
+++ b/src/if-sun.c	Sun Apr 14 13:48:29 2019 +0300
@@ -1012,7 +1012,6 @@
 	}
 
 done:
-	logerrx("plumb %d %d %d", mux_fd, fd, arp_fd);
 	retval = 0;
 
 out:
@@ -1263,8 +1262,11 @@
 			 * This sucks, so we need to call RTM_GET to
 			 * work out the interface. */
 			if (if_route_get(ctx, &rt) == NULL) {
-				logerr(__func__);
-				continue;
+				rt.rt_ifp = if_loopback(ctx);
+				if (rt.rt_ifp == NULL) {
+					logerr(__func__);
+					continue;
+				}
 			}
 			if_finishrt(ctx, &rt);
 		}
@@ -1319,8 +1321,11 @@
 			 * This sucks, so we need to call RTM_GET to
 			 * work out the interface. */
 			if (if_route_get(ctx, &rt) == NULL) {
-				logerr(__func__);
-				continue;
+				rt.rt_ifp = if_loopback(ctx);
+				if (rt.rt_ifp == NULL) {
+					logerr(__func__);
+					continue;
+				}
 			}
 			if_finishrt(ctx, &rt);
 		}