Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1053098 - ipcalc netmask handling is invalid
Summary: ipcalc netmask handling is invalid
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: initscripts
Version: 6.5
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: Jan Ščotka
URL:
Whiteboard:
Depends On:
Blocks: 1138717
TreeView+ depends on / blocked
 
Reported: 2014-01-14 16:46 UTC by vlad.halilov
Modified: 2016-11-25 13:05 UTC (History)
1 user (show)

Fixed In Version: initscripts-9.03.42-1.el6
Doc Type: Bug Fix
Doc Text:
In ipcalc allow specifing netmask in "check" mode and be more strict when parsing netmask (previously non-numeric characters were skipped, now we reprot that as incorrect value).
Clone Of:
: 1138717 (view as bug list)
Environment:
Last Closed: 2014-10-14 06:27:55 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1448 0 normal SHIPPED_LIVE initscripts bug fix and enhancement update 2014-10-14 01:05:44 UTC

Description vlad.halilov 2014-01-14 16:46:51 UTC
Description of problem:
ipcalc utils handling netmask parameters incorrectly with '-c' option. one problem: ignoring invalid cidr, second - not accepting netmask in format allowed by manual.

Version-Release number of selected component (if applicable):


How reproducible:

problem one:
Steps to Reproduce:
1. ipcalc -c 128.34.34.2/FF;echo $?

Actual results:
not output
error code: 0

Expected results:
invalid mask, non-zero error code

and second:
Steps to Reproduce:
1. ipcalc -c 128.34.34.2 255.255.255.0

Actual results:

ipcalc: unexpected argument: 255.255.0.0
Usage: ipcalc [OPTION...]
  -c, --check         Validate IP address for specified address family
  -4, --ipv4          IPv4 address family (default)
  -6, --ipv6          IPv6 address family
  -b, --broadcast     Display calculated broadcast address
  -h, --hostname      Show hostname determined via DNS
  -m, --netmask       Display default netmask for IP (class A, B, or C)
  -n, --network       Display network address
  -p, --prefix        Display network prefix
  -s, --silent        Don't ever display error messages

Help options:
  -?, --help          Show this help message
  --usage             Display brief usage message

error code: 1


Expected results:

no ouput. error code zero.

Additional info:

Comment 2 Lukáš Nykrýn 2014-01-15 12:58:12 UTC
Thanks for the report, this should be fixed.

Comment 6 errata-xmlrpc 2014-10-14 06:27:55 UTC
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.

http://rhn.redhat.com/errata/RHBA-2014-1448.html


Note You need to log in before you can comment on or make changes to this bug.