Ethan,

Thanks for looking into these issues.
See below.

Thanks,

John

On 02/18/11 02:49 PM, Ethan Quach wrote:
544-550 - does this logic account for the fact that if exclude_network == false, and networks == 0.0.0.0/0, (these are the default values) then we really want to include all of the systems networks? This block comment above at 528-539 does not indicate that.

It does account for the exclude_network == false and networks == 0.0.0.0/0. The main difference here was that the code needed to handle the case where these were uninitialized. I will be handling
that case differently now, see the answer below.

544 - for the case where networks == 0.0.0.0/0, is self.networks None here or will we enter this if clause?

I am handling it differently. In __init__() I set the networks and exclude_networks to their defaults (0.0.0.0/0, false respectively). Then in the case that the tool is registering I check to see if these have truly been initialized and if not then I do the original function calls from __init__().


I'm still not quite following here. Let's say we're currently processing some interface address, 10.0.0.1, and the 'self.exclude' and 'self.networks' are set to their default values. At 543, wouldn't 'in_net' be set to False? And if so, we'd not enter the if at 545, and we wouldn't set 'include_it' to True. Which means we just continue at 549. Doesn't that mean we're skipping interface 10.0.0.1 ?

No. If the interface is 10.0.0.1 and networks is the default (0.0.0.0/0) then in_net will
be true.

johnf@solaris:507 $ python2.6
Python 2.6.4 (r264:75706, Jan 16 2011, 12:34:46) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> from aimdns_mod import _convert_ipv4 as _convert_ipv4
>>> from aimdns_mod import _convert_cidr_mask as _convert_cidr_mask
>>> from aimdns_mod import compare_ipv4 as compare_ipv4
>>> from aimdns_mod import in_networks as in_networks
>>> in_net = in_networks('10.0.0.1/24', ['0.0.0.0/0'])
>>> print in_net
True

Since it is True the evaluation at line 545 causes the include_it to be True.
The above was done from usr/src/cmd/installadm.  I also tried the IP address
with a mask of 32 and without a mask (10.0.0.1) which both succeeded.

806-812 - For browse, why do we need to ask the SMF service for the number of install services that are configured on the local system? Browse, is supposed to be an outward looking query, so the number of services we have configured on the running host seems irrelevant.

Right, this is more of an educated guess only.

Some history....

As you will recall dns-sd loops indefinitely that is because it is attempting to get all the services that are registered. However, that has the undesirable side effect of our various tools needing to kill the application after some set time (typically it was 5 seconds).

Yeah, I recall this, but that was a command-line interface. I was under the impression that with us now calling into a library to interact with mdns, there'd be more finer grained interfaces for us to get exactly what we need without having to query the open wild to verify local services.

Right. But we are only making an "educated guess" as to how many times we need to loop within the processing cycle. If we under process then we might miss some services. For the case of the client we are only interested in the single service anyhow. In the case of being on the server we get a reasonable number without looping indefinitely
nor too little.

If I recall correctly we discussed this a while back and even though neither of us liked it it was better then setting an arbitrary number which is what I did originally.

aimdns was designed to loop a reasonable number of times. Originally that was 5 times with a timeout of 1 second for the select call within the process loop. What I found was that sometimes that was insufficient. So I came up with an educated guess of the number of local services * the number of interfaces should be sufficient for all the registered services to get processed.

So it seems to me that perhaps this browse function isn't a generic "browse" function at all (which could be my disconnect here, because I'm assuming it's supposed to be).

Well again it is just a guess. It could be a number like 5 * number of interfaces if you like but that might miss some services. Again this is only a server side "educated guess".

Its internals (per this loop count) seem to be catered toward the use on the AIl of the install services from the local machine. Would you agree?

Sure. So how long to loop then? Or what's the alternative algorithm? Again, this is really only server side since the client side will fail the smf.AISCF() call with the exception because the
service does not exist.
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

Reply via email to