Fix access to ifru_buffer on freebsd32.

Make all kernel 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.

Reviewed by:	kib
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14846
This commit is contained in:
brooks 2018-03-27 18:26:50 +00:00 committed by Sebastian Huber
parent b0250c7356
commit f967e60cab
1 changed files with 2 additions and 0 deletions

View File

@ -402,7 +402,9 @@ struct ifreq {
#define ifr_addr ifr_ifru.ifru_addr /* address */ #define ifr_addr ifr_ifru.ifru_addr /* address */
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */ #define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-to-p link */
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */ #define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
#ifndef _KERNEL
#define ifr_buffer ifr_ifru.ifru_buffer /* user supplied buffer with its length */ #define ifr_buffer ifr_ifru.ifru_buffer /* user supplied buffer with its length */
#endif
#define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */ #define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16 bits) */
#define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */ #define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high 16 bits) */
#define ifr_jid ifr_ifru.ifru_jid /* jail/vnet */ #define ifr_jid ifr_ifru.ifru_jid /* jail/vnet */