Erik Nordmark wrote:
> Girish Moodalbail wrote:
> 
>>> I can see two ways forward on that one:
>>> 1. Do not allow hostnames for create-addr at all.
>>> 2. Make a hostname lookup all the IPv4 and IPv6 addresses and create 
>>> a single object with all those addresses in it. I.e., not need for a -f.
>>
>> In case [2] above how will we be able to apply 'address' properties 
>> specific to v4 or v6 addresses.
> 
> You wouldn't be able to, just like you can't use ipadm to manipulate a 
> single IPv6 address assigned as part of ipadm create-ipv6addrs; you can 
> only manipulate the named object, which would be bge0/myhost.com.

Ok.

> 
>> Can we consider creating address using hostname as a special case of 
>> assigning static addresses to an interface?
>>
>> Once we have done that, we can individually refer the address using 
>> the tuple <interface, address>, which is the same tuple used to 
>> identify 'statically' added addresses.
> 
> That feels like being about to create a file using
>     creat("/tmp/foobar")
> but then being able to delete/unlink it using its inode number.
> 
> I think the architectural principle is that if you create something with 
> a given name, you use that same name when you modify the object and when 
> you delete it.

Agreed.

> 
>> for eg:
>>
>> #ipadm create-addr -i bge1 hostname
>> --> it returned 2 v4 addresses and 1 v6 address (v4addr1, 
>>                             v4addr2, v6addr1)
>>
>> #ipadm show-addr
>> --> displays all the addresses just assigned to the interface
>>
>> #ipadm set-addrprop -i bge1 -p <prop>=<val> v4addr1
>> --> sets the property on v4addr1.
>>
>> similarly we could do it for other addresses.
>>
>> For deletion, we select individual addresses using the tuple.
>>
>> Above should work, right?
> 
> No.
> 
> While one can try to get it to work in simple examples such as the 
> create-addr when getaddrinfo returns N addresses, I don't think there is 
> any sane semantics when it comes to stateless and DHCPv6; what would it 
> mean to delete one address out of the set assigned by stateless or DHCPv6?
> 
> Note that if we allow hostnames with create-addr (and we are not 
> changing the Solaris kernel) then libipadm has to do some extra work to 
> keep the association between the label and the address set. This is due 
> to the fact that getaddrinfo can return a different set of addresses at 
> different times.
> 
> Thus if I do
>     ipadm create-addr -i bge0 myhost.com
> and later do
>     ipadm delete-addr -i bge0 myhost.com
> then I want to delete the addresses I added, and not what getaddrinfo 
> returned at the time of the delete.

Ok.

Is "not allowing hostnames for create-addr at all" still an option for 
the first phase of 'ipadm'? Can we track this as a RFE and implement it 
later after the project is integrated.

thanks
~Girish




Reply via email to