Page MenuHomeFreeBSD

Fix access to ifru_buffer on freebsd32.
ClosedPublic

Authored by brooks on Mar 25 2018, 5:36 PM.

Details

Summary

Make all accesses to ifru_buffer go via access functions which take the
process ABI into account and use an appropriate union to access members
in the correct place in struct ifreq.

Obtained from: CheriBSD
Sponsored by: DARPA, AFRL

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 15818
Build 15827: arc lint + arc unit

Event Timeline

brooks created this revision.Mar 25 2018, 5:36 PM
brooks retitled this revision from Fix access to ifru_buffer on 32-bit systems. to Fix access to ifru_buffer on freebsd32..Mar 25 2018, 5:38 PM
kib added inline comments.Mar 25 2018, 5:50 PM
sys/net/if.c
2358

'else' is not needed there and in all subsequent #ifdefs with returns. Then you can un-indent the unconditionally-compiled line.

2373

Then why the argument is needed ?

brooks updated this revision to Diff 40778.Mar 26 2018, 11:49 PM
  • Remove unneeded else in "get" cases.
  • Rename ifr_buffer_set_buffer to ifr_buffer_set_buffer_null and eliminate
kib accepted this revision.Mar 27 2018, 8:09 AM
kib added inline comments.
sys/net/if.c
2346

Does it make sense to provide a stand-alone definition of this union and use it in all functions instead of repeating #ifdefs ?

This revision is now accepted and ready to land.Mar 27 2018, 8:09 AM
brooks updated this revision to Diff 40806.Mar 27 2018, 5:08 PM
  • Rebase
  • Define a union ifreq_union and avoid duplicate anonymous unions.
This revision now requires review to proceed.Mar 27 2018, 5:08 PM
kib accepted this revision.Mar 27 2018, 5:47 PM
This revision is now accepted and ready to land.Mar 27 2018, 5:47 PM
This revision was automatically updated to reflect the committed changes.