Page MenuHomeFreeBSD

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

Authored by brooks on Mar 27 2018, 7:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 4 2024, 12:45 AM
Unknown Object (File)
Oct 3 2024, 8:04 PM
Unknown Object (File)
Oct 1 2024, 7:15 AM
Unknown Object (File)
Sep 27 2024, 4:59 PM
Unknown Object (File)
Sep 19 2024, 9:07 PM
Unknown Object (File)
Sep 5 2024, 5:53 PM
Unknown Object (File)
Aug 6 2024, 6:45 PM
Unknown Object (File)
Jul 12 2024, 6:37 AM
Subscribers

Details

Summary

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

This eliminates the only assignment to ifr_data.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

An alternative approach might be to add an char ifru_bytes[sizeof(struct sockaddr)] to ifreq's union and target that.

kib added inline comments.
sys/dev/sbni/if_sbni.c
1147 ↗(On Diff #40816)

I think this leaks a word of stack on 64bit machines.

This revision is now accepted and ready to land.Mar 27 2018, 8:23 PM
sys/dev/sbni/if_sbni.c
1147 ↗(On Diff #40816)

ioctl handles this for us because it copied in the whole ifreq in sys_ioctl().

sys/dev/sbni/if_sbni.c
1147 ↗(On Diff #40816)

No, you are right. The old one does.

This revision was automatically updated to reflect the committed changes.