diff options
author | 2012-11-05 03:49:16 +0000 | |
---|---|---|
committer | 2012-11-05 03:49:16 +0000 | |
commit | 23f73de7b0bef58f77a13fb4dda57ee51666f825 (patch) | |
tree | 4aad358a051504e552b3c782b65b44e9f90bb56f | |
parent | Properly clear the UP flag while forcing the interface down/up (diff) | |
download | wireguard-openbsd-23f73de7b0bef58f77a13fb4dda57ee51666f825.tar.xz wireguard-openbsd-23f73de7b0bef58f77a13fb4dda57ee51666f825.zip |
Some systems give ENETUNREACH when trying to add the 'standard'
host route, a.k.a. 'route add w.x.y.z 127.0.0.1'. Since dhclient-script
ignored the failure, ignore it here too until it can be explained
or we stop creating these routes.
-rw-r--r-- | sbin/dhclient/kroute.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c index ab43c76c776..31ceb144a7a 100644 --- a/sbin/dhclient/kroute.c +++ b/sbin/dhclient/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.7 2012/11/04 03:36:39 krw Exp $ */ +/* $OpenBSD: kroute.c,v 1.8 2012/11/05 03:49:16 krw Exp $ */ /* * Copyright 2012 Kenneth R Westerback <krw@openbsd.org> @@ -654,7 +654,11 @@ priv_add_new_address(char *ifname, int rdomain, struct iaddr addr, for (i = 0; i < 5; i++) { if (writev(s, iov, iovcnt) != -1) break; - if (errno != EEXIST) + /* XXX Why do some systems get ENETUNREACH? */ + if (errno == ENETUNREACH) { + note("failed to add 127.0.0.1 route: %m"); + break; + } else if (errno != EEXIST) error("failed to add 127.0.0.1 route: %m"); sleep(1); } |