1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-14 15:23:24 +00:00

Fixed IP-SENDTO with option pf with protocol name

This commit is contained in:
Gerhard Rieger 2024-07-26 09:48:17 +02:00
parent 50b6301bda
commit 0cfe39a413
7 changed files with 75 additions and 15 deletions

View file

@ -132,15 +132,17 @@ int xioinit_ip(
char ipv)
{
if (*pf == PF_UNSPEC) {
#if WITH_IP4 && WITH_IP6
switch (ipv) {
case '0': *pf = PF_UNSPEC; break;
#if WITH_IP4
case '4': *pf = PF_INET; break;
#endif
#if WITH_IP6
case '6': *pf = PF_INET6; break;
#endif
default: break; /* includes \0 */
}
#elif WITH_IP6
*pf = PF_INET6;
#else
*pf = PF_INET;
#endif
}
return 0;
}