Bug 1053098

Summary: ipcalc netmask handling is invalid
Product: Red Hat Enterprise Linux 6 Reporter: vlad.halilov
Component: initscriptsAssignee: Lukáš Nykrýn <lnykryn>
Status: CLOSED ERRATA QA Contact: Jan Ščotka <jscotka>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.5CC: psklenar
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
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).
Story Points: ---
Clone Of:
: 1138717 (view as bug list) Environment:
Last Closed: 2014-10-14 06:27:55 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:
Bug Depends On:    
Bug Blocks: 1138717    

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;echo $?

Actual results:
not output
error code: 0

Expected results:
invalid mask, non-zero error code

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

Actual results:

ipcalc: unexpected argument:
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.