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)
Thu, Sep 10, 10:59 AM
Unknown Object (File)
Sat, Sep 5, 3:16 PM
Unknown Object (File)
Sat, Sep 5, 11:53 AM
Unknown Object (File)
Sat, Sep 5, 1:34 AM
Unknown Object (File)
Fri, Sep 4, 9:01 PM
Unknown Object (File)
Fri, Sep 4, 5:10 AM
Unknown Object (File)
Thu, Sep 3, 10:35 PM
Unknown Object (File)
Wed, Sep 2, 4:20 PM
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

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 15835
Build 15843: arc lint + arc unit

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

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

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

sys/dev/sbni/if_sbni.c
1147

No, you are right. The old one does.

This revision was automatically updated to reflect the committed changes.