Darren,

Thanks for the review.  Your questions are very valid and some
that I asked myself while trying to come up with the solution.
See below.

Thanks,

John

On 11/ 7/11 02:45 AM, Darren Kenny wrote:
Hi John,

The code looks fine, but I have a question about the approach:

- Is it possible that the incremented port-count could conflict
   with an existing service?
Yes.  However, that is also true with our original port number 5555.
The good news is that this is just the advertised port number and
nothing is actually bound to it just yet on the system.  I know confusing.
I thought that when we registered the service the mdns daemon that
the port number would be allocated and reserved.  It is not.  It seems
that it is simply part of the stored data within the mdns daemon.

- Would it be better to not just increment the port, but to check
   specifically for the error in question, and only then do the
   increment - possibly repeating until it finds a free slot.

That would be awesome but the only errors that would correlate
for our specific case are:

    kDNSServiceErr_AlreadyRegistered
    kDNSServiceErr_NameConflict

However, when the servicename and ports are the same neither
are passed to the register_callback function.  In fact the error
code is always kDNSServiceErr_NoError.

- Or possibly a mix of this testing for the error and the
   existing solution - with the testing of the error to avoid
   conflict that could arise while picking ports?

Again, if we could determine that an error occurred then
we could take appropriate action like bumping the port
number until we find something that is available.


Thanks,

Darren.


On 04/11/2011 22:34, John Fischer wrote:
All,

Can I get a webrev review for CR 7042544:

     http://monaco.us.oracle.com/detail.jsf?cr=7042544
     multiple mdns errors with b164 as AI server
*
*The webrev is located at:


https://cr.opensolaris.org/action/browse/caiman/johnfisc/7042544-mdns-errors/

The fix increments the port number for the service being
registered as we iterate through the network interfaces.
Typically this would be undesirable but is OK as the auto
install clients use the text-record to determine the port
number.

aimdns_mod.py is the only thing impacted.  The unit tests:

     root@testhost:~/slim_source_aimdns/usr/src/tools/tests# ./slim_test
cmd/installadm/test/test_aimdns.py
     #862 test browse callback ... ok
     #863 test compare_ipv4 returns valid results ... ok
     #864 test _convert_cidr_mask returns something reasonable ... ok
     #865 test in_network returns valid results ... ok
     #866 test registration callback output ... ok

     ----------------------------------------------------------------------
     Ran 5 tests in 1.026s

     OK
     root@testhost:~/slim_source_aimdns/usr/src/tools/tests# ./slim_test
cmd/installadm/test/manual
     #2148 Test that AImDNS().browse returns True upon finding a service ... ok
     #2149 Test AImDNS().find() returns True when service is found and False
... ok
     #2150 Verify a unique service shows up for all interfaces listed ... ok

     ----------------------------------------------------------------------
     Ran 4 tests in 28.947s

     OK

Thanks,

John



_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

Reply via email to