Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM toolchain statically linked binds /bin/sh #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void myexit(int a)
printf("%s\n",RESET);
if(keep_thread_running)
{
if(pthread_cancel(keep_thread))
if(pthread_kill(keep_thread,SIGUSR1))
{
mylog(log_warn,"pthread_cancel failed\n");
}
Expand Down
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@ int client_event_loop()
local_me.sin_addr.s_addr = local_ip_uint32;


if (bind(udp_fd, (struct sockaddr*) &local_me, slen) == -1) {
if (::bind(udp_fd, (struct sockaddr*) &local_me, slen) == -1) {
mylog(log_fatal,"socket bind error\n");
//perror("socket bind error");
myexit(1);
Expand Down Expand Up @@ -1436,7 +1436,7 @@ int server_event_loop()
temp_bind_addr.sin_port = htons(local_port);
temp_bind_addr.sin_addr.s_addr = local_ip_uint32;

if (bind(bind_fd, (struct sockaddr*)&temp_bind_addr, sizeof(temp_bind_addr)) !=0)
if (::bind(bind_fd, (struct sockaddr*)&temp_bind_addr, sizeof(temp_bind_addr)) !=0)
{
mylog(log_fatal,"bind fail\n");
myexit(-1);
Expand Down
2 changes: 1 addition & 1 deletion network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ int try_to_list_and_bind(int &fd,u32_t local_ip_uint32,int port) //try to bind
temp_bind_addr.sin_port = htons(port);
temp_bind_addr.sin_addr.s_addr = local_ip_uint32;

if (bind(fd, (struct sockaddr*)&temp_bind_addr, sizeof(temp_bind_addr)) !=0)
if (::bind(fd, (struct sockaddr*)&temp_bind_addr, sizeof(temp_bind_addr)) !=0)
{
mylog(log_debug,"bind fail\n");
return -1;
Expand Down