Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 695566

Summary: net-misc/netifrc: Feature request: no error if I/F missing and config_eth0="noop"
Product: Gentoo Hosted Projects Reporter: Joakim Tjernlund <joakim.tjernlund>
Component: netifrcAssignee: netifrc Team <netifrc>
Status: UNCONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Joakim Tjernlund 2019-09-24 15:37:18 UTC
If an interface is missing(say eth0) and one starts net.eth0, there
is always an error.

Could netifrc add support for a non error exit if I/F is missing and 
config_eth0="noop" is set ?
Comment 1 Joakim Tjernlund 2019-10-02 14:42:31 UTC
This would work for us:

--- net.lo.org	2019-09-24 17:39:41.797917024 +0200
+++ net.lo	2019-09-24 18:14:39.277917024 +0200
@@ -571,6 +571,9 @@
 		fi
 	done
 
+	eval our_config=\$config_${IFVAR}
+	[ _exists ] && [ "$our_config" = "noop" ] && return 0
+
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2019-10-03 17:36:10 UTC
Can you clarify which version this diff is against? 

Conceptually, this idea is mostly ok, but if something depends on IPv6 auto-conf on an interface which comes after a config_IFVAR=noop , then it could be problematic.

would it be ok to put it behind an extra config setting?
missing_behavior_IFVAR=silent

With knobs of:
- fatal: default
- warning: warning with no failure
- silent: no warning, no failure
Comment 3 Joakim Tjernlund 2019-10-03 18:14:04 UTC
(In reply to Robin Johnson from comment #2)
> Can you clarify which version this diff is against? 

Oh, that was an older version: 0.3.1
Our target has not upgrade netifrc yet.

> 
> Conceptually, this idea is mostly ok, but if something depends on IPv6
> auto-conf on an interface which comes after a config_IFVAR=noop , then it
> could be problematic.

I don't understand but I am no expert either :)
One could continue and just make sure not to do any operation if noop
is set. Isn't that the true meaning of noop ?

 
> 
> would it be ok to put it behind an extra config setting?
> missing_behavior_IFVAR=silent

hmm, you mean
  missing_behavior_eth0=silent
in conf.d/net ?

That would work as well, but then one must make sure every call to ifconfig, ip
, route etc. is redirected to stderr I think

> 
> With knobs of:
> - fatal: default
> - warning: warning with no failure
> - silent: no warning, no failure
Comment 4 Joakim Tjernlund 2019-10-03 18:15:54 UTC
(In reply to Joakim Tjernlund from comment #3)
> (In reply to Robin Johnson from comment #2)
> > Can you clarify which version this diff is against? 
> 
> Oh, that was an older version: 0.3.1
> Our target has not upgrade netifrc yet.
> 
> > 
> > Conceptually, this idea is mostly ok, but if something depends on IPv6
> > auto-conf on an interface which comes after a config_IFVAR=noop , then it
> > could be problematic.
> 
> I don't understand but I am no expert either :)
> One could continue and just make sure not to do any operation if noop
> is set. Isn't that the true meaning of noop ?

Maybe config_eth="" could be the trigger instead?
Comment 5 Joakim Tjernlund 2020-02-08 16:08:13 UTC
Any progress on this ?