On (07/15/09 00:01), Peter Memishian wrote: > > > So does the following > > ipadm create-addr -i <intf> [-a laddr[,raddr]] <label> > > offer potential for confusion? > > (an address pair will be needed for tunnels. <label> will be > > used to generate the local address, when no -a arg is supplied) > > So the proposal is to use the label to do a hostname lookup and attempt to > derive the address from that? Doesn't that only further the strange > duality between labels and hostnames? That is, when the admin first does > a create-addr, the label doubles as a hostname in that it is looked up to > determine an IP address. However, after that point the label is just > treated as a label, and even if the hostname is changed to refer to a > different IP address, the label (with the same name as the hostname) > continues to refer to the old address -- until a delete-addr is done and > another create-addr is done with the label, in which case it then gets the > latest address. Or have I misunderstood what you're proposing?
yes - I have to divorce the hostname-label linkage after the create to retain predictability (i.e., so that set-addrprop/delete-addr etc don't go and operate on the wrong address). For example, let's say someone did # vi /etc/hosts # setup an entry for myhost # ipadm create-addr ... myhost some time later, the admin decides to renumber myhost. so they edit /etc/hosts again. Now the expected behavior for a command like set-addrprop would be to operate on the old ipaddress (if it tried to operate on the new address it would be forced to return "not available"). Which is why I first suggested having separate args like "-a myhost <label>", so that it's clear that the target of the addr commands is different from the string used to consult the resolver. BTW, one thing that Vasumathi pointed out: in the proposal ipadm create-addr -i <intf> [-a laddr[,raddr]] <label> the label has to start with an alphabet (i.e, it can't be 10.1.2.3/24, or we'd fall into the "is the mask needed for the other commands" rut). --Sowmini
