diff options
| author | 2017-07-12 06:09:03 +0000 | |
|---|---|---|
| committer | 2017-07-12 06:09:03 +0000 | |
| commit | e3bbd933f50453e058e066dbb3dba94c028fc9e1 (patch) | |
| tree | 323c7a243d6287b2ef705832332407b442195240 | |
| parent | Mark up firmware pathnames with Pa. (diff) | |
| download | wireguard-openbsd-e3bbd933f50453e058e066dbb3dba94c028fc9e1.tar.xz wireguard-openbsd-e3bbd933f50453e058e066dbb3dba94c028fc9e1.zip | |
Don't clobber errno, we want to log_warn what went wrong.
OK benno, millert
| -rw-r--r-- | usr.sbin/rtadvd/if.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/rtadvd/if.c b/usr.sbin/rtadvd/if.c index 4683bcffac9..6e9ac21e1e9 100644 --- a/usr.sbin/rtadvd/if.c +++ b/usr.sbin/rtadvd/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.41 2016/08/02 17:00:09 jca Exp $ */ +/* $OpenBSD: if.c,v 1.42 2017/07/12 06:09:03 florian Exp $ */ /* $KAME: if.c,v 1.17 2001/01/21 15:27:30 itojun Exp $ */ /* @@ -111,7 +111,7 @@ if_nametosdl(char *name) int if_getmtu(char *name) { - int s; + int s, save_errno; struct ifreq ifr; u_long mtu = 0; @@ -123,7 +123,9 @@ if_getmtu(char *name) fatalx("strlcpy"); if (ioctl(s, SIOCGIFMTU, (char *)&ifr) >= 0) mtu = ifr.ifr_mtu; + save_errno = errno; close(s); + errno = save_errno; } return (mtu); |
