Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 598078 - net-misc/netifrc-0.5.0 - error when using netmask notation
Summary: net-misc/netifrc-0.5.0 - error when using netmask notation
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: netifrc (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard:
Keywords:
: 598156 (view as bug list)
Depends on:
Blocks: 598190
  Show dependency tree
 
Reported: 2016-10-25 13:29 UTC by asears
Modified: 2016-10-27 14:00 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description asears 2016-10-25 13:29:19 UTC
When using netmask notation in config_<interface>, an error is received on startup:
Error: inet prefix is expected rather than "10.10.2.178//16"

It would appear that an extra slash is being added. Using CIDR notation works normally.

Reproducible: Always

Steps to Reproduce:
1. Set config_<interface> in /etc/conf.d/net to a static IP using netmask e.g. "192.168.1.1 netmask 255.255.255.0"
2. Restart net.<interface>

Actual Results:  
script calls command
ip addr add 192.168.1.1//24 broadcast + dev <interface>
Error: inet prefix is expected rather than "192.168.1.1//24".

Expected Results:  
script calls command
ip addr add 192.168.1.1/24 broadcast + dev <interface>
(no error)
Comment 1 Andrés Becerra Sandoval 2016-10-26 18:14:42 UTC
I have the same bug. Downgrading to 0.4.0-r1 fixes static network for me.
Comment 2 Brian Evans (RETIRED) gentoo-dev 2016-10-26 18:45:03 UTC
*** Bug 598156 has been marked as a duplicate of this bug. ***
Comment 3 Le Baron d'Merde 2016-10-26 19:43:44 UTC
Workaround, worked for me:

config_eth0="192.168.0.2/24"

or

config_eth0="192.168.0.2/24 brd 192.168.0.255"

These options are also correct on Handbook (Interface handlers).
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-10-26 20:11:50 UTC
Here's a quickfix before I get 0.5.1 out the door.

net/iproute2.sh:136:
- netmask="/$(_netmask2cidr "$1")"
+ netmask="$(_netmask2cidr "$1")"

However I'd strongly recommend everybody start moving to just CIDR notation.

(In reply to lebarondemerde from comment #3)
> config_eth0="192.168.0.2/24 brd 192.168.0.255"
That broadcast is the default implied value from the specified address, you don't need to specify it.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-10-26 20:15:40 UTC
0.5.1 released with fix.