Proposal ipv6_addrs_common

Hiroki Sato hrs at FreeBSD.org
Tue Feb 7 08:09:09 UTC 2012


Dirk Engling <erdgeist at erdgeist.org> wrote
  in <4F3088C8.9090505 at erdgeist.org>:

er> - From my understanding all that's to do is to match the ifconfig
er> parameter syntax and expand ip addresses. There's several ways to do that.
er>
er> You can just accept them as positional paramters in a function, and
er> then shift them out one by one, matching inet and inet6, switching
er> state and returning an expanded string to be executed by the caller.
er>
er> You can also match
er>
er>   [ ${foo#inet} = ${foo} ] || foo=`expand_ipv4 ${foo}`
er>
er> or
er>
er>   case ${foo} in "inet *") ... ; case "inet6 *") ;;

 Ah, I see.  This looks good.  I will give it a try and investigate
 corner cases.

er> to do the actual work. What exactly is the newline for in that case?
er> To make it clearer where single invocations of ifconfig need to be
er> separated?
er>
er> There is no need to introduce any split characters, as inet and inet6
er> by themself act as such. In fact, they're not even needed as from the
er> parameter itself the address family should become clear. I never
er> understood why the code insist so heavily on the user to specify the
er> inet and inet6 keywords. Any particular reason?

 This is because it is unclear that which address family will be used
 to recognize an address without AF keyword.  In most cases
 network-related utilities/scripts assume IPv4 by default and require
 a modifier or option for the others.  It works, but sometimes it
 requires a complex and inconsistent address handling in
 utilities/scripts.  Appending AF keyword burdens users a bit but
 simplifies multiple address family support in more consistent manner.

-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20120207/9b617335/attachment.pgp


More information about the freebsd-rc mailing list