Copy flags over ifr_union directly rather than via casts through ifr_data.

No functional change in practice.  If the sbni driver supported
64-bit big-endian system, this would be an ABI changes, but it is
i386-only.  The old version leaked a word of stack on 64-bit systems.

This eliminates the only assignment to ifr_data.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14874
This commit is contained in:
Brooks Davis 2018-03-27 21:06:18 +00:00
parent ba3f32ed27
commit 2f471660fb

View File

@ -1144,7 +1144,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
flags.fixed_rxl = (sc->delta_rxl == 0);
flags.fixed_rate = 1;
SBNI_UNLOCK(sc);
ifr->ifr_data = *(caddr_t*) &flags;
bcopy(&flags, &ifr->ifr_ifru, sizeof(flags));
break;
case SIOCGINSTATS:
@ -1163,7 +1163,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
error = priv_check(td, PRIV_DRIVER);
if (error)
break;
flags = *(struct sbni_flags*)&ifr->ifr_data;
bcopy(&ifr->ifr_ifru, &flags, sizeof(flags));
SBNI_LOCK(sc);
if (flags.fixed_rxl) {
sc->delta_rxl = 0;