-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] IPaddr2: Proposal patch to support the dual stack of IPv4 and IPv6. #97
Conversation
…Pv6. This patch is for reviewing and for discussions by the community and not intended to be merged as is at this moment.
Thanks Mori-san! One quick thought here:
Can |
Thank you for your comments, Florian! I found that ipcalc is available on Red Hat and CentOS (and probably Fedora too), but openSUSE does not seem to have ipcalc by the default installation as long as I can see. (I tried openSUSE 11.2 and 12.1) Anyway I think that we can just remove brd option to /bin/ip and let /bin/ip calculate a broadcast. I will look into this way. |
ipcalc is probably available in all Linux distros in one way or another, and probably on *BSD as well, but it's not in the default installation in some of them, so you'll need to add it to the list of dependencies if you use it |
Hi,
I also found that there exists a several different implementations of ipcalc, and they have a different usage and a different output. The one in Debian is written in Perl, the output is good for human but requires parsing in shell scripting. Another one in I think we should avoid to depend on ipcalc.
|
I've updated the patch.
This is no longer required.
This limitation is also removed with the same reason as above.
This error check is added. I'd appreciate for your further comments. |
It'd be good to retain the same usage in findif. The reasoning: there could be IPaddr2 clones out there and those resources would break then. I know that it's not our responsibility, but if we can prevent it, why not. Of course, if there's a good reason for the change, then we can go that route too. |
Sorry for responding so late...
Yes, I totally agree with you, and I believe that the changes in the findif semantics are considered a bug (test case No.6, No.9 for example) and nobody has been expecting this behavior. If you have any particular concerns about a change please let me know so that we will figure out them. Also we can keep including the old findif binary to the package so that such clones can continue to use it and they can rewrite to use find.sh any time they are convenient. |
On Wed, Sep 12, 2012 at 10:36:26PM -0700, Keisuke MORI wrote:
No problem.
Oh, I missed that the new script would have a different name. |
Keisuke-san, I think that we can commit this. No other way it'll get properly tested :) Would you be so kind. |
OK, I will rework the patches appropriately to be merged into the upstream, and submit another pull request for that. |
Again, apollogies for not having this sent out when I wrote it, I realize the pull request has meanwhile been closed, Still I'll just send these comments as I wrote them back then, At the end, there is a bit of comment how to maybe re-implement Feel free to ignore for now, though. ;-) On Wed, May 30, 2012 at 11:20:03PM -0700, Keisuke MORI wrote:
Github pull request comments are IMO not the best place to discuss these
IPv6addr is supposed to run on non-Linux as well.
If we do not specify the broadcast at all, ip will do the "right thing"
We really need to avoid breaking existing configurations.
There may even be use cases for link-local addresses. We could always have a few helpers in C, still.
diff --git a/heartbeat/findif.sh b/heartbeat/findif.sh +ipcheck_ipv6() { +ifcheck_ipv4() {
local ifstr rest
btw, in bash, I tend to use _ as dummymuch more readablelocal tmp ifstr
|
Hi Lars, Thank you for your comments, 2012/10/16 Lars Ellenberg lars@linbit.com:
Agreed.
It has been fixed and the latest code in the repo now should work like you said.
It has also been fixed now and loopback can be used as same as before.
This check is done by simply matching fe80:: prefix as Alan's suggestion
Regards, Keisuke MORI |
This is a proposal enhancement of IPaddr2 to support IPv6 as well as IPv4.
I would appreciate your comments and suggestions for merging this into the upstream.
NOTE: This pull request is meant for reviewing the code and discussions, and not intended to be merged as is at this moment.
Benefits:
Unify the usage, behavior and the code maintenance between IPv4 and IPv6 on Linux.
The usage of IPaddr2 and IPv6addr are similar but they have different parameters and different behaviors. In particular, they may choose a different interface depending on your configuration even if you provided similar parameters in the past.
IPv6addr is written in C and rather hard to make improvements. As /bin/ip already supports both IPv4 and IPv6, we can share the most of the code of IPaddr2 written in bash.
usable for LVS on IPv6.
IPv6addr does not support lvs_support=true and unfortunately there is no possible way to use LVS on IPv6 right now.
IPaddr2(/bin/ip) works for LVS configurations without enabling lvs_support both for IPv4 and IPv6.
(You don't have to remove an address on the loopback interface if the virtual address is assigned by using /bin/ip.)
See also:
http://www.gossamer-threads.com/lists/linuxha/dev/76429#76429
retire the old 'findif' binary.
'findif' binary is replaced by a shell script version of findif, originally developed by lge.
See
findif
could be rewritten in shell #53 : findif could be rewritten in shelleasier support for other pending issues
These pending issues can be fix based on this new IPaddr2.
Notes / Changes:
findif semantics changes
There are some incompatibility in deciding which interface to be used when your configuration is ambiguous. But in reality it should not be a problem as long as it's configured properly.
The changes mostly came from fixing a bug in the findif binary (returns a wrong broadcast) or merging the difference between (old)IPaddr2 and IPv6addr.
See the ofct test cases for details. (case No.6, No.9, No.10, No.12, No.15 in IPaddr2v4 test cases)
Other notable changes are described below.
"broadcast" parameter for IPv4
"broadcast" parameter may be required along with "cidr_netmask" when you want use a different subnet mask from the static IP address. It's because doing such calculation is difficult in the shell
script version of findif.
See the ofct test cases for details. (case No.11, No.14, No.16, No.17 in IPaddr2v4 test cases)
This limitation may be eliminated if we would remove brd options from the /bin/ip command line.
loopback(lo) now requires cidr_netmask or broadcast.
See the ofct test case in the IPaddr2 ocft script. The reason is similar to the previous one.
loose error check for "nic" for a IPv6 link-local address.
IPv6addr was able to check this, but in the shell script it is hard to determine a link-local address (requires bitmask calculation). I do not think it's worth to implement it in shell.
send_ua: a new binary
We need one new binary as a replacement of send_arp for IPv6 support. IPv6addr.c is reused to make this command.
Note that IPv6addr RA is still there and you can continue to use it for the backward compatibility.
Acknowledgement
Thanks to Tomo Nozawa-san for his hard work for writing and testing this patch.
Thanks to Lars Ellenberg for the first findif.sh implementation.