Skip to content

Commit 3df8a32

Browse files
committed
handle TCLASS to support OTP 19.3
1 parent a528fc9 commit 3df8a32

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

c_src/afunix_drv.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ typedef int ErlDrvSSizeT;
449449
#define INET_LOPT_NETNS 38 /* Network namespace pathname */
450450
#define INET_LOPT_TCP_SHOW_ECONNRESET 39 /* tell user about incoming RST */
451451
#define INET_LOPT_LINE_DELIM 40 /* Line delimiting char */
452+
#define INET_OPT_TCLASS 41 /* IPv6 transport class */
452453

453454
#define UNIX_OPT_PEERCRED 201
454455
#define UNIX_OPT_PEERPID 202
@@ -2717,6 +2718,15 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, int len)
27172718
#else
27182719
continue;
27192720
#endif
2721+
#if defined(IPV6_TCLASS) && defined(SOL_IPV6)
2722+
case INET_OPT_TCLASS:
2723+
proto = SOL_IPV6;
2724+
type = IPV6_TCLASS;
2725+
propagate = 1;
2726+
DEBUGF("inet_set_opts(%ld): s=%d, IPV6_TCLASS=%d\r\n",
2727+
(long)desc->port, desc->s, ival);
2728+
break;
2729+
#endif
27202730

27212731
case TCP_OPT_NODELAY:
27222732
proto = IPPROTO_TCP;
@@ -3014,6 +3024,15 @@ static ErlDrvSSizeT inet_fill_opts(inet_descriptor* desc,
30143024
*ptr++ = opt;
30153025
put_int32(0, ptr);
30163026
continue;
3027+
#endif
3028+
case INET_OPT_TCLASS:
3029+
#if defined(IPV6_TCLASS) && defined(SOL_IPV6)
3030+
proto = SOL_IPV6;
3031+
type = IPV6_TCLASS;
3032+
break;
3033+
#else
3034+
TRUNCATE_TO(0,ptr);
3035+
continue;
30173036
#endif
30183037
case INET_OPT_REUSEADDR:
30193038
type = SO_REUSEADDR;

0 commit comments

Comments
 (0)