<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>2502</bug_id>
          
          <creation_ts>2012-05-25 14:27:24 +0000</creation_ts>
          <short_desc>mDNS resolving is very slow</short_desc>
          <delta_ts>2013-01-03 13:07:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>connectivity</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>36d4dcfe6a3ad937caaae299923ae79b918520e1</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Constantin Musca">constantinx.musca</assigned_to>
          <cc>alexandru.damian</cc>
    
    <cc>alexandrux.palalau</cc>
    
    <cc>corneliux.stoicescu</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>sgw</cc>
    
    <cc>song.liu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>21620</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2012-05-25 14:27:24 +0000</bug_when>
    <thetext>nsswitch.conf says:

hosts: files dns mdns4

This means that for a .local lookup it does a DNS lookup *first*. Which will fail. Urgh.

The recommended solution is to use nss_mdns &gt;= 0.8 (released 2006) and:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

(see http://0pointer.de/lennart/projects/nss-mdns/)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21648</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2012-05-27 20:22:51 +0000</bug_when>
    <thetext>Prior art:

Fedora does http://pkgs.fedoraproject.org/gitweb/?p=nss-mdns.git;a=blob;f=nss-mdns.spec

Debian&apos;s postinst is in http://packages.debian.org/sid/libnss-mdns</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21878</commentid>
    <comment_count>2</comment_count>
    <who name="Cristian Iorga">cristian.iorga</who>
    <bug_when>2012-06-06 08:25:00 +0000</bug_when>
    <thetext>libnss_mdns has been updated to 0.10.

Bug still to be fixed for R1.3.

Regards,
Cristian</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21881</commentid>
    <comment_count>3</comment_count>
    <who name="Cristian Iorga">cristian.iorga</who>
    <bug_when>2012-06-06 09:30:48 +0000</bug_when>
    <thetext>Hi Ross,

Can you please provide a way to test case for this bug?

Thanks,
Cristian</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21882</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2012-06-06 10:02:03 +0000</bug_when>
    <thetext>$ ping somehost.local

Where somehost is the hostname of another machine on your network.  avahi-browse -a will list all the local ones.

On my Debian desktop with working mDNS the resolution happens in a fraction of a second:

$ time ping -c 1 base.local
PING base.local (192.168.1.3) 56(84) bytes of data.
64 bytes from base.local (192.168.1.3): icmp_req=1 ttl=64 time=2.37 ms

--- base.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.374/2.374/2.374/0.000 ms

real	0m0.108s
user	0m0.000s
sys	0m0.000s

(that&apos;s the first run, subsequent runs are ~0.01s real time because the lookup has been cached)

On my Yocto machine, the first resolution takes several seconds whilst the DNS is queried for a name that isn&apos;t in it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22747</commentid>
    <comment_count>5</comment_count>
    <who name="Cristian Iorga">cristian.iorga</who>
    <bug_when>2012-07-03 08:50:52 +0000</bug_when>
    <thetext>QA will give an ETA for testing this issue during WW27.

Regards,
Cristian</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23060</commentid>
    <comment_count>6</comment_count>
    <who name="Alexandru Palalau">alexandrux.palalau</who>
    <bug_when>2012-07-12 14:55:16 +0000</bug_when>
    <thetext>Tested with 1.3 on a FRI2
Core-image-sato-sdk
Behavior reporduces with the mentioned changes in /etc/nsswitch.conf.
Subsequent calls return the same result as the first call.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23062</commentid>
    <comment_count>7</comment_count>
    <who name="Cristian Iorga">cristian.iorga</who>
    <bug_when>2012-07-12 14:58:23 +0000</bug_when>
    <thetext>Investigation ongoing. Proposed solution is not sufficient.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26710</commentid>
    <comment_count>8</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2012-10-18 11:48:24 +0000</bug_when>
    <thetext>Fix applied in master: http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=36d4dcfe6a3ad937caaae299923ae79b918520e1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27266</commentid>
    <comment_count>9</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2012-11-06 16:53:43 +0000</bug_when>
    <thetext>1) The patch is applied in master but not in danny. Tested on jasperforest and sugarbay. 

&quot;
nsswitch.conf says:

hosts: files dns mdns4
&quot;

2) RP: I tried your suggested test plan on a master build with the patch applied and these are my results:
&quot;
root@qemuppc:~# time ping -c 1 NODE1.local
PING NODE1.local (192.168.7.1): 56 data bytes
64 bytes from 192.168.7.1: seq=0 ttl=64 time=4.335 ms

--- NODE1.local ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 4.335/4.335/4.335 ms

real    0m0.081s
user    0m0.036s
sys     0m0.036s
root@qemuppc:~# time ping -c 1 NODE1.local
PING NODE1.local (192.168.7.1): 56 data bytes
64 bytes from 192.168.7.1: seq=0 ttl=64 time=0.568 ms

--- NODE1.local ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.568/0.568/0.568 ms

real    0m0.045s
user    0m0.004s
sys     0m0.032s
root@qemuppc:~# time ping -c 1 NODE1.local
PING NODE1.local (192.168.7.1): 56 data bytes
64 bytes from 192.168.7.1: seq=0 ttl=64 time=0.521 ms

--- NODE1.local ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.521/0.521/0.521 ms

real    0m0.036s
user    0m0.004s
sys     0m0.020s
&quot;

It would seem a dns lookup is done judging by the ping timers.

3) Ignoring the ping timers, the ping itself is successful on both danny (with no patch) and master (with patch). The hostname resolution is done using mdns as dns does not know of NODE1.local .</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28517</commentid>
    <comment_count>10</comment_count>
    <who name="Constantin Musca">constantinx.musca</who>
    <bug_when>2013-01-03 12:59:23 +0000</bug_when>
    <thetext>The problem has been fixed in commit 36d4dcfe6a3ad937caaae299923ae79b918520e1.

Cheers,
Constantin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>28520</commentid>
    <comment_count>11</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2013-01-03 13:07:24 +0000</bug_when>
    <thetext>Verified in master: 36d4dcfe6a3ad937caaae299923ae79b918520e1 . Will open a new one for danny.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>