if_dl: Increase size of sdl_data from 20 to 46 bytes.

FreeBSD's is presently 46 bytes. CID 1422869 warns that it can get overrun
in if_attach() in copying if_xname which is IF_NAMESIZE bytes (32).

This breaks ABI, but BeOS did not have sockaddr_dl, it is only a modern-GCC
ABI break. Since most applications assume that sockaddr_dl is variable-length
and is null-terminated, as well as not used very often, hopefully this will
require relatively few rebuilds.
This commit is contained in:
Augustin Cavalier
2018-06-20 21:26:21 -04:00
parent 2a3a847f82
commit e4104854c3
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2012 Haiku, Inc. All Rights Reserved.
* Copyright 2006-2018 Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _NET_IF_DL_H
@@ -19,7 +19,7 @@ struct sockaddr_dl {
uint8_t sdl_nlen; /* interface name length (not terminated with a null byte) */
uint8_t sdl_alen; /* link level address length */
uint8_t sdl_slen; /* link layer selector length */
uint8_t sdl_data[20]; /* minimum work area, can be larger */
uint8_t sdl_data[46]; /* minimum work area, can be larger */
};
/* Macro to get a pointer to the link level address */