Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
7792-kernel-Fix-inet_sockopt_SUITE-multiple_raw...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 7792-kernel-Fix-inet_sockopt_SUITE-multiple_raw-test-case.patch of Package erlang
From f89038baec8bdaf4299d289762e87a3e3f3377ff Mon Sep 17 00:00:00 2001 From: Rickard Green <rickard@erlang.org> Date: Mon, 27 Feb 2023 15:53:40 +0100 Subject: [PATCH 2/4] [kernel] Fix inet_sockopt_SUITE:multiple_raw* test cases --- lib/kernel/test/inet_sockopt_SUITE.erl | 41 ++++++++++--------- .../inet_sockopt_SUITE_data/sockopt_helper.c | 6 +++ 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/lib/kernel/test/inet_sockopt_SUITE.erl b/lib/kernel/test/inet_sockopt_SUITE.erl index 3670994088..bfb06505da 100644 --- a/lib/kernel/test/inet_sockopt_SUITE.erl +++ b/lib/kernel/test/inet_sockopt_SUITE.erl @@ -34,6 +34,7 @@ -define(C_GET_SO_REUSEADDR,14). -define(C_GET_SO_KEEPALIVE,15). -define(C_GET_SO_LINGER,16). +-define(C_GET_SO_DONTROUTE,17). -define(C_GET_LINGER_SIZE,21). -define(C_GET_TCP_INFO_SIZE,22). @@ -206,56 +207,56 @@ do_multiple_raw(Config, Binary) -> SoKeepalive = ask_helper(Port, ?C_GET_SO_KEEPALIVE), SoKeepaliveTrue = {raw,SolSocket,SoKeepalive,<<1:32/native>>}, SoKeepaliveFalse = {raw,SolSocket,SoKeepalive,<<0:32/native>>}, - SoReuseaddr = ask_helper(Port, ?C_GET_SO_REUSEADDR), - SoReuseaddrTrue = {raw,SolSocket,SoReuseaddr,<<1:32/native>>}, - SoReuseaddrFalse = {raw,SolSocket,SoReuseaddr,<<0:32/native>>}, + SoDontroute = ask_helper(Port, ?C_GET_SO_DONTROUTE), + SoDontrouteTrue = {raw,SolSocket,SoDontroute,<<1:32/native>>}, + SoDontrouteFalse = {raw,SolSocket,SoDontroute,<<0:32/native>>}, {S1,S2} = create_socketpair( - [SoReuseaddrFalse,SoKeepaliveTrue], - [SoKeepaliveFalse,SoReuseaddrTrue]), - {ok,[{reuseaddr,false},{keepalive,true}]} = - inet:getopts(S1, [reuseaddr,keepalive]), + [SoDontrouteFalse,SoKeepaliveTrue], + [SoKeepaliveFalse,SoDontrouteTrue]), + {ok,[{dontroute,false},{keepalive,true}]} = + inet:getopts(S1, [dontroute,keepalive]), {ok, - [{raw,SolSocket,SoReuseaddr,S1R1}, + [{raw,SolSocket,SoDontroute,S1R1}, {raw,SolSocket,SoKeepalive,S1K1}]} = inet:getopts( S1, - [{raw,SolSocket,SoReuseaddr,binarify(4, Binary)}, + [{raw,SolSocket,SoDontroute,binarify(4, Binary)}, {raw,SolSocket,SoKeepalive,binarify(4, Binary)}]), true = nintbin2int(S1R1) =:= 0, true = nintbin2int(S1K1) =/= 0, - {ok,[{keepalive,false},{reuseaddr,true}]} = - inet:getopts(S2, [keepalive,reuseaddr]), + {ok,[{keepalive,false},{dontroute,true}]} = + inet:getopts(S2, [keepalive,dontroute]), {ok, [{raw,SolSocket,SoKeepalive,S2K1}, - {raw,SolSocket,SoReuseaddr,S2R1}]} = + {raw,SolSocket,SoDontroute,S2R1}]} = inet:getopts( S2, [{raw,SolSocket,SoKeepalive,binarify(4, Binary)}, - {raw,SolSocket,SoReuseaddr,binarify(4, Binary)}]), + {raw,SolSocket,SoDontroute,binarify(4, Binary)}]), true = nintbin2int(S2K1) =:= 0, true = nintbin2int(S2R1) =/= 0, %% ok = inet:setopts( - S1, [SoReuseaddrTrue,SoKeepaliveFalse]), + S1, [SoDontrouteTrue,SoKeepaliveFalse]), ok = inet:setopts( - S2, [SoKeepaliveTrue,SoReuseaddrFalse]), + S2, [SoKeepaliveTrue,SoDontrouteFalse]), {ok, - [{raw,SolSocket,SoReuseaddr,S1R2}, + [{raw,SolSocket,SoDontroute,S1R2}, {raw,SolSocket,SoKeepalive,S1K2}]} = inet:getopts( S1, - [{raw,SolSocket,SoReuseaddr,binarify(4, Binary)}, + [{raw,SolSocket,SoDontroute,binarify(4, Binary)}, {raw,SolSocket,SoKeepalive,binarify(4, Binary)}]), true = nintbin2int(S1R2) =/= 0, true = nintbin2int(S1K2) =:= 0, {ok, [{raw,SolSocket,SoKeepalive,S2K2}, - {raw,SolSocket,SoReuseaddr,S2R2}]} = + {raw,SolSocket,SoDontroute,S2R2}]} = inet:getopts( S2, [{raw,SolSocket,SoKeepalive,binarify(4, Binary)}, - {raw,SolSocket,SoReuseaddr,binarify(4, Binary)}]), + {raw,SolSocket,SoDontroute,binarify(4, Binary)}]), true = nintbin2int(S2K2) =/= 0, true = nintbin2int(S2R2) =:= 0, %% @@ -870,7 +871,7 @@ all_listen_options() -> {reuseaddr,false,true,mandatory_reuseaddr(OsType,OsVersion),true}, {reuseport,false,true,mandatory_reuseport(OsType,OsVersion),true}, {reuseport_lb,false,true,mandatory_reuseport_lb(OsType,OsVersion),true}, - {exclusiveaddruse,false,true,mandatory_exclusiveaddruse(OsType,OsVersion),true}, + {exclusiveaddruse,false,true,mandatory_exclusiveaddruse(OsType,OsVersion),false}, {keepalive,false,true,true,true}, {linger, {false,10}, {true,10},true,true}, {sndbuf,2048,4096,false,true}, diff --git a/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c b/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c index 9c8f8eb91a..31d82f4ba4 100644 --- a/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c +++ b/lib/kernel/test/inet_sockopt_SUITE_data/sockopt_helper.c @@ -40,6 +40,7 @@ #define C_GET_SO_REUSEADDR 14 #define C_GET_SO_KEEPALIVE 15 #define C_GET_SO_LINGER 16 +#define C_GET_SO_DONTROUTE 17 #define C_GET_LINGER_SIZE 21 #define C_GET_TCP_INFO_SIZE 22 @@ -135,6 +136,11 @@ int main(void){ res = sizeof(struct linger); break; #endif +#ifdef SO_DONTROUTE + case C_GET_SO_DONTROUTE: + res = SO_DONTROUTE; + break; +#endif #if defined(TCP_INFO) && defined(HAVE_LINUX_TCP_H) case C_GET_TCP_INFO_SIZE: res = sizeof(struct tcp_info); -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor