Commit Graph

22 Commits

Author SHA1 Message Date
Christian Ruppert
a6549a2b0f Whitespace 2012-04-24 03:50:10 +02:00
William Hubbs
be5de328e9 network scripts need sysfs on linux systems
Adjust the previous commit so that on linux systems the network scripts
need sysfs.
2012-04-03 20:01:23 -05:00
Robin H. Johnson
37af1693b4 net/ifconfig, net/iproute: need sysfs
sysfs needs to be available before we can check interfaces. On udev
systems this was not a problem, but with mdev/static-dev, there is no
other need for sysfs until later in the init.

X-Gentoo-Bug: 410701
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=410701
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-04-03 14:32:03 -07:00
William Hubbs
9127684553 Change the method for calculating the interface metric for linux systems
On linux systems running  >=linux-3.2, the /proc/net/dev file cannot be
relied on to show the order network interfaces were added to the system.
Also, there is currently a bug in the implementation of the seek call
for this file which can cause a system to go into an infinite loop.
This commit changes the _ifindex function to retreive the value of
/sys/class/net/${IFACE}/ifindex and use that value instead of attempting
to calculate one from the interface's position in /proc/net/dev.

reported-by: John Keeping <john.keeping@lineone.net>
X-Gentoo-Bug: 410127
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=410127
2012-04-01 22:59:00 -05:00
Robin H. Johnson
b27a9003bb net/ifconfig: The location of the ifconfig binary has changed
The location of the ifconfig binary has changed in
net-tools-1.60_p20120127084908, and if we do not check both locations
for it, the user will get errors like:
_is_wireless: command not found
_exists: command not found

X-Gentoo-Bug: 407757
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=407757
2012-03-11 12:54:48 -07:00
Robin H. Johnson
7a1e4ef606
Bug #405491: _exists can give a false negative since /proc/net/dev can be slow to update sometimes when interfaces are added rapidly. Use sysfs instead.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2012-03-02 19:54:48 +00:00
William Hubbs
84aa4ba818 Revert "net/ifconfig net/iproute2: support lookup ifconfig/ip dynamically"
This reverts commit f583030e3c.

The previous commit did not account for the case of not having iproute2
installed.

Reported-by: Duncan <1i5t5.duncan@cox.net>
X-Gentoo-Bug: 397875
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=397875
2012-01-06 14:51:43 -06:00
Mike Frysinger
f583030e3c net/ifconfig net/iproute2: support lookup ifconfig/ip dynamically
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-04 16:38:11 -05:00
Robin H. Johnson
879e1acd5d net: Support more variants of address family specification.
This includes address family specifications methods to help debug bug
358235 further.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-13 00:43:18 -08:00
Robin H. Johnson
2569eb644e net/ifconfig, net/iproute2: admin/oper state check functions
Provide consistent methods using iproute2/ifconfig to check operational
and administrative up/down state of interfaces. This is not the same as
ethtool's "Link detected" field, which is the state of the layer 2
medium.

TODO: How to check operational state in BSD?

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-12 19:20:39 -08:00
Mike Frysinger
ef1ff1b4f2 make shell math operations style more succulent
Convert the style:
	var=$((${var} + 1))
to:
	: $(( var += 1 ))

The latter is easier to read imo.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-19 02:25:36 -05:00
Mike Frysinger
d0bc4f20ad drop useless "All rights reserved" notice
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-29 19:46:31 -04:00
Mike Frysinger
faa2df1159 more whitespace cleanup
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-01-17 04:49:12 -05:00
Robin H. Johnson
12a91636f4 Fix pointopoint typo in old ifconfig setup. 2010-12-15 12:37:50 -08:00
Alon Bar-Lev
ca752a5a2d Support phy80211, fixes #209. 2009-12-05 19:25:39 +00:00
Roy Marples
7962218dd8 Apply MTU and txqueuelen after creating the tunnel. 2009-07-08 22:38:48 +01:00
Roy Marples
658a220638 Add (c) to Copyright 2009-05-01 15:11:40 +01:00
Roy Marples
4febf00c06 Allow family on routes, #152 2009-04-19 20:05:40 +00:00
Roy Marples
ae692e294e Don't quote $tunnel, Gentoo #218123. 2008-10-26 19:58:57 +00:00
Roy Marples
c409dd0570 Some ifconfig's output weird inet6 loopback addresses 2008-05-28 13:38:58 +00:00
Mike Frysinger
18b4108755 add support for parsing newer ifconfig output
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2008-04-19 07:22:30 +00:00
Roy Marples
ccf238f852 Merge net.OS into net 2008-03-26 14:18:01 +00:00