Commit Graph

440 Commits (b80ee080937ce364f7324c297f23e40af6d88892)

Author SHA1 Message Date
pallotron 96b708e178 more ipv6 improvements 2017-04-05 00:15:16 -07:00
pallotron 4c3d99f966 enabling some ipv6 config before running wait_for_ipv6_dad 2017-04-04 12:59:45 -07:00
pallotron c603419030 wait for IPv6 RA if using none/static IPv6 assignment 2017-04-04 08:31:21 -07:00
Harald Hoyer 041e49ee2a network: enhance team support
Install ifcfg-* files with team configuration in the initramfs.

Improve the slave configuration of the team interface, by looking up
ifcfg files in the initramfs.

Create a default loadbalance team config, if none present in the
initramfs.

forward port of
4c88c2859e
2017-03-30 11:50:35 +02:00
Harald Hoyer 811a070d6c network: differ between ipv6 local and global tentative
For dhcpv6, only a non-tentative scope local address is needed.

(cherry picked from commit 42dd8928a8)
2017-03-30 11:34:51 +02:00
Harald Hoyer 5401d1f86f network:wait_for_ipv6_auto() wait for all tentative addresses
(cherry picked from commit 13264563a9)
2017-03-30 11:34:51 +02:00
Harald Hoyer e8dc8c4d89 network/net-lib.sh: auto6 wait for route ra
Wait for a router advertised route

(cherry picked from commit 6d22a6860e)
2017-03-30 11:34:51 +02:00
Harald Hoyer 25895a7769 Merge pull request #129 from imran1008/bond-mtu
add 'mtu' parameter for bond options
2017-03-30 11:03:04 +02:00
Harald Hoyer 0042f2568d Merge branch 'remove-test-dependencies' of https://github.com/danimo/dracut into danimo-remove-test-dependencies 2017-03-30 09:21:50 +02:00
Harald Hoyer bd4aa25741 Merge pull request #199 from lnykryn/bz1416958
ifup: don't ifup team master indefinitely
2017-03-21 13:33:41 +01:00
Daniel Molkentin 285495814b Drop dependency on bridge-utils 2017-02-14 14:10:24 +01:00
Lukas Nykryn 73fb5e769b network/ifup: write override file before dhcp_do
Commit cf376023e6 moved writing .resolv.conf and .override
after dhcp_do, because dhcp_do was overwriting .resolv.conf. But .override does not have
such problem and on the contrary dhcp_do reads .override file if it is present. So let\'s
move it back.

https://bugzilla.redhat.com/show_bug.cgi?id=1415004
2017-02-07 17:09:41 +01:00
Lukas Nykryn 6ed73e37f2 ifup: don't ifup team master indefinitely
https://bugzilla.redhat.com/show_bug.cgi?id=1416958
Thanks to martin.moore@hpe.com for the patch
2017-02-02 13:02:10 +01:00
Harald Hoyer e7838a8312 network: fixup VLAN handling 2017-01-18 15:16:01 +01:00
Harald Hoyer 0cf826a11a network: fix vlan handling 2017-01-18 13:28:47 +01:00
Harald Hoyer a1595cf5f9 network: parse multiple vlan parameters 2017-01-18 13:15:18 +01:00
Harald Hoyer 6aec6a7e2f network/net-genrules.sh: generate rules for all interfaces
previously, if "rd.neednet" and bond was specified, only the bond
interface was configured.

https://bugzilla.redhat.com/show_bug.cgi?id=1282680
(cherry picked from commit e6ae0c6128)
2017-01-18 13:15:18 +01:00
Denis Silakov 727e2a1d9d Make gateway processing POSIX-compliant 2017-01-13 18:44:40 +03:00
Denis Silakov b2f6409a22 Support multiple default gateways from DHCP server (rhbz#1408249) 2017-01-09 12:55:10 +03:00
Harald Hoyer 00ca15abbf network: arping2 use 0.0.0.0 as source address 2016-09-02 07:51:55 +02:00
Harald Hoyer 1a7b71bb14 network:ibft put IPv6 IP in brackets
ip=2620:0052:0000:2220:0226:b9ff:fe81:cde4::[2620:0052:0000:2220:0000:0000:0000:03fe]:64::ibft0:none

should be

ip=[2620:0052:0000:2220:0226:b9ff:fe81:cde4]::[2620:0052:0000:2220:0000:0000:0000:03fe]:64::ibft0:none

https://bugzilla.redhat.com/show_bug.cgi?id=1322592#c19
(cherry picked from commit b8e6c051c6)
2016-08-19 15:49:33 +02:00
Xunlei Pang 242c03d6fb network: use require_any_binary instead of require_any_binaries 2016-08-19 13:39:37 +02:00
Harald Hoyer 740c46c022 network: support macaddr in brackets []
ip=ens3:dhcp:1000
ip=ens3:dhcp::54:52:00:ab💿ef
ip=ens3:dhcp::[54:52:00🆎cd:ef]
ip=ens3:dhcp:1000:54:52:00:ab💿ef
ip=ens3:dhcp:1000:[54:52:00🆎cd:ef]

ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000
ip=192.168.122.20::192.168.122.1:24:test:ens3:none::54:52:00:ab💿ef
ip=192.168.122.20::192.168.122.1:24:test:ens3:none::[54:52:00🆎cd:ef]
ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000:54:52:00🆎cd:ef
ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000:[54:52:00🆎cd:ef]

ip=::::test:ens3:dhcp:1000
ip=::::test:ens3:dhcp::54:52:00:ab💿ef
ip=::::test:ens3:dhcp::[54:52:00🆎cd:ef]
ip=::::test:ens3:dhcp:1000:54:52:00:ab💿ef
ip=::::test:ens3:dhcp:1000:[54:52:00🆎cd:ef]

(cherry picked from commit 53e4ab7174)
2016-08-18 11:29:29 +02:00
Harald Hoyer 9853791d37 network: use arping2, if available
fixes https://github.com/dracutdevs/dracut/issues/135
2016-07-14 14:36:04 +02:00
Hannes Reinecke c98d1756f7 40network: Update iBFT scanning code to handle IPv6
IPv6 addresses should be specified in brackets so that the
ip= scanning code doesn't get confused.

References: bnc#887542

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.com>
2016-06-29 17:31:46 +02:00
Harald Hoyer 7e51abc81f network/dhclient.conf: add missing commata
options need to be seperated by ,
2016-06-23 16:38:17 +02:00
Harald Hoyer 9e19c0512d Revert "network: remove awk call and replace it with a shell function"
This reverts commit 71867b665c.

network needs posix shell
2016-06-07 14:27:35 +02:00
Harald Hoyer 71867b665c network: remove awk call and replace it with a shell function
changes commit 4fa5c235a7
2016-06-07 11:15:07 +02:00
Imran Haider 292548be6e add 'mtu' parameter for bond options
Signed-off-by: Imran Haider <imran1008@gmail.com>
2016-05-16 00:16:47 -04:00
Xunlei Pang 4fa5c235a7 network/net-lib.sh: delete duplicated DNS items from "/etc/resolv.conf"
Users can pass the DNS information throught "nameserver=" cmdline,
there maybe duplicated inputs.

"/etc/resolv.conf" have some restrictions on the number of DNS items
effective, so make sure that this file contains no duplicated items.

We achieve this by simply making the file have no duplicated lines.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Xunlei Pang cf376023e6 network: dhcp before parsing specified dns through cmdline
I met a problem when passing kdump dns to dracut via "nameserver=x.x.x.x",
the dns I provided didn't appear in the "/etc/resolv.conf".

After some debugging, found that when setup dhcp DNS, in setup_interface()
and setup_interface6(), it has:
    echo "search $search $domain" > /tmp/net.$netif.resolv.conf

So if "$search $domain" isn't NULL(this is ture in my kdump environment),
the dns contents(that is, dns1, dns2, nameserver) in "ifup" before dhcp
will be discarded.

This patch addresses it by handling dhcp first. In fact this is also the
way the NetworkManager in 1st kernel works.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Ville Skyttä bcabe0fe25 Clean up some bashisms from /bin/sh scripts 2016-03-28 11:52:14 +03:00
Harald Hoyer cb6d49bc9d Merge branch 'master' of github.com:haraldh/dracut 2016-02-29 15:07:41 +01:00
Harald Hoyer caf12d6717 network/dhclient-script.sh: add classless-static-routes support
https://bugzilla.redhat.com/show_bug.cgi?id=1260955
(cherry picked from commit a48ea27deb)
2016-02-29 15:01:50 +01:00
Harald Hoyer f4f8fb5c10 network: if rd.neednet=0 we don't need a bootdev
otherwise dracut would wait for the bootdev interface to appear and be
setup
2016-01-26 12:26:03 +01:00
Harald Hoyer 9542f2fee4 network: add mtu to list of variables to store in override 2016-01-19 15:12:39 +01:00
Harald Hoyer 24a78b2697 Fixed vlan, bonding, bridging, team logic
Call ifup for the slaves and assemble afterwards.
2016-01-19 11:35:23 +01:00
Harald Hoyer efbc47b8e4 network/net-lib.sh: correctly set mac address for ip=...:<mtu>:<mac>
if ip=...:<mtu>:<mac> was specified, macadress was not set
2016-01-13 13:43:38 +01:00
Harald Hoyer df95b1003c network: fix carrier detection
rename iface_has_link() to iface_has_carrier() to clarify usage

Only assign static "wildcard interface" settings, if the interface has a
carrier.

If the interface name was specified with a name, do not do carrier
checking for static configurations.
2015-12-14 15:19:53 +01:00
Harald Hoyer 5b43377d74 network/ifup.sh: skip empty nameserver values
(cherry picked from commit e658251173)
2015-11-11 16:49:47 +01:00
Harald Hoyer a49c1f049b network:wait_for_ifup() handle "NO-CARRIER" output
if "NO-CARRIER" is one of the flags, we surely have no link yet.

(cherry picked from commit f059985b14)
2015-11-11 16:47:09 +01:00
Harald Hoyer 19b0065cac network/netroot.sh: better handling of $netroot and dhcp
if $netroot is emtpy, get it from cmdline

check cmdline directly for root=dhcp(6) and netroot=dhcp(6)

(cherry picked from commit 17cee31b11)
2015-11-11 16:44:29 +01:00
Harald Hoyer 5d90ba4fca network: add all_ifaces_setup()
all_ifaces_up() is true, if all interfaces are up.

all_ifaces_setup() is true, if all interfaces are up and the gateways
and nameserver are setup.

(cherry picked from commit 63e75dc4cd)
2015-11-11 16:44:13 +01:00
Harald Hoyer e847a78bb6 network/dhclient-script.sh: fix RENEW
Remove check, if interface is already up. It is for RENEW.

new_prefix is apparently new_subnet_mask

(cherry picked from commit 52845b168d)
2015-11-11 16:44:01 +01:00
Harald Hoyer 73833796b4 network: move "ip=ibft" handling to network module
(cherry picked from commit b334c83e4a)
2015-11-11 16:38:49 +01:00
Harald Hoyer 6cfdb5aa1f network/ifup: do DHCP for BOOTDEV
(cherry picked from commit 7316d68353)
2015-11-11 16:19:43 +01:00
Harald Hoyer 29b885b46e network/net-lib.sh: fix IPv6 route parsing
(cherry picked from commit a4c47ce0dd)
2015-11-11 16:19:36 +01:00
Harald Hoyer 42b4fc90f2 network/net-lib.sh: fix wait_for_if_up()
wait for <*UP*> and not "state UP"

state can be UNKNOWN

(cherry picked from commit d8572e0bf4)
2015-11-11 16:19:25 +01:00
Harald Hoyer b519ae7008 network/ifup: fix warning about not bringing interface up
(cherry picked from commit 70f3c07846)
2015-11-11 16:19:18 +01:00
Harald Hoyer 686f9675df network/ifup.sh: only use dhcp on unknown interfaces for ip=dhcp
(cherry picked from commit 7c24815034)
2015-11-11 16:18:04 +01:00
Harald Hoyer 26fbe97bbe network: also mark interfaces up with their MAC
(cherry picked from commit 53537f4d23)
2015-11-11 16:17:57 +01:00
Harald Hoyer 744c65939b network/ifup.sh: save return value of ifup
(cherry picked from commit b4006781e8)
2015-11-11 16:17:49 +01:00
Harald Hoyer 27a5aecf56 network/ifup.sh:do_static(): error out, if IP is already assigned
(cherry picked from commit 32770ca79a)
2015-11-11 16:16:09 +01:00
Harald Hoyer 5193198dc9 network/ifup.sh:do_static(): error out, if interface could not be brought up
(cherry picked from commit 77f46adf5e)
2015-11-11 16:15:57 +01:00
Harald Hoyer 4483fff87c network/dhclient: exit arping immediatly, if we get an answer
(cherry picked from commit d6bfa7052a)
2015-11-11 16:15:07 +01:00
Harald Hoyer c04a321b92 network/net-lib.sh:ibft unset gateway or dns, if set to 0.0.0.0
(cherry picked from commit 942d60d8af)
2015-11-11 16:15:00 +01:00
Harald Hoyer 0c004c8e64 network/parse-ip-opts.sh: bind enx* interface to the MAC
do it automatically for the persistent naming scheme

(cherry picked from commit 2eb3b00133)
2015-11-11 15:58:12 +01:00
Harald Hoyer 9ab5ddf16a network/ifup.sh: arping for static IPv4 addresses
(cherry picked from commit 38180271c5)
2015-11-11 15:58:04 +01:00
Harald Hoyer 93b9885a65 network/ifup.sh: let dhcp client run in the background
we need to renew the lease

(cherry picked from commit fb2d643a38)
2015-11-11 15:57:53 +01:00
Harald Hoyer 2448fbf17b network: add options to tweak timeouts
rd.net.dhcp.retry=<cnt>
     If this option is set, dracut will try to connect via dhcp
     <cnt> times before failing. Default is 1.

 rd.net.timeout.dhcp=<arg>
     If this option is set, dhclient is called with "-timeout <arg>".

 rd.net.timeout.iflink=<seconds>
     Wait <seconds> until link shows up. Default is 60 seconds.

 rd.net.timeout.ifup=<seconds>
     Wait <seconds> until link has state "UP". Default is 20 seconds.

 rd.net.timeout.route=<seconds>
     Wait <seconds> until route shows up. Default is 20 seconds.

 rd.net.timeout.ipv6dad=<seconds>
     Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds.

 rd.net.timeout.ipv6auto=<seconds>
     Wait <seconds> until IPv6 automatic addresses are assigned.
     Default is 40 seconds.

 rd.net.timeout.carrier=<seconds>
     Wait <seconds> until carrier is recognized. Default is 5 seconds.

(cherry picked from commit d8ad687e1a)
2015-11-11 15:26:29 +01:00
Stijn Hoop 110858025a The default gateway might need a static route
Some hosting providers need a static route set in order to be
able to reach the default gateway. Be sure to retry adding
the default gateway after setting the static routes.
2015-08-23 14:45:53 +02:00
Harald Hoyer 4e9ba952bf network/parse-ip-opts.sh: assume rd.neednet for multiple ip options
set rd.neednet on the kernel cmdline to disable this behaviour
2015-08-12 14:25:23 +02:00
Harald Hoyer 01b23b6900 network/net-lib.sh: add is_ip()
add function to test if string is a valid IP
2015-08-12 14:24:05 +02:00
Stefan Reimer c1c96f2c47 Add missing echo to output the result.
Only place this function is currently called seems from line 28 in modules.d/95nfs/nfs-lib.sh. Bug fix.
2015-07-25 01:17:04 +00:00
Harald Hoyer ff55a8939c Merge pull request #81 from floppym/printf2
Replace echo -n with printf in code with a /bin/sh shebang
2015-07-16 12:02:48 +02:00
Mike Gilbert 5899f2f516 Replace echo -n with printf in code with a /bin/sh shebang
POSIX does not mandate that echo support the -n parameter.
printf has more well-defined behavior.
2015-07-14 22:22:14 -04:00
Harald Hoyer df0bdd5ae9 network: add rd.peerdns=0 parameter
Add rd.peerdns=0 parameter to disable DHCP nameserver setting
2015-07-13 10:14:15 +02:00
Harald Hoyer 78362bc5fe network/dhclient-script.sh: remove bashism 2015-07-08 08:49:02 +02:00
Harald Hoyer 8d09f493a6 network/dhclient-script.sh: fixup lease time 2015-07-02 19:48:25 +02:00
Harald Hoyer 7cca5efdce network: don't use "ifup -m"
"ifup -m" was thought to be used by humans in the emergency shell.
Using it programatically shows some other flaw in the execution logic.

Also, "ifup -m" was configuring the interface multiple times on "add"
and "change" uevent, because the "$netif.did-setup" test was not
executed.
2015-07-02 11:36:33 +02:00
Harald Hoyer 0f89ec314b network/dhclient-script.sh: make IPv4 DHCP lease time optionally
If bootp is used, no lease time is provided in the packet from the bootp
server.
2015-07-02 11:36:33 +02:00
Harald Hoyer cf627b20d0 network/dhclient-script.sh: add RENEW/REBIND 2015-07-02 11:36:33 +02:00
Harald Hoyer 1a61d85ef2 Merge pull request #51 from dracut-mailing-devs/13711492.8HAMuGhYIN@thunder
Add support for ethernet point-to-point connections configured via DHCP
2015-06-02 11:44:39 +02:00
Harald Hoyer 0b7bfacfea network: setup gateway after setting up resolv.conf
If a daemon listens for route changes and wants to use the interface
afterwards, it should be able to resolve DNS
2015-05-28 19:47:37 +02:00
Harald Hoyer 07d9319d54 network/net-lib.sh:iface_has_link() wait 5s for the carrier to appear
https://bugzilla.redhat.com/show_bug.cgi?id=1088808
2015-05-07 14:49:06 +02:00
Harald Hoyer 7c5ec0f5be network:dhcp:wait_for_ipv6_dad() in PREINIT6 2015-05-07 14:43:26 +02:00
Harald Hoyer 6d58fa27a4 change "while read x" to cope with EOF without newline
while read x || [ -n "$x" ]

should do the trick
2015-04-28 11:39:15 +02:00
Gerd von Egidy 99ccbc30df Add support for ethernet point-to-point connections configured via DHCP
When current dracut receives an ip with netmask of 255.255.255.255 via DHCP,
setting the also supplied default gateway fails (because it is obviously not
within the netmask).

The setup with a netmask of /32 is quite common in colocation datacenters
where you don't want the machines of two different customers to directly talk
to each other. At least two of the biggest colocation providers in Germany
(1&1 and Strato) do it that way. NetworkManager supports this kind of setup
and the dhclient-scripts of several distributions too.

In this patch I have implemented a simple approach very similar to what is
found in Debian. The dhclient-script from Fedora uses a more sophisticated
approach, but that relies on the ipcalc utility which would introduce a
dependency on Fedora-initscripts for dracut.

Signed-off-by: Gerd von Egidy <gerd.von.egidy@intra2net.com>
2015-03-26 16:38:33 +01:00
Harald Hoyer ae43adb70d network: split out kernel-network-modules 2015-03-24 16:03:47 +01:00
Harald Hoyer 2a12e97475 network: do not destroy the team interface on teamd shutdown
when doing switch-root teamd gets killed, which tears down the team
interface, if teamd is not started with "-N".
2015-01-26 15:12:08 +00:00
Harald Hoyer 7cddd7b838 network/net-lib.sh:parse_iscsi_root(): fix c&p bug
fix iscsi_target_name for eui.* and naa.* target names
2015-01-15 10:33:50 +01:00
Harald Hoyer 93342718cd network: add support for comma separated autoconf options
ip=eth0:auto6,dhcp

might work now
2015-01-14 11:41:48 +01:00
Harald Hoyer 36e8ce4fb0 net-lib.sh:parse_iscsi_root() fix target parsing
For targets with colons in the iSCSI target name:
  "iqn.2000-09.com.foo:storage-system.e2000:00000001cm1p1"

the parser was confused with the optional iscsi_iface_name and
iscsi_netdev_name.

This patch reintroduces the old IQN, EUI and NAA parsing and enhances
the fallback parser by checking the LUN for a numerical value.
2015-01-12 14:06:10 +01:00
Hannes Reinecke 681462eca8 40network: add missing _arch variable declaration
The module_setup.sh script was missing an '_arch' declaration,
causing network not to be installed on s390.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Minfei Huang c440d302f1 40network: Fix the syntax to correct the judgment sentence
In the judgment sentence, it will print the following warning message,
becasuse of lacking the blank on the left of ']'.

/lib/net-lib.sh: line 110: [: missing `]'

Signed-off-by: Minfei Huang <mhuang@redhat.com>
2014-12-01 17:02:15 +01:00
Minfei Huang 56d2aed1c8 40network: Copy the customize dhcp config
It is not available to valid the customize dhcp config
/etc/dhclient.conf in the initram environment.

Dracut uses the default follow config to construct the initramfs.

request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        root-path, interface-mtu;

Copy the customize config to make the config availably in the
initram environment.

Signed-off-by: Minfei Huang <mhuang@redhat.com>
2014-10-29 14:13:50 +01:00
Harald Hoyer 3947f07d93 ifcfg/write-ifcfg: only write DEVICE for non-kernel names
Rename an interface to the kernel namespace is not allowed, so don't add
DEVICE="<iface>", if HWADDR is given.
2014-10-28 15:13:35 +01:00
Harald Hoyer 05065741f0 network/net-lib.sh:is_persistent_ethernet_name() eth* is not
eth* is _not_ a persistent ethernet name... tsk, tsk, tsk
2014-10-23 14:34:33 +02:00
Will Woods 7e50abfdb8 do 'ip route replace default' instead of 'add'
When you define the gateway for an interface, dracut sets it up with:

  ip route add default via $gw dev $netif

If a default route is already set (e.g. if you have multiple NICs), this
will fail with the message "RTNETLINK answers: File exists".

So, if your first NIC isn't usable as a default route

Using "ip route replace default" instead allows ifup/dhclient-script to
correctly change the default route to the new interface.
2014-09-12 10:22:21 +02:00
Harald Hoyer 29763cb72d network/net-lib.sh: do not enforce iscsi target name policy
also untabified
2014-09-09 13:31:10 +02:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer 2db6d71118 fixed bridge setup
renamed "ethnames" in bridge.info to "bridgeslaves"

fixed ifcfg generation
2014-08-01 13:16:29 +02:00
Harald Hoyer 7b46244bb9 network: add rd.route parameter 2014-07-22 11:52:52 +02:00
Praveen_Paladugu@Dell.com f4eb0d9804 Installing an OS with VLAN enabled to an ISCSI LUN (from ibft)
When installing OS to a VLAN enabled iscsi LUN (extracted from iBFT), "/tmp/net.{xyz}.has_ibft_config" is not being set properly.

Then anaconda installer requires 'BOOTPROTO="ibft"' populated in ifcfg of the vlan interface (ex: ibft0.20), for it to properly populate the kernel parameters post installation. The setting 'BOOTPROTO="ibft"' is populated by write-ifcfg.sh script only if the corresponding interface has a file /tmp/net.{xyz}.has_inft_config

To get around this issue, in ibft_to_cmdline() function in net-lib.sh file, I made the following changes to populate the has_ibft_config file for the vlan interface(ex: ibft0.20):
2014-07-17 16:36:39 +02:00
Harald Hoyer 5580e4c176 deprecate "ip=ibft" kernel command line parameter
rd.iscsi.ibft[=1] should be used instead.

Thing is, 'ip=ibft' is not really an ip setting, but rather a marker
that iBFT should be evaluated.

Also removed the trigger of the warning:
"Warning: Please supply bootdev argument for multiple ip= lines"
2014-06-20 14:27:09 +02:00
Vasiliy Tolstov 28f3f537c4 network/ifup.sh: Don't try to modprobe ipv6, if already available
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>

[Edited-by: Harald Hoyer]
Simplified logic.
2014-06-03 12:49:56 +02:00
Alex Harpin 83c9ff7dbb bonding: use hwaddr of the slave rather than the master
When a bonded interface is brought up, any slaves included in the bond
have their hardware address set to that of the bond master.  Although
this allows an interface to be brought up on start up, when the
configuration file is imported into the booted system it prevents
the bonded interface being successfully restarted.

The fix involves obtaining the hardware address of the slaves before
they are added to the bond and then using this value in the
configuration file.
2014-06-03 12:26:01 +02:00
Chapman Flack 2c19a5fa78 Specify strstr tightly, add strglob/strglobin.
By convention, strstr should be a literal string match. Previously, it
would match as a glob pattern. Some code used that, so add new
functions strglob and strglobin to do what that code expects, and
specify them tightly too. strglob tests whether the glob pattern
matches the entire string (the name strglob is also used in the yorick
language, and that's what it does there), while strglobin tests whether
the glob pattern matches anywhere in the string.

Also tightens str_starts, str_ends, and str_replace to deal with
literal strings only. In a quick grep I did not find code that depended
on these functions matching globs.

Changes the call sites where strstr was used with glob patterns to use
strglobin or strglob as the intention seemed to be (or, in one case,
strstr with the * removed as it did not affect the result anyway).
2014-04-07 10:49:07 +02:00
Harald Hoyer 2e094b20a6 ifcfg: only bind to HWADDR, if addr_assign_type == 0
/sys/class/net/$netif/addr_assign_type is != 0 for random MAC address
interfaces
2014-04-04 12:52:39 +02:00
Harald Hoyer fb0e5184a6 ifcfg: do not bind persistent interface names to HWADDR 2014-04-04 12:48:32 +02:00