1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-05-20 20:32:40 +00:00

Again fixes a few disable problems

This commit is contained in:
Gerhard 2025-02-20 10:29:49 +01:00
parent 6a53c955d3
commit 34b09a44ee
3 changed files with 8 additions and 0 deletions

View file

@ -131,6 +131,8 @@ Features:
Building:
Disabling certain features during configure could break build process.
Again fixes a few disable problems.
Porting:
Fix for old FreeBSD.

View file

@ -390,18 +390,22 @@ int _xioopen_ipapp_connect(struct single *sfd,
} else if (needbind && bindport) {
/* Bind by sourceport option */
switch ((*themp)->ai_family) {
#if WITH_IP4
case PF_INET:
bindaddr.ip4.sin_family = (*themp)->ai_family;
bindaddr.ip4.sin_port = htons(bindport);
bindaddrp = &bindaddr;
bindlen = sizeof(bindaddr.ip4);
break;
#endif
#if WITH_IP6
case PF_INET6:
bindaddr.ip6.sin6_family = (*themp)->ai_family;
bindaddr.ip6.sin6_port = htons(bindport);
bindaddrp = &bindaddr;
bindlen = sizeof(bindaddr.ip6);
break;
#endif
}
}

View file

@ -2349,11 +2349,13 @@ int xiosock_reuseaddr(int fd, int ipproto, struct opt *opts)
}
#endif /* WITH_TCP */
result = retropt_2integrals(opts, OPT_SO_REUSEADDR, &val, &notnull);
#if WITH_TCP
if (ipproto == IPPROTO_TCP && result < 0) {
Info("Setting SO_REUSADDR on TCP listen socket implicitly");
val.u_int = 1;
notnull.u_bool = true;
}
#endif /* WITH_TCP */
if (notnull.u_bool) {
if (Setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val.u_int, sizeof(int))
!= 0) {