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

Address family not supported by protocol (os error 124) #342

Closed
archandanime opened this issue Jan 10, 2024 · 4 comments
Closed

Address family not supported by protocol (os error 124) #342

archandanime opened this issue Jan 10, 2024 · 4 comments

Comments

@archandanime
Copy link

Log

WyzeCamV3 /media/mmc # ./dufs.mipsel-unknown-linux-musl  --allow-all /media/mmc
Error: Failed to bind `:::5000`

Caused by:
    Address family not supported by protocol (os error 124)

Environment:

  • Dufs version: 0.38.0
  • Browser/Webdav Info: Firefox 121.0
  • OS Info: Wyze cam v3, mipsel, Linux 3.10.14

Binary info:

It was compiled using Github action with:

RUSTFLAGS="-C target-feature=+crt-static" cross build --locked --release --target=mipsel-unknown-linux-musl --no-default-features

More info:

I compiled the binary statically because the camera firmware doesn't have musl library.

When running the dufs mipsel binary from my x64 laptop with qemu-user-static, dufs successfully runs and bind to my laptop IP address. However when running dufs form my camera, it seems to be unable to figure it's IP address as shown in the above log. Using bind address (-b option) with Unix socket works:

WyzeCamV3 /media/mmc # ./dufs.mipsel-unknown-linux-musl -b 0.0.0.0 --allow-all /media/mmc
Listening on:
  http://127.0.0.1:5000/
  http://192.168.10.21:5000/

Strace log:

execve("./dufs.mipsel-unknown-linux-musl", ["./dufs.mipsel-unknown-linux-musl", "--allow-all", "/media/mmc"], 0x7faaf478 /* 16 vars */) = 0
mmap2(NULL, 528, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b73000
set_thread_area(0x77b7a070)             = 0
set_tid_address(0x787cec)               = 15288
poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 0 (Timeout)
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTART|0x4000000}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 16) = 0
rt_sigaction(SIGSEGV, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 16) = 0
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 16) = 0
rt_sigaction(SIGSEGV, {sa_handler=0x61e298, sa_mask=[], sa_flags=SA_ONSTACK|SA_SIGINFO|0x4000000}, NULL, 16) = 0
rt_sigaction(SIGBUS, NULL, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 16) = 0
rt_sigaction(SIGBUS, {sa_handler=0x61e298, sa_mask=[], sa_flags=SA_ONSTACK|SA_SIGINFO|0x4000000}, NULL, 16) = 0
sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0
mmap2(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x77b70000
mprotect(0x77b70000, 4096, PROT_NONE)   = 0
sigaltstack({ss_sp=0x77b71000, ss_flags=0, ss_size=8192}, NULL) = 0
brk(NULL)                               = 0x8bc000
brk(0x8be000)                           = 0x8be000
mmap2(0x8bc000, 4096, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x8bc000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b6f000
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 16) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 16) = 0
svr4_symlink()                          = 4005
svr4_read()                             = 4220
svr4_syscall()                          = 4003
svr4_chown()                            = 4006
svr4_syscall()                          = 4005
svr4_read()                             = 4220
svr4_syscall()                          = -1 (errno 4210)
read(3, "", 8192)                       = 0
close(3)                                = 0
madvise(0x77b69000, 4096, MADV_FREE)    = -1 EINVAL (Invalid argument)
munmap(0x77b68000, 28672)               = 0
sched_getaffinity(0, 128, [0])          = 4
epoll_create1(EPOLL_CLOEXEC)            = 3
eventfd2(0, EFD_CLOEXEC|EFD_NONBLOCK)   = 4
epoll_ctl(3, EPOLL_CTL_ADD, 4, {events=EPOLLIN|EPOLLRDHUP|EPOLLET, data={u32=0, u64=0}}) = 0
fcntl64(3, F_DUPFD_CLOEXEC, 3)          = 5
fcntl64(5, F_SETFD, FD_CLOEXEC)         = 0
mmap2(NULL, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b6a000
socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0, [6, 7]) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b68000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b67000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b66000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b65000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b64000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b63000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b62000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b61000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b60000
fcntl64(6, F_DUPFD_CLOEXEC, 3)          = 8
fcntl64(8, F_SETFD, FD_CLOEXEC)         = 0
epoll_ctl(5, EPOLL_CTL_ADD, 8, {events=EPOLLIN|EPOLLRDHUP|EPOLLET, data={u32=1, u64=1}}) = 0
svr4_symlink()                          = -1 (errno 4263)
svr4_syscall()                          = -1 (errno 4210)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77b5e000
svr4_symlink()                          = -1 (errno 4263)
svr4_syscall()                          = -1 (errno 4210)
rt_sigprocmask(SIG_UNBLOCK, [RT_1 RT_2], NULL, 16) = 0
mmap2(NULL, 2109440, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7795a000
mprotect(0x7795c000, 2101248, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 16) = 0
clone(child_stack=0x77b5cbc0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|0x400000, parent_tid=[15292], tls=0x77b63c60, child_tidptr=0x787cec) = 15292
rt_sigprocmask(SIG_SETMASK, [], NULL, 16) = 0
mmap2(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77953000
mmap2(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7794b000
munmap(0x77953000, 16384)               = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77956000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77955000
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77953000
munmap(0x77953000, 8192)                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77954000
madvise(0x7794c000, 4096, MADV_FREE)    = -1 EINVAL (Invalid argument)
munmap(0x7794b000, 32768)               = 0
munmap(0x77955000, 4096)                = 0
svr4_symlink()                          = -1 (errno 4213)
svr4_syscall()                          = -1 (errno 4210)
getcwd("/media/mmc", 512)               = 11
munmap(0x77952000, 8192)                = 0
readlink("/media", 0x7fae9c98, 4092)    = -1 EINVAL (Invalid argument)
readlink("/media/mmc", 0x7fae9c98, 4096) = -1 EINVAL (Invalid argument)
svr4_symlink()                          = -1 (errno 4213)
svr4_syscall()                          = 4183
svr4_link()                             = 4180
svr4_getpid()                           = -1 (errno 4176)
syscall_0x6c4(0x9, 0x7faea390, 0x2000, 0, 0, 0, 0) = -1 (errno 4176)
svr4_getpid()                           = 4180
svr4_getpid()                           = -1 (errno 4176)
syscall_0x94(0x9, 0x7faea390, 0x2000, 0, 0, 0, 0) = -1 (errno 4176)
svr4_getpid()                           = 4006
svr4_syscall()                          = 4183
svr4_link()                             = -1 (errno 4054)
svr4_syscall()                          = 4006
svr4_syscall()                          = 4183
svr4_link()                             = -1 (errno 4054)
svr4_syscall()                          = 4006
svr4_syscall()                          = 4183
svr4_link()                             = -1 (errno 4181)
svr4_syscall()                          = 4169
svr4_syscall()                          = 4174
svr4_syscall()                          = 4054
svr4_syscall()                          = -1 (errno 4249)
svr4_syscall()                          = -1 (errno 4210)
write(4, "\1\0\0\0\0\0\0\0", 8)         = 8
socket(AF_INET6, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_TCP) = -1 EAFNOSUPPORT (Address family not supported by protocol)
write(4, "\1\0\0\0\0\0\0\0", 8)         = 8
futex(0x77b648c0, FUTEX_WAKE_PRIVATE, 2147483647) = 1
futex(0x77b64858, FUTEX_WAKE_PRIVATE, 1) = 1
munmap(0x7795a000, 2109440)             = 0
write(2, "Error: ", 7Error: )                  = 7
write(2, "Failed to bind `:::5000`", 24Failed to bind `:::5000`) = 24
write(2, "\n\nCaused by:", 12

Caused by:)          = 12
write(2, "\n", 1
)                       = 1
write(2, "    ", 4    )                     = 4
write(2, "Address family not supported by "..., 40Address family not supported by protocol) = 40
write(2, " (os error ", 11 (os error )             = 11
write(2, "124", 3124)                      = 3
write(2, ")", 1))                        = 1
write(2, "\n", 1
)                       = 1
munmap(0x77956000, 4096)                = 0
sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
munmap(0x77b70000, 12288)               = 0
exit_group(1)                           = ?
+++ exited with 1 +++

I can still make it work but don't know if this bug(maybe) is known, it would be nice to make a bug report.

@sigoden
Copy link
Owner

sigoden commented Jan 10, 2024

If --bind is omitted, dufs will bind default addresses: 0.0.0.0 (IPv4), :: (IPv6).
Your mipsel device won't support IPv6, which is why the error occurred.

Mainstream devices all support IPv6. For the few devices that do not support IPv6, one must manually specify the bind address instead of using the default bind addresses.

dufs -b 0.0.0.0 -A

@archandanime
Copy link
Author

May I ask you more more thing?

Is there any way to run dufs in "detached" mode beside putting & behind the command? If there is no such an option, I suggest adding it.

@sigoden
Copy link
Owner

sigoden commented Jan 10, 2024

No, please use systemd or something like that. @archandanime

@archandanime
Copy link
Author

Thank you for your support!

I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants