diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-10-24 09:30:16 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-10-24 09:30:16 +0000 |
commit | b9e50a925c5ef471f7ec5d53d9c33eab8b44fed3 (patch) | |
tree | e30bdcba1473af3e0a7b7cba007858e14d3ca6dd /sys/netinet/in.c | |
parent | ce35e7b414b6d4b2ed03c827c8aaa5b68663dc57 (diff) |
Remove some more tests checking for a non-NULL `ifp->if_ioctl'.
if_attach() enforces it is properly defined.
Diffstat (limited to 'sys/netinet/in.c')
-rw-r--r-- | sys/netinet/in.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 81997ad7061..3d52824b16e 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in.c,v 1.142 2017/10/24 08:57:10 mpi Exp $ */ +/* $OpenBSD: in.c,v 1.143 2017/10/24 09:30:15 mpi Exp $ */ /* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */ /* @@ -315,8 +315,8 @@ in_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, int privileged) return (EINVAL); oldaddr = ia->ia_dstaddr; ia->ia_dstaddr = *satosin(&ifr->ifr_dstaddr); - if (ifp->if_ioctl && (error = (*ifp->if_ioctl) - (ifp, SIOCSIFDSTADDR, (caddr_t)ia))) { + error = (*ifp->if_ioctl)(ifp, SIOCSIFDSTADDR, (caddr_t)ia); + if (error) { ia->ia_dstaddr = oldaddr; return (error); } @@ -450,8 +450,7 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin, * if this is its first address, * and to validate the address if necessary. */ - if (ifp->if_ioctl && - (error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) { + if ((error = (*ifp->if_ioctl)(ifp, SIOCSIFADDR, (caddr_t)ia))) { ia->ia_addr = oldaddr; } |