[avahi] Making avahi work on Solaris

Padraig O'Briain Padraig.Obriain at Sun.COM
Thu May 25 01:51:19 PDT 2006


Lennart Poettering wrote:
> On Sat, 20.05.06 09:12, Padraig O'Briain (Padraig.Obriain at Sun.COM) wrote:
>
>   
>>> A quick search with Google tells me that SIOCGLIFCONF is hwat you're
>>> looking for.
>>>  
>>>       
>> It seems that on Solaris that SIOCGIFCONF will return IPv4 addresses and 
>> as the code I am writing will not be run on linux I will stick with 
>> SIOCGIFCONF, at least for the present.
>>     
>
> Hmm? But it returns *only* IPV4 addresses, doesn't it? It doesn't
> return interface names or IPv6 addresses, right? Both are required for Avahi.
>
>   

You are correct. I was misinformed. I have attached patch for 
iface-pfroute.c which seems to work for me.
>> I have noticed that AvahiHwInterface has a field called mac_address but 
>> I have noticed where it is used.
>>     
>
> It is used in the name of the pseudo service "_workstation._tcp".
>
>   
>> I have got to the stage where I am receiving packets but I have hot a 
>> strange problem problem which occurs on x86 but not on sparc:
>>
>> In avahi_recv_dns_packet_ipv4 the interface number is obtained from the 
>> message header of type IP_RECVIP. On x86 the interface number is zero.
>>
>> Can avahi work around this?
>>     
>
> Ahem. This doesn't look right to me. Perhaps there is an alternative
> API for this? Perhaps IP_PKTINFO or something? (like on linux)
>
> Either the local interface number or the local address the packet was
> recieved on is needed. The interface number is clearly preferable (because
> the same IP address might be assigned to more than one interface
>  - especially when there is something like IPv4LL), but the address
> should work, too. Maybe, Solaris has IP_RECVADDR?
>
> Avahi can't work around this. We need some information about the
> interface a packet came in from to distuinguish the different
> networks. Otherwise this could become a security hole.
>
> This looks like something that should be fixed in the Solaris kernel,
> shouldn't it?
>
>   
There seems to be some strange byte ordering going on here. The attached 
patch for socket.c works for me. I have not yet tracked down what the 
correct change is. It will probably be a few weeks before I do.

Another Solaris specific issue if that RLIMIT_NPROC is not defined on 
Solaris. the patch to main.c stops this from preventing avahi-daemon 
starting.

Padraig

> Lennart
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iface-pfroute.c.diff
Type: text/x-patch
Size: 6379 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/avahi/attachments/20060525/89798697/iface-pfroute.c-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: socket.c.diff
Type: text/x-patch
Size: 600 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/avahi/attachments/20060525/89798697/socket.c-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c.diff
Type: text/x-patch
Size: 637 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/avahi/attachments/20060525/89798697/main.c-0001.bin


More information about the avahi mailing list