summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/bundle.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-07-28 21:54:54 +0000
committerbrian <brian@FreeBSD.org>1998-07-28 21:54:54 +0000
commit9a2438b63a4a38c721d05e02835d87879878a435 (patch)
tree5182da44fc5e58e47102b8e3e5d1833f185a7ccc /usr.sbin/ppp/bundle.c
parenta8040b983130775d11758b3701ec79c170d7ef70 (diff)
downloadFreeBSD-src-9a2438b63a4a38c721d05e02835d87879878a435.zip
FreeBSD-src-9a2438b63a4a38c721d05e02835d87879878a435.tar.gz
Silence ``Network unreachable'' warnings when using
``add .... HISADDR''. The network will never be reachable at this point unless we're in -auto or reading the command from ppp.linkup. We can now run the following lines and get the expected results: set ifaddr 1.2.3.4/0 5.6.7.8/0 add default HISADDR where a route is added immediately in auto mode and the whole thing is delayed 'till the IP numbers have been agreed in other modes. Essentially, ppp.linkup is no longer required.
Diffstat (limited to 'usr.sbin/ppp/bundle.c')
-rw-r--r--usr.sbin/ppp/bundle.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c
index 990a0c6..49e4c9c 100644
--- a/usr.sbin/ppp/bundle.c
+++ b/usr.sbin/ppp/bundle.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: bundle.c,v 1.26 1998/06/27 14:17:23 brian Exp $
+ * $Id: bundle.c,v 1.27 1998/06/27 14:18:00 brian Exp $
*/
#include <sys/param.h>
@@ -952,7 +952,7 @@ struct rtmsg {
int
bundle_SetRoute(struct bundle *bundle, int cmd, struct in_addr dst,
- struct in_addr gateway, struct in_addr mask, int bang)
+ struct in_addr gateway, struct in_addr mask, int bang, int ssh)
{
struct rtmsg rtmes;
int s, nb, wb;
@@ -1052,12 +1052,13 @@ failed:
if (!bang)
log_Printf(LogWARN, "Del route failed: %s: Non-existent\n",
inet_ntoa(dst));
- } else if (rtmes.m_rtm.rtm_errno == 0)
- log_Printf(LogWARN, "%s route failed: %s: errno: %s\n", cmdstr,
- inet_ntoa(dst), strerror(errno));
- else
+ } else if (rtmes.m_rtm.rtm_errno == 0) {
+ if (!ssh || errno != ENETUNREACH)
+ log_Printf(LogWARN, "%s route failed: %s: errno: %s\n", cmdstr,
+ inet_ntoa(dst), strerror(errno));
+ } else
log_Printf(LogWARN, "%s route failed: %s: %s\n",
- cmdstr, inet_ntoa(dst), strerror(rtmes.m_rtm.rtm_errno));
+ cmdstr, inet_ntoa(dst), strerror(rtmes.m_rtm.rtm_errno));
}
log_Printf(LogDEBUG, "wrote %d: cmd = %s, dst = %x, gateway = %x\n",
wb, cmdstr, (unsigned)dst.s_addr, (unsigned)gateway.s_addr);
OpenPOWER on IntegriCloud