diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2008-10-08 18:42:22 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2008-10-08 18:42:22 +0000 |
commit | e23a5b1809e640d23f62fd806f056e203d6ba9ff (patch) | |
tree | 1726f89ab030b24f828ed89881a26b8325287beb /usr.sbin | |
parent | 16f7de47c48d3dfdaa275e23892efa6827a406e7 (diff) |
SIOCAIFADDR can fail with EEXIST either if the local or the destination
address already exists so mention both addresses in the error message.
From PR4584 (alexander at beard dot se) I just tuned the error message a bit.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pppd/sys-bsd.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/pppd/sys-bsd.c b/usr.sbin/pppd/sys-bsd.c index 5c31ae48d22..8be3b23f524 100644 --- a/usr.sbin/pppd/sys-bsd.c +++ b/usr.sbin/pppd/sys-bsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys-bsd.c,v 1.24 2007/06/04 14:59:45 henning Exp $ */ +/* $OpenBSD: sys-bsd.c,v 1.25 2008/10/08 18:42:21 claudio Exp $ */ /* * sys-bsd.c - System-dependent procedures for setting up @@ -78,7 +78,7 @@ #if 0 static char rcsid[] = "Id: sys-bsd.c,v 1.31 1998/04/02 12:04:19 paulus Exp $"; #else -static char rcsid[] = "$OpenBSD: sys-bsd.c,v 1.24 2007/06/04 14:59:45 henning Exp $"; +static char rcsid[] = "$OpenBSD: sys-bsd.c,v 1.25 2008/10/08 18:42:21 claudio Exp $"; #endif #endif @@ -1027,6 +1027,7 @@ sifaddr(u, o, h, m) { struct ifaliasreq ifra; struct ifreq ifr; + char s1[64], s2[64]; strlcpy(ifra.ifra_name, ifname, sizeof(ifra.ifra_name)); SET_SA_FAMILY(ifra.ifra_addr, AF_INET); @@ -1049,9 +1050,11 @@ sifaddr(u, o, h, m) syslog(LOG_ERR, "Couldn't set interface address: %m"); return 0; } + strlcpy(s1, ip_ntoa(o), sizeof(s1)); + strlcpy(s2, ip_ntoa(h), sizeof(s2)); syslog(LOG_WARNING, - "Couldn't set interface address: Address %s already exists", - ip_ntoa(o)); + "Couldn't set interface address: " + "Address %s or destination %s already exists", s1, s2); } ifaddrs[0] = o; ifaddrs[1] = h; |