diff options
| author | David Lamparter <equinox@diac24.net> | 2019-11-26 17:05:47 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-11-26 17:14:03 +0100 |
| commit | 50db10a162f5929784f448152c1c0bca11dcd517 (patch) | |
| tree | fe8af160232ead065fcf4879b73187ae00ddcdb8 /zebra/zebra_mpls.c | |
| parent | 2f7b0479e9cacadd76ccf2e5ada56b51e2e6f241 (diff) | |
lib: add gcc 4.x workaround for frr_interface_info
gcc 4.x does not properly support structs with variable length array
members. Specifically, for global variables, it completely ignores the
array, coming up with a size much smaller than what is correct. This is
broken for both sizeof() as well as ELF object size.
This breaks for frr_interface_info since this variable is in some cases
copy relocated by the linker. (The linker does this to make the address
of the variable a "constant" for the main program.) This copying uses
the ELF object size, thereby copying only the non-array part of the
struct.
Breakage ensues...
(This fix is a bit ugly, but it's limited to very old gcc, and it's
better than changing the array to "nodes[1000]" and wasting memory...)
Fixes: #4563
Fixes: #5074
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'zebra/zebra_mpls.c')
0 files changed, 0 insertions, 0 deletions
