Commit Graph

154 Commits

Author SHA1 Message Date
Robin H. Johnson
537171eac2 Fix whitespace.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-26 17:51:28 -08:00
Robin H. Johnson
415f480410 net/vlan, net/macvlan: iproute2 is required for new VLAN configuration
Since commit 683a21b0a in Feburary 2011, iproute2 has been required for
new VLAN configuration. MACVLAN is also impossible to configure without
iproute2. However we did not check if iproute2 was actually in the
modules for a given interface, so it could end up hanging or giving
weird errors. Check for iproute2 before usage now.

X-Gentoo-Bug: 389437
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=389437
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-26 17:22:29 -08:00
Robin H. Johnson
acf77b73af net/ip6to4: Split to use pre_start and start so that other tunnel names work.
We need to create interfaces of custom names before we can sucessfully
start them. To do this, we have to add tunnels during prestart instead
of start. Split up the ip6to4 script to do this, saving the computed
variables for use in start with the new service data commands.

X-Gentoo-Bug: 372575
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=372575
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-26 17:08:27 -08:00
Robin H. Johnson
7b1c1e1623 net/iproute2: Confirmed that broadcast and peer can be used together.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-21 08:10:47 +00:00
Robin H. Johnson
8bb4b759eb net/iproute2: IPv6 cannot be used with broadcast
Broadcast and IPv6 should not be used together. Do not try to set the
keyword for auto-generation of the broadcast address. If the user passes
a broadcast address for IPv6, throw an error.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-21 08:08:31 +00:00
Robin H. Johnson
e5eb062f05 net/iproute2: iproute2 flag handling
Several of the optional flags were not being handled correctly, they
were being passed as values only, without the keyword before them.
Affected keywords: anycast, label, scope, valid_lft, preferred_lft

Also change the handling of keywords to a common setup now, making
broadcast and peer strings the same as the above keywords.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-21 08:02:53 +00: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
06f6ce408c net/iproute2: Support routing policy for IPv6 per bug #385833
For creation of routing policy entries for IPv6, the family must be
explicitly specified to 'ip'.

X-Gentoo-Bug: 385833
X-Gentoo-Bug-URL: https://bugs.gentoo.org/385833
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-13 00:19:58 -08:00
Robin H. Johnson
ac2391e0cb net/vlan: Fix mtu setting
Fix minor shell typo that broke setting mtu on vlans.

X-Gentoo-Bug: 392971
X-Gentoo-Bug-URL: https://bugs.gentoo.org/392971
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-12-12 22:52:09 -08:00
William Hubbs
ce9994f7ca net/tuntap: fix return code when tools can't be found
This module should return failure if iproute2, openvpn or tunctl cannot
be found. Before it was returning success; this fixes the issue.
2011-12-13 00:25:58 -06:00
Salah Coronya
a38a5071f3 Tuntap: add iproute2 support
This patch was modified by William Hubbs <williamh@gentoo.org> to
document the new usage in net.example.

X-Gentoo-Bug: 394281
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=394281
2011-12-12 21:40:39 -06: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
Robin H. Johnson
dd45506a40 net/bonding: ensure slave interfaces are down before adding.
The old ifenslave binary forcibly set new slave interface to down before
adding into the kernel, as a way of show it's version to the kernel. We
need to duplicate this so that the kernel doesn't think it's an old
ifenslave version using the bonding setup interface.

X-Gentoo-Bug: 391881
X-Gentoo-Bug-URL: https://bugs.gentoo.org/391881
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Thanks-to: Yun Zheng Hu <hu@fox-it.com>
2011-12-12 19:20:39 -08:00
William Hubbs
8ea1190486 ip6to4: set correct subnet mask
The correct setting for this is /48.

Reported-by: MaratIK <marat.buharov@gmail.com>
X-Gentoo-Bug: 392723
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=392723
2011-12-09 21:57:00 -06:00
William Hubbs
a1c655949f iproute2: set a default broadcast address if none is specified
Reported-by: Spooky Ghost <spookyghost@blueyounder.co.uk>
X-Gentoo-Bug: 392593
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=392593
2011-12-09 20:49:26 -06:00
William Hubbs
483db945e1 Fix typo 2011-11-23 08:17:33 -06:00
William Hubbs
76fec58633 pass the per-interface metric to resolvconf
Reported-by: Alon Bar-Lev <alon.barlev@gmail.com>
x-Gentoo-Bug: 364907
x-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?364907
2011-11-22 08:50:26 -06: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
William Hubbs
5066d40ac8 Use pattern rules instead of suffix rules
Rework the makefiles to use pattern rules instead of suffix rules.
This is the preferred way to write implicit rules according to the gnu
make manual.
2011-10-29 09:43:24 -05:00
Stef Simoens
f94e883633 Add macvlan support
X-Gentoo-Bug: 384029
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=384029
2011-10-26 11:28:39 -05:00
Mike Frysinger
9a539ebbe1 further clean up OS differences in makefiles
No need for if() logic.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-20 14:32:37 -05:00
William Hubbs
9c77502f96 Make variable references in Makefiles consistent
Some variable references were written as $(foo), but the majority were
written as ${foo}. This commit changes all of the variable references
to using braces.
2011-10-19 12:22:23 -05:00
William Hubbs
ecf77254bb consolodate Makefiles
The tree contained many operating system specific Makefiles which were
being included in other Makefiles. This commit removes those and adds
the code to the makefiles which included them using make's conditional
processing.

X-Gentoo-Bug: 387441
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=387441
2011-10-18 03:23:00 -05:00
Robin H. Johnson
f6c27abeb5 net/vlan: respect txqueuelen/mac/broadcast/mtu options during creation.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-10-07 21:47:46 +00:00
Christian Ruppert
4b63929878 Shutdown VLAN's before the actual/parent interface
Make sure the VLAN interfaces as well as its rules will be removed prior
to the actual/parent interface.
The VLAN configs are gone in vlan_post_stop() already so we have to use
vlan_pre_stop() instead.

Reported-by: Bernd Bednarz <bernd.bednarz@avira.com>
X-Gentoo-Bug: 380603
X-Gentoo-Bug-URL: https://bugs.gentoo.org/380603
2011-09-21 13:26:47 +02:00
Christian Ruppert
29693ecb7a Refactoring of commit bf49e59e3e
Make sure the RPDB rules will be removed.
2011-09-21 03:57:09 +02:00
Yun Zheng Hu
bf49e59e3e Don't do anything if the interface doesn't exist
iproute2_post_stop() does now check if the network interface still exist.

Reported-by: Yun Zheng Hu <hu@fox-it.com>
X-Gentoo-Bug: 379575
X-Gentoo-Bug-URL: https://bugs.gentoo.org/379575
2011-09-19 00:04:19 +02:00
Gilles Oivier
0e4d169a40 Fix the Internal Field Seperator when using ethtool
ethtool.sh didn't reset the Internal Field Seperator (IFS) properly.
It now does, by storing the old IFS to OIFS, which will be used later
in the for loop.

It also fixes the "ethtool_ring_<if>" option.

Reported-by: Alois Schmid <alois.schmid@gmx.de>
X-Gentoo-Bug: 368525
X-Gentoo-Bug-URL: https://bugs.gentoo.org/368525
2011-09-18 14:42:39 +02:00
Christian Ruppert
72e31e753d Improve missing openvpn/usermode-utilities warning message
as OpenRC can be used on other distributions as well.
2011-09-17 01:13:11 +02:00
Stefan Knoblich
645bbf2e0f Parse broadcast arp responses via arping (iputils) properly
ARP replies may/do contain two MAC addresses when using iputils's
arping so we have to use the first one because it's always the "From"
address - which is what we want.

Thanks to Stefan Knoblich <s.knoblich@axsentis.de> for the fixed pattern.

Reported-by: cl@exomail.to
X-Gentoo-Bug: 379181
X-Gentoo-Bug-URL: https://bugs.gentoo.org/379181
2011-09-17 00:16:10 +02:00
Christian Ruppert
539c4e5872 Print a warning if openvpn/tunctl are missing 2011-09-16 23:48:44 +02:00
Robin H. Johnson
6fa6f9523f Rewrite iproute2 addr argument parsing.
This was originally to fix the fact that our code did not handle certain
orders of arguments in conversion, but it was easier to rewrite the
entire argument handling to support more options at the same time.

Now supports all options documented in the ip manpage, including the
IPv6-specific options that must be passed after the interface argument.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Reported-by: Tony Vroon <chainsaw@gentoo.org>
X-Gentoo-Bug: 366905
X-Gentoo-Bug-URL: https://bugs.gentoo.org/366905
2011-07-18 23:55:32 +00:00
Mike Frysinger
49f1a8702b eat trailing whitespace
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-07-04 18:27:00 -04: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
c427d3c1fe net: ccwgroup: smooth up/down process
We need to bring the link up ourselves after we've properly configured
the device.  The common code tries to bring the link up itself, but it
does so before things are configured, and so it ends up failing.

When shutting down, we need to wait for the kernel to finish destroying
the interface.  Otherwise, when doing a restart, openrc is quick enough
to tell the kernel to destroy things, but then start trying to bring it
back up before the kernel has finished.

X-Gentoo-Bug: 367467
X-Gentoo-Bug-URL: http://bugs.gentoo.org/367467
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-06-28 00:02:11 -04:00
William Hubbs
fd48bc09ff net:bonding small style change for readability 2011-05-16 14:57:46 -05:00
Kfir Lavi
db1daa5857 Do not add slaves to bond interface if they are already added
X-Gentoo-Bug: 366653
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=366653
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
2011-05-16 09:21:18 -04:00
Mike Frysinger
2493a1f32e net: ccwgroup: forward port changes from baselayout-1
Quite a bit of work happened in baselayout-1 on the ccwgroup module, but
seems it didn't make it into openrc.  So forward port all the existing
code so we can work with more than just qeth and layer2 options.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-05-16 01:22:32 -04:00
William Hubbs
b712a9161f change udhcpc support to busybox udhcpc
This updates the udhcpc support to use busybox's udhcpc instead of the
stand alone version.

I would like to thank jackieku <kjackie@gmail.com> for assisting with
this update.

X-Gentoo-Bug: 205286
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=205286
2011-04-26 15:25:08 -05:00
Robin H. Johnson
2d197357ef [oldnet] Bug #363959: Improve plug_timeout ifplugd/netplugd code.
- Add support for a global plug_timeout setting to match the
  documentation.
- Update the documentation to also show per-interface configuration.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
2011-04-19 17:49:20 +00:00
William Hubbs
73c862b792 fix typo in ethtool.sh
This was causing the ethtool interface to not work.

X-Gentoo-Bug: 360481
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=360481
2011-04-07 07:48:56 -05:00
Marc Joliet
6e1239795f remove bashism from ethtool module
X-Gentoo-Bug: 360367
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=360367
2011-03-27 15:45:45 -05:00
Mike Frysinger
9f5eb03e5e net: bonding: avoid using bash string replace
X-Gentoo-Bug: 359311
X-Gentoo-Bug-URL: http://bugs.gentoo.org/359311
Reported-by: Raffaello D. Di Napoli <fastijum@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-18 14:24:18 -04:00
Robin H. Johnson
dfd42d1393 net/ethtool: official interface for changing ethtool params (bug #195479)
Implement a consistent interface for changing ethtool parameters, as
suggested in bug 195479. All variable names are based on the long option
to ethtool to set each group of parameters. Multiple entries seperated
by newlines are permitted for variable values.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Gentoo-Bug: 195479
2011-02-22 02:59:38 +00:00
Robin H. Johnson
20480048ca net/iproute2: Pass required explicit -6 for IPv6 tunnels (#347657)
Tunnel modes ipip6 and ip6ip6 require an explicit family selection for
the ip tunnel call.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Gentoo-Bug: 347657
2011-02-21 09:55:47 +00:00
Robin H. Johnson
683a21b0a0 net/vlan: update to use modern iproute2 interface
This replaces the vlan setup code that previously used the old vconfig
binary with a new implementation using the iproute2 interface.

vconfig does not handle many of the newer setups. No automatic migration
path is provided, as altering the configuration is non-trivial.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Written-by: Guillaume Castagnino <casta@xwing.info>
X-Gentoo-Bug: 346365
2011-02-21 09:41:48 +00:00
Christian Wetzig
7bc920ab56 fix typo in iproute2 module
X-Gentoo-Bug: 354511
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=354511
2011-02-12 13:34:46 -06:00
Christian
43678fd2c4 bridge.sh: use correct POSIX test, = not ==
X-Gentoo-Bug: 353124
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=353124
2011-02-05 07:24:11 -06: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
f84d997d4c Move the ip rule extra output to verbose mode only, and support verbose output on addresses and routes. 2010-12-15 13:02:04 -08:00