1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-06 13:06:33 +00:00

Fixed build issues on disabled features

This commit is contained in:
Gerhard Rieger 2025-01-29 21:49:16 +01:00
parent af7d44d751
commit 7a90caade5
21 changed files with 182 additions and 95 deletions

View file

@ -677,7 +677,7 @@ int xiopoll(struct pollfd fds[], unsigned long nfds, struct timeval *timeout) {
}
#if WITH_TCP || WITH_UDP
#if WITH_TCP || WITH_UDP || WITH_SCTP || WITH_DCCP || WITH_UDPLITE
/* returns port in network byte order;
ipproto==IPPROTO_UDP resolves as UDP service, every other value resolves as
TCP */
@ -702,10 +702,10 @@ int parseport(const char *portname, int ipproto) {
return se->s_port;
}
#endif /* WITH_TCP || WITH_UDP */
#endif /* WITH_TCP || WITH_UDP || WITH_SCTP || WITH_DCCP || WITH_UDPLITE */
#if WITH_IP4 || WITH_IP6 || WITH_INTERFACE
#if WITH_IP4 || WITH_IP6 || _WITH_INTERFACE
/* check the systems interfaces for ifname and return its index
or -1 if no interface with this name was found
The system calls require an arbitrary socket; the calling program may
@ -729,8 +729,8 @@ int ifindexbyname(const char *ifname, int anysock) {
}
if (anysock >= 0) {
s = anysock;
} else if ((s = Socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0) {
Error1("socket(PF_INET, SOCK_DGRAM, IPPROTO_IP): %s", strerror(errno));
} else if ((s = Socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
Error1("socket(PF_INET, SOCK_DGRAM, 0): %s", strerror(errno));
return -1;
}
@ -756,10 +756,10 @@ int ifindexbyname(const char *ifname, int anysock) {
return -1;
#endif /* !defined(HAVE_ STRUCT_IFREQ) && defined(SIOCGIFCONF) && defined(SIOCGIFINDEX) */
}
#endif /* WITH_IP4 || WITH_IP6 || WITH_INTERFACE */
#endif /* WITH_IP4 || WITH_IP6 || _WITH_INTERFACE */
#if WITH_IP4 || WITH_IP6 || WITH_INTERFACE
#if WITH_IP4 || WITH_IP6 || _WITH_INTERFACE
/* like ifindexbyname(), but also allows the index number as input - in this
case it does not lookup the index.
writes the resulting index to *ifindex and returns 0,
@ -783,7 +783,7 @@ int ifindex(const char *ifname, unsigned int *ifindex, int anysock) {
*ifindex = val;
return 0;
}
#endif /* WITH_IP4 || WITH_IP6 || WITH_INTERFACE */
#endif /* WITH_IP4 || WITH_IP6 || _WITH_INTERFACE */
int _xiosetenv(const char *envname, const char *value, int overwrite, const char *sep) {