Bug 200359 - ifconfig(8) alias and -alias behave differently
Summary: ifconfig(8) alias and -alias behave differently
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-21 07:27 UTC by Kurt Jaeger
Modified: 2015-05-21 07:40 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Jaeger freebsd_committer freebsd_triage 2015-05-21 07:27:21 UTC
This works:
# ifconfig re0 alias 192.168.1.12/24

The inverse does not work:
# ifconfig re0 -alias 192.168.1.12/24
ifconfig: 192.168.1.12/24: bad value

It only works without the netmask:
# ifconfig re0 -alias 192.168.1.12

- it should probably work if a netmask is given
- the netmask could be ignored
- or the alias would only be removed if the proper netmask is given
Comment 1 Bjoern A. Zeeb freebsd_committer freebsd_triage 2015-05-21 07:36:59 UTC
alias and -alias belong to the end of the command line.  The fact that they mostly work on the front (and only for net imho) is a historic behaviour.

Could you please try your tests again with alias and -alias at the end just to be sure that this is actually the issue you are thinking of (bad outclass being constructed/bad matching logic) and not interference with -alias?   I would assume the behaviour not to change but want to rule it out.
Comment 2 Kurt Jaeger freebsd_committer freebsd_triage 2015-05-21 07:40:32 UTC
Thanks for the hint, this works:

# ifconfig re0 192.168.1.12/24 alias
# ifconfig re0 192.168.1.12/24 -alias
#

So, it's just not working if the alias is given before the IP. Still
looks a bit inkonsistent 8-}