diff options
author | sashan <anedvedicky@gmail.com> | 2024-03-22 15:19:53 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-03-25 13:49:47 +0100 |
commit | 01eaf203856bfbb63051f8ecf56eae2d21132496 (patch) | |
tree | bb8d4b0bd33a7619c4d96365bda088cb15079e38 | |
parent | Add 3.3 and 3.2 branches to Coveralls builds (diff) | |
download | openssl-01eaf203856bfbb63051f8ecf56eae2d21132496.tar.xz openssl-01eaf203856bfbb63051f8ecf56eae2d21132496.zip |
fix demos/sslecho/main.c so it builds on OpenBSD too
trying to build `demos/sslecho/main.c` shipped by current openssl
fails with error as follows:
```
cc -I../../include -g -Wall -c -o main.o main.c
main.c:35:24: error: variable has incomplete type 'struct sockaddr_in'
struct sockaddr_in addr;
^
main.c:35:12: note: forward declaration of 'struct sockaddr_in'
struct sockaddr_in addr;
^
main.c:46:32: error: use of undeclared identifier 'INADDR_ANY'
addr.sin_addr.s_addr = INADDR_ANY;
^
main.c:152:24: error: variable has incomplete type 'struct sockaddr_in'
struct sockaddr_in addr;
^
main.c:152:12: note: forward declaration of 'struct sockaddr_in'
struct sockaddr_in addr;
^
3 errors generated.
gmake: *** [<builtin>: main.o] Error 1
```
including `netinet/in.h` fixes the build
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23936)
-rw-r--r-- | demos/sslecho/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/demos/sslecho/main.c b/demos/sslecho/main.c index 20b018c7a1..6b192caf4b 100644 --- a/demos/sslecho/main.c +++ b/demos/sslecho/main.c @@ -12,6 +12,7 @@ #include <string.h> #include <sys/socket.h> #include <arpa/inet.h> +#include <netinet/in.h> #include <openssl/ssl.h> #include <openssl/err.h> #include <signal.h> |