Bug 997271
Summary: | ipcalc does not understand RFC3021 | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Telford Tendys <t-tendys> |
Component: | initscripts | Assignee: | Lukáš Nykrýn <lnykryn> |
Status: | CLOSED ERRATA | QA Contact: | Jan Ščotka <jscotka> |
Severity: | low | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.4 | CC: | jscotka, psklenar, t-tendys |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | initscripts-9.03.47-1.el6 | Doc Type: | Bug Fix |
Doc Text: |
Cause:
ipcalc did not know about rfc3021
Consequence:
Broadcast address was not computed correctly
Fix:
We have taught ipcalc that rfc3021 exists.
Result:
Broadcast address should be now correct.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2015-07-22 07:18:18 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Telford Tendys
2013-08-15 06:44:43 UTC
Can you please try this patch: diff --git a/src/ipcalc.c b/src/ipcalc.c index 7316f05..416180b 100644 --- a/src/ipcalc.c +++ b/src/ipcalc.c @@ -141,7 +141,11 @@ struct in_addr calc_broadcast(struct in_addr addr, int prefix) struct in_addr broadcast; memset(&broadcast, 0, sizeof(broadcast)); - broadcast.s_addr = (addr.s_addr & mask.s_addr) | ~mask.s_addr; + + if (mask.s_addr == htonl(0xFFFFFFFE)) + broadcast.s_addr = htonl(0xFFFFFFFF); + else + broadcast.s_addr = (addr.s_addr & mask.s_addr) | ~mask.s_addr; return broadcast; } I replied to the Bugzilla email, but does not seem to have updated... Yes the above patch worked for me (I tested by rebuilding SRPM). May I suggest a one-line comment in the source code mentioning RFC3021 (so people can find a reference explaining why it works that way, also in case anyone in future greps out the code looking for the RFC number) ? Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1380.html |