Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
16
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
172cd756
Commit
172cd756
authored
6 months ago
by
Constantin P.
💬
Browse files
Options
Downloads
Patches
Plain Diff
Hotfix 12923
parent
69015820
No related branches found
Branches containing commit
No related tags found
1 merge request
!1784
Hotfix 12923
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dap-sdk
+1
-1
1 addition, 1 deletion
dap-sdk
modules/net/dap_chain_net.c
+12
-23
12 additions, 23 deletions
modules/net/dap_chain_net.c
modules/net/dap_chain_net_node_list.c
+1
-1
1 addition, 1 deletion
modules/net/dap_chain_net_node_list.c
with
14 additions
and
25 deletions
dap-sdk
@
c9259b99
Compare
1587a436
...
c9259b99
Subproject commit
1587a436ec9231ac3bb485e74cc5ec2a7534efd5
Subproject commit
c9259b9949a44daee571d2fff3bdc329758ba68a
This diff is collapsed.
Click to expand it.
modules/net/dap_chain_net.c
+
12
−
23
View file @
172cd756
...
...
@@ -2369,32 +2369,21 @@ bool s_net_load(void *a_arg)
if
(
l_chain
->
callback_created
)
l_chain
->
callback_created
(
l_chain
,
l_net
->
pub
.
config
);
if
(
dap_config_get_item_bool_default
(
g_config
,
"server"
,
"enabled"
,
false
)
)
{
char
l_host
[
DAP_HOSTADDR_STRLEN
+
1
]
=
{
'\0'
};
uint16_t
l_ext_port
=
0
;
const
char
*
l_ext_addr
=
dap_config_get_item_str_default
(
g_config
,
"server"
,
"ext_address"
,
NULL
);
if
(
l_ext_addr
)
{
struct
sockaddr_storage
l_saddr
=
{
};
if
(
0
>
dap_net_parse_config_address
(
l_ext_addr
,
l_host
,
&
l_ext_port
,
&
l_saddr
,
NULL
)
)
log_it
(
L_ERROR
,
"Invalid server address
\"
%s
\"
, fix config and restart node"
,
l_ext_addr
);
if
(
dap_config_get_item_bool_default
(
g_config
,
"server"
,
"enabled"
,
false
)
)
{
char
l_local_ip
[
INET6_ADDRSTRLEN
]
=
{
'\0'
};
uint16_t
l_in_port
=
0
;
const
char
**
l_listening
=
dap_config_get_array_str
(
g_config
,
"server"
,
DAP_CFG_PARAM_LISTEN_ADDRS
,
NULL
);
if
(
l_listening
)
{
if
(
dap_net_parse_config_address
(
*
l_listening
,
l_local_ip
,
&
l_in_port
,
NULL
,
NULL
)
<
0
)
log_it
(
L_ERROR
,
"Invalid server IP address, check [server] section in cellframe-node.cfg"
);
else
{
uint8_t
l_hostlen
=
dap_strlen
(
l_host
);
l_net_pvt
->
node_info
->
ext_port
=
l_ext_port
;
l_net_pvt
->
node_info
->
ext_host_len
=
dap_strncpy
(
l_net_pvt
->
node_info
->
ext_host
,
l_host
,
l_hostlen
)
-
l_net_pvt
->
node_info
->
ext_host
;
// power of short-circuit
if
(
l_in_port
||
(
l_in_port
=
dap_config_get_item_int16_default
(
g_config
,
"server"
,
DAP_CFG_PARAM_LEGACY_PORT
,
8079
)))
log_it
(
L_INFO
,
"Server is enabled on
\"
%s : %u
\"
"
,
l_local_ip
,
l_in_port
);
if
((
l_net_pvt
->
node_info
->
ext_port
=
dap_config_get_item_uint16
(
g_config
,
"server"
,
"ext_port"
)
))
log_it
(
L_INFO
,
"Set external port %u for adding in node list"
,
l_net_pvt
->
node_info
->
ext_port
);
}
}
#ifdef DAP_TRY_DEFAULT_PORT
log_it
(
L_INFO
,
"External address is not set, will be detected automatically"
);
if
(
!
l_net_pvt
->
node_info
->
ext_port
)
{
const
char
**
l_listening
=
dap_config_get_array_str
(
g_config
,
"server"
,
DAP_CFG_PARAM_LISTEN_ADDRS
,
NULL
);
l_net_pvt
->
node_info
->
ext_port
=
(
l_listening
&&
dap_net_parse_config_address
(
*
l_listening
,
NULL
,
&
l_ext_port
,
NULL
,
NULL
)
>
0
&&
l_ext_port
)
?
l_ext_port
:
dap_config_get_item_int16_default
(
g_config
,
"server"
,
DAP_CFG_PARAM_LEGACY_PORT
,
8079
);
}
#endif
log_it
(
L_INFO
,
"Server is configured with external address %s : %u"
,
l_net_pvt
->
node_info
->
ext_host_len
?
l_net_pvt
->
node_info
->
ext_host
:
""
,
l_net_pvt
->
node_info
->
ext_port
);
}
l_net_pvt
->
node_info
->
address
.
uint64
=
g_node_addr
.
uint64
;
...
...
This diff is collapsed.
Click to expand it.
modules/net/dap_chain_net_node_list.c
+
1
−
1
View file @
172cd756
...
...
@@ -230,7 +230,7 @@ static int dap_chain_net_node_list_wait(struct node_link_request *a_node_list_re
return
a_node_list_request
->
response
;
}
struct
timespec
l_cond_timeout
;
clock_gettime
(
CLOCK_
MONOTONIC
,
&
l_cond_timeout
);
clock_gettime
(
CLOCK_
REALTIME
,
&
l_cond_timeout
);
l_cond_timeout
.
tv_sec
+=
a_timeout_ms
/
1000
;
while
(
!
a_node_list_request
->
response
)
{
int
l_wait
=
pthread_cond_timedwait
(
&
a_node_list_request
->
wait_cond
,
&
a_node_list_request
->
wait_mutex
,
&
l_cond_timeout
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment