Actions
Bug #10486
closedkeysock: cast between incompatible function types
Start date:
2019-03-02
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
Description
Build error with gcc 8:
../../common/inet/ip/keysock.c:162:2: error: cast between incompatible function types from 'void (*)(queue_t *, mblk_t *)' {aka 'void (*)(struct queue *, struct msgb *)'} to 'int (*)()' [-Werror=cast-function-type] (pfi_t)keysock_rput, (pfi_t)keysock_rsrv, keysock_open, keysock_close, ^ ../../common/inet/ip/keysock.c:162:23: error: cast between incompatible function types from 'void (*)(queue_t *)' {aka 'void (*)(struct queue *)'} to 'int (*)()' [-Werror=cast-function-type] (pfi_t)keysock_rput, (pfi_t)keysock_rsrv, keysock_open, keysock_close, ^ ../../common/inet/ip/keysock.c:167:2: error: cast between incompatible function types from 'void (*)(queue_t *, mblk_t *)' {aka 'void (*)(struct queue *, struct msgb *)'} to 'int (*)()' [-Werror=cast-function-type] (pfi_t)keysock_wput, NULL, NULL, NULL, NULL, &info ^ cc1: all warnings being treated as errors
Updated by Toomas Soome over 3 years ago
Test script (from Dan):
#!/sbin/sh echo "add ah spi 0x2112 authkey 0x1234567890abcdef1234567890abcdef authalg md5 dst localhost" | ipseckey echo "add esp spi 0x5150 encrkey 0x1234567890abcdef1234567890abcdef encralg aes-cbc dst localhost" | ipseckey ipseckey dump ipseckey flush echo "After this should be nothing..." ipseckey dump echo "...but this line"
output:
tsoome@test:~$ sudo -s Password: root@test:/home/tsoome# cd /tmp root@test:/tmp# vi test.sh root@test:/tmp# sh test.sh Base message (version 2) type DUMP, SA type AH. Message length 136 bytes, seq=1, pid=21829. SA: SADB_ASSOC spi=0x2112, replay window size=0, state=MATURE SA: Authentication algorithm = hmac-md5 SA: flags=0xc000 < X_OUTBOUND X_INBOUND > SRC: Source address (proto=0/<unspecified>) SRC: AF_INET: port 0, 0.0.0.0 <unspecified>. DST: Destination address (proto=0/<unspecified>) DST: AF_INET: port 0, 127.0.0.1 (test). AKY: Authentication key. AKY: 1234567890abcdef1234567890abcdef/128 LT: Lifetime information CLT: Current lifetime information: CLT: 0 bytes protected, 0 allocations used. CLT: SA added at time: 11. märts 2019 18:22:22 EET CLT: Time now is 11. märts 2019 18:22:22 EET Base message (version 2) type DUMP, SA type AH. Message length 168 bytes, seq=1, pid=21829. SA: SADB_ASSOC spi=0x2112, replay window size=0, state=MATURE SA: Authentication algorithm = hmac-md5 SA: flags=0xc000 < X_OUTBOUND X_INBOUND > SRC: Source address (proto=0/<unspecified>) SRC: AF_INET6: port 0, :: <unspecified>. DST: Destination address (proto=0/<unspecified>) DST: AF_INET6: port 0, ::1 (test). AKY: Authentication key. AKY: 1234567890abcdef1234567890abcdef/128 LT: Lifetime information CLT: Current lifetime information: CLT: 0 bytes protected, 0 allocations used. CLT: SA added at time: 11. märts 2019 18:22:22 EET CLT: Time now is 11. märts 2019 18:22:22 EET Base message (version 2) type DUMP, SA type ESP. Message length 152 bytes, seq=1, pid=21829. SA: SADB_ASSOC spi=0x5150, replay window size=0, state=MATURE SA: Encryption algorithm = aes-cbc SA: flags=0xc000 < X_OUTBOUND X_INBOUND > SRC: Source address (proto=0/<unspecified>) SRC: AF_INET: port 0, 0.0.0.0 <unspecified>. DST: Destination address (proto=0/<unspecified>) DST: AF_INET: port 0, 127.0.0.1 (test). EKY: Encryption key. EKY: 1234567890abcdef1234567890abcdef/128 LT: Lifetime information CLT: Current lifetime information: CLT: 0 bytes protected, 0 allocations used. CLT: SA added at time: 11. märts 2019 18:22:22 EET CLT: Time now is 11. märts 2019 18:22:22 EET Base message (version 2) type DUMP, SA type ESP. Message length 184 bytes, seq=1, pid=21829. SA: SADB_ASSOC spi=0x5150, replay window size=0, state=MATURE SA: Encryption algorithm = aes-cbc SA: flags=0xc000 < X_OUTBOUND X_INBOUND > SRC: Source address (proto=0/<unspecified>) SRC: AF_INET6: port 0, :: <unspecified>. DST: Destination address (proto=0/<unspecified>) DST: AF_INET6: port 0, ::1 (test). EKY: Encryption key. EKY: 1234567890abcdef1234567890abcdef/128 LT: Lifetime information CLT: Current lifetime information: CLT: 0 bytes protected, 0 allocations used. CLT: SA added at time: 11. märts 2019 18:22:22 EET CLT: Time now is 11. märts 2019 18:22:22 EET Dump succeeded for SA type 0. After this should be nothing... Dump succeeded for SA type 0. ...but this line root@test:/tmp#
The test was performed with following updates installed:
9b3a883f586 10484 ipsecah: cast between incompatible function types c50588d91f7 10485 ipsecesp: cast between incompatible function types f6867a93d04 10486 keysock: cast between incompatible function types
Updated by Electric Monk over 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
git commit 4f2d1f9dea87575eea42d3ab3152b4495426cb8a
commit 4f2d1f9dea87575eea42d3ab3152b4495426cb8a Author: Toomas Soome <tsoome@me.com> Date: 2019-03-12T08:38:58.000Z 10486 keysock: cast between incompatible function types Reviewed by: Gergő Doma <domag02@gmail.com> Reviewed by: C Fraire <cfraire@me.com> Approved by: Dan McDonald <danmcd@joyent.com>
Actions