keepalived: unable to build with json support
Open
Nobody has claimed this yet.
release/21.02
stale
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
Maintainer: @feckert
Environment: OpenWrt openwrt-21.02 branch 55d9c020a1d7bcf1f7dceebfc9417de1eb448d41
- packages feed: aacfbe1534f505c9afeba9148f34affd8a1e9829
- architecture is: ramips/mt7621 - xiaomi router 4a
Description:
When building keepalive with the below config it fails. Building without JSON support is fine.
build log arround failure:
mv -f .deps/vrrp_ip_rule_route_parser.Tpo .deps/vrrp_ip_rule_route_parser.Po
mipsel-openwrt-linux-musl-gcc -DHAVE_CONFIG_H -I. -I../../lib -I ../../keepalived/include -I ../../lib -D_GNU_SOURCE -I/build/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/include -I/build/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/fortify -I/build/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include -I/build/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/usr/include -I/build/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include/fortify -I/build/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/include -D_GNU_SOURCE -g -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/build/build_dir/target-mipsel_24kc_musl/keepalived-2.2.1=keepalived-2.2.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/build/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-5.4.132 -Wall -Wextra -Wunused -Wstrict-prototypes -Walloca -Walloc-zero -Warray-bounds=2 -Wattribute-alias -Wbad-function-cast -Wcast-align -Wcast-qual -Wchkp -Wdate-time -Wdisabled-optimization -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wfloat-conversion -Wfloat-equal -Wformat-overflow -Wformat-security -Wformat-signedness -Wformat-truncation -Wframe-larger-than=5120 -Wimplicit-fallthrough=3 -Winit-self -Winline -Wjump-misses-init -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wmissing-prototypes -Wnested-externs -Wnormalized -Wnull-dereference -Wold-style-definition -Woverlength-strings -Wpointer-arith -Wredundant-decls -Wshadow -Wshift-overflow=2 -Wstack-protector -Wstrict-overflow=4 -Wstrict-prototypes -Wstringop-overflow=2 -Wsuggest-attribute=cold -Wsuggest-attribute=const -Wsuggest-attribute=format -Wsuggest-attribute=malloc -Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wsync-nand -Wtrampolines -Wundef -Wuninitialized -Wunknown-pragmas -Wunsuffixed-float-constants -Wunused-const-variable=2 -Wunused-macros -Wvariadic-macros -Wwrite-strings -fPIE -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -O2 -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -fmacro-prefix-map=/build/build_dir/target-mipsel_24kc_musl/keepalived-2.2.1=keepalived-2.2.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/build/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/linux-5.4.132 -MT vrrp_json.o -MD -MP -MF .deps/vrrp_json.Tpo -c -o vrrp_json.o vrrp_json.c
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
vrrp_json.c: In function 'vrrp_json_auth_dump':
vrrp_json.c:137:11: error: 'vrrp_t' {aka 'struct _vrrp_t'} has no member named 'auth_type'
if (!vrrp->auth_type)
^~
vrrp_json.c:140:18: error: 'vrrp_t' {aka 'struct _vrrp_t'} has no member named 'auth_data'
memcpy(buf, vrrp->auth_data, sizeof(vrrp->auth_data));
^~
vrrp_json.c:140:42: error: 'vrrp_t' {aka 'struct _vrrp_t'} has no member named 'auth_data'
memcpy(buf, vrrp->auth_data, sizeof(vrrp->auth_data));
^~
vrrp_json.c:141:17: error: 'vrrp_t' {aka 'struct _vrrp_t'} has no member named 'auth_data'
buf[sizeof(vrrp->auth_data)] = 0;
^~
At top level:
vrrp_json.c:133:1: warning: 'vrrp_json_auth_dump' defined but not used [-Wunused-function]
vrrp_json_auth_dump(json_writer_t *wr, const char *prop, vrrp_t *vrrp)
^~~~~~~~~~~~~~~~~~~
make[6]: *** [Makefile:423: vrrp_json.o] Error 1
make[6]: Leaving directory '/build/build_dir/target-mipsel_24kc_musl/keepalived-2.2.1/keepalived/vrrp'
make[5]: *** [Makefile:572: all-recursive] Error 1
make[5]: Leaving directory '/build/build_dir/target-mipsel_24kc_musl/keepalived-2.2.1/keepalived'
make[4]: *** [Makefile:438: all-recursive] Error 1
make[4]: Leaving directory '/build/build_dir/target-mipsel_24kc_musl/keepalived-2.2.1'
make[3]: *** [Makefile:276: /build/build_dir/target-mipsel_24kc_musl/keepalived-2.2.1/.built] Error 2
make[3]: Leaving directory '/build/feeds/packages/net/keepalived'
time: package/feeds/packages/keepalived/compile#10.74#2.35#11.97
ERROR: package/feeds/packages/keepalived failed to build.
openwrt config:
$ grep KEEPALIVE .config
CONFIG_KEEPALIVED_BFD=y
# CONFIG_KEEPALIVED_SHA1 is not set
# CONFIG_KEEPALIVED_LVS is not set
CONFIG_KEEPALIVED_VRRP=y
# CONFIG_KEEPALIVED_IPTABLES is not set
# CONFIG_KEEPALIVED_SNMP_VRRP is not set
# CONFIG_KEEPALIVED_SNMP_RFC2 is not set
# CONFIG_KEEPALIVED_SNMP_RFC3 is not set
# CONFIG_KEEPALIVED_DBUS is not set
CONFIG_KEEPALIVED_JSON=y
# CONFIG_KEEPALIVED_VRRP_AUTH is not set
# CONFIG_KEEPALIVED_CHECKSUM_COMPAT is not set
CONFIG_KEEPALIVED_ROUTES=y
CONFIG_KEEPALIVED_LINKBEAT=y
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the OpenWrt keepalived build with CONFIG_KEEPALIVED_JSON=y and CONFIG_KEEPALIVED_VRRP_AUTH unset. Start in keepalived/vrrp/vrrp_json.c at vrrp_json_auth_dump and compare its auth_type and auth_data references with the vrrp_t definition. Done means the JSON-enabled package builds successfully with the reported configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100