Bug 498568
Summary: | ipcalc could allow recombining netmask and offset to derive host address | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Philip Prindeville <philipp> |
Component: | initscripts | Assignee: | Bill Nottingham <notting> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | rawhide | CC: | dspaldin, iarlyy, notting, philipp, rvokal |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-06-02 01:21:57 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Philip Prindeville
2009-05-01 07:07:40 UTC
I'm not sure of the usecase for this - is this for static assignment on the client? Or just as a shortcut for doing the math? (In reply to comment #1) > I'm not sure of the usecase for this - is this for static assignment on the > client? Or just as a shortcut for doing the math? Yes, doing math for assigning devices to subordinate pool devices (like printers, VoIP phones, security cameras, etc) when you need to pre-populate a DHCP database from an init script... I'm not sure if this is the right component for this report, because is dhclient ( from package dhclient ) that set address ip to interfaces and initscripts only call them, afaik. Bill, what you think? Thanks for your report Philipp Keeping it as NEW. It's the correct component, but I'm not convinced it's a necessary fix. Heck, you can do the simple math in bash: BASE=50 for offset in 1 2 3 4 5 6 7 ; do echo "IPADDR=192.168.1.$((BASE+offset))" done (In reply to comment #4) > It's the correct component, but I'm not convinced it's a necessary fix. > > Heck, you can do the simple math in bash: > > BASE=50 > for offset in 1 2 3 4 5 6 7 ; do > echo "IPADDR=192.168.1.$((BASE+offset))" > done Ok, and what if my netmask is not a multiple of 8? What if I have a really large DHCP pool, say 192.168.2.2-192.168.3.63? There are other ipcalc features I've been thinking of, as well... various address relation operators. "lt", "in", "overlaps", etc. The fact of the matter is that IP addresses *can't* be handled as 4 unrelated small integers... it doesn't make sense. The only other possible fix is to add a built-in operator to bash's $(( ... )) that does dotted-quad to unsigned int and unsigned int to dotted-quad conversion so that then one could do arithmetic, comparisons, etc. |