Ticket #32 (closed defect: duplicate)

Opened 4 years ago

Last modified 15 months ago

sendmsg() failed: Invalid argument

Reported by: anonymous Owned by: lennart
Milestone: Component: avahi-core
Keywords: Cc:

Description

Distro: Slamd64-current

Kernel: 2.6.16.5 (tuned for athlon64)

I'm aware of previous problems with 64bit, so I tried compiling it and running again after removing 32bit compability libs and disabling 32bit emulation in kernel, however it didn't help. Apparently only that part of program don't work - avahi-discover shows services in 'Wide area' and program registers itself in multicast group. Any idea ?

Change History

Changed 4 years ago by lennart

  • status changed from new to assigned

hmmm, that seems strange. Have you ipv6 enabled in the daemon? Could you please paste your network configuration here? "ip addr" and "ip link" and "ip route", please.

Changed 4 years ago by lennart

Hmm, this bug report was made by some anonymous guy. Since there's no way to contact him I will close this bug in a week or so, unless the reporter responds.

Changed 4 years ago by lennart

a backtrace when the error happens would be cool too

Changed 4 years ago by nissarin@…

Here is configuration, I also added route to 224.0.0.0/8 (just in case..).

2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc sfq qlen 1000  
    link/ether 00:14:85:32:9d:cd brd ff:ff:ff:ff:ff:ff  
    inet 81.219.136.xx/24 brd 81.219.136.255 scope global eth0  
    inet6 fe80::214:85ff:fe32:9dcd/64 scope link   
       valid_lft forever preferred_lft forever  

Running latest version from svn, config.log:
configure --prefix=/usr --libdir=/usr/lib64 --disable-mono --sysconfdir=/etc --localstatedir=/var --enable-compat-howl --enable-compat-libdns_sd --disable-qt4
Kernel 2.6.16.9 with pom from svn, firewall policy configured to ACCEPT (another 'just in case').

root@radscorpion:/home/nissarin/src/avahi# avahi-daemon --debug
Found user 'avahi' (UID 1001) and group 'avahi' (GID 251).
Successfully dropped root privileges.
avahi-daemon 0.6.9 starting up.
Loading service file /etc/avahi/services/ssh.service.
New relevant interface eth0.IPv4 for mDNS.
Joining mDNS multicast group on interface eth0.IPv4 with address 81.219.136.xx.
Network interface enumeration completed.
Registering new address record for 81.219.136.xx on eth0.
Registering HINFO record with values 'X86_64'/'LINUX'.
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
Server startup complete. Host name is radscorpion.local. Local service cookie is 2864266424.
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
Service "Remote Terminal on radscorpion" (/etc/avahi/services/ssh.service) successfully established.
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument
sendmsg() failed: Invalid argument

And now some helpfull (I hope) info - with ipv4 or ipv4 & ipv6 enabled I get those errors, however avahi enabled on ipv6 only works fine.

Changed 4 years ago by lennart

That ipv6 works without issues means that we need to look for the error in the function avahi_send_dns_packet_ipv4() in avahi-core/socket.c.

Please go to that function, and comment the block starting with "if (interface > 0 src_address) {". Then recompile, test, and tell me if anything improved. As long as you have the multicast route set these lines shouldn't be necessary anyway.

Changed 4 years ago by lennart

Hmm, another question: where exactly did you route 224.0.0.0/8 to? If you drop that route does avahi's behaviour change in any way?

Changed 4 years ago by nissarin@…

Updated to latest version, commented out those lines, enabled ipv4, started daemon - no errors, browsing works (tried with and w/o that route).

Changed 4 years ago by lennart

(In [1199]) make the construction of the ancillary data for sendmsg() a bit more robust. (see #32)

Changed 4 years ago by anonymous

Could you please check if r1199 fixes the problem for you? It's just a shot into the dark, but please test.

if it doesn't change anything, please place a htonl() around the "src_address->address" term in that block:

pkti->ipi_spec_dst.s_addr = htonl(src_address->address);

It's not documented whether this IP address needs to be in host or in network endianess. It works here without it, but hmm, the error might be here.

Changed 4 years ago by anonymous

OK... first of all:

        main.c: In function `run_server':
        main.c:746: error: structure has no member named `use_chroot'

IMHO there should be one more #ifdef... anyway I comment out that one (it's from avahi-daemon/run_server).

Now bad news - update didn't help, htonl also.

Changed 4 years ago by lennart

I wonder how this is related to #35? Could apply the patch mentioned there and see if it works for you?

Consider installing libcap-dev. If you do you get chroot() support on Linux.

Changed 4 years ago by lennart

(In [1200]) fix compilation if chroot() is not available. (see #32)

Changed 4 years ago by nissarin@…

Reverted socket.c to version 6.9, applied patch, recompiled... same errors.

Changed 4 years ago by lennart

Whoops, sorry. that patch didn't change anything on Linux anyway.

I meant #19 and this patch actually:

http://avahi.org/attachment/ticket/19/03_cmsg_too_large.patch

Please apply, recompile, test...

Changed 4 years ago by nissarin@…

Applied to svn version, recompiled - no errors (so far ;) ).

Changed 4 years ago by lennart

  • status changed from assigned to closed
  • resolution set to duplicate

Ok, that means we can merge those two bugs. I will now mark this one as duplicate and reopen #19

Note: See TracTickets for help on using tickets.