summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-02-19 20:10:45 +0000
committerThierry Vignaud <tv@mageia.org>2013-02-19 20:10:45 +0000
commit0837656285fb42a851f756af645e3d2666a5546a (patch)
tree37ee1321f2e5e4ddd8e733c7bda40d9f665190ef
parent9dee9f1f94882f4dcad0b2d33f0bce9f3ec623a6 (diff)
downloaddrakx-net-0837656285fb42a851f756af645e3d2666a5546a.tar
drakx-net-0837656285fb42a851f756af645e3d2666a5546a.tar.gz
drakx-net-0837656285fb42a851f756af645e3d2666a5546a.tar.bz2
drakx-net-0837656285fb42a851f756af645e3d2666a5546a.tar.xz
drakx-net-0837656285fb42a851f756af645e3d2666a5546a.zip
add support for MACADDR and ETHTOOL_OPTS (Oden Eriksson, mga#8811)
-rw-r--r--NEWS1
-rw-r--r--lib/network/connection.pm12
-rw-r--r--lib/network/network.pm2
3 files changed, 14 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 0d94ddb..8b1d2d9 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
- drakconnect:
o add support for 802.1x EAP with WPA Enterprise Patch (mga#8577,
Zombie Ryushu)
+ o add support for MACADDR and ETHTOOL_OPTS (Oden Eriksson, mga#8811)
- drakfirewall:
o check shorewall enabling via systemd (mga#8699, from Rosa)
- draknfs:
diff --git a/lib/network/connection.pm b/lib/network/connection.pm
index c0c39a9..c92eb87 100644
--- a/lib/network/connection.pm
+++ b/lib/network/connection.pm
@@ -148,6 +148,9 @@ sub load_interface_settings {
$self->{control}{userctl} = $self->get_ifcfg_bool('USERCTL');
$self->{control}{metric} = $self->{ifcfg}{METRIC};
$self->{control}{mtu} = $self->{ifcfg}{MTU};
+ $self->{control}{macaddr} = $self->{ifcfg}{MACADDR};
+ $self->{control}{hwaddr} = $self->{ifcfg}{HWADDR};
+ $self->{control}{ethtool_opts} = $self->{ifcfg}{ETHTOOL_OPTS};
$self->{control}{accounting} = $self->get_ifcfg_bool('ACCOUNTING');
$self->{control}{nm_controlled} = $self->get_ifcfg_bool('NM_CONTROLLED');
$self->{control}{uuid} = $self->{ifcfg}{UUID};
@@ -250,6 +253,12 @@ sub get_control_settings {
{ label => N("Metric"), val => \$self->{control}{metric}, advanced => 1 },
{ label => N("MTU"), val => \$self->{control}{mtu}, advanced => 1,
help => N("Maximum size of network message (MTU). If unsure, left blank.") },
+ { label => N("MACADDR"), val => \$self->{control}{macaddr}, advanced => 1,
+ help => N("Use a fake MAC address. If unset, uses HWADDR or default.") },
+ { label => N("HWADDR"), val => \$self->{control}{hwaddr}, advanced => 1,
+ help => N("Set the MAC address. If unset, uses default.") },
+ { label => N("ETHTOOL_OPTS"), val => \$self->{control}{ethtool_opts}, advanced => 1,
+ help => N("Use ethtool to pass options to the NIC. eg. \"autoneg off wol g\"") },
];
}
@@ -263,6 +272,9 @@ sub build_ifcfg_settings {
USERCTL => bool2yesno($self->{control}{userctl}),
METRIC => $self->{control}{metric},
MTU => $self->{control}{mtu},
+ MACADDR => $self->{control}{macaddr},
+ HWADDR => $self->{control}{hwaddr},
+ ETHTOOL_OPTS => $self->{control}{ethtool_opts},
UUID => $self->{control}{uuid},
NAME => $self->{control}{name},
LAST_CONNECT => $self->{control}{last_connect},
diff --git a/lib/network/network.pm b/lib/network/network.pm
index baa9cfc..ff3c1df 100644
--- a/lib/network/network.pm
+++ b/lib/network/network.pm
@@ -187,7 +187,7 @@ sub update_broadcast_and_network {
sub write_interface_settings {
my ($intf, $file) = @_;
- setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST GATEWAY ONBOOT HWADDR METRIC MII_NOT_SUPPORTED TYPE USERCTL ATM_ADDR ATM_DEVICE ETHTOOL_OPTS VLAN MTU DNS1 DNS2 DOMAIN RESOLV_MODS LINK_DETECTION_DELAY),
+ setVarsInSh($file, $intf, qw(DEVICE BOOTPROTO IPADDR NETMASK NETWORK BROADCAST GATEWAY ONBOOT HWADDR MACADDR METRIC MII_NOT_SUPPORTED TYPE USERCTL ATM_ADDR ATM_DEVICE ETHTOOL_OPTS VLAN MTU DNS1 DNS2 DOMAIN RESOLV_MODS LINK_DETECTION_DELAY),
qw(WIRELESS_MODE WIRELESS_ESSID WIRELESS_NWID WIRELESS_FREQ WIRELESS_SENS WIRELESS_RATE WIRELESS_ENC_KEY WIRELESS_ENC_MODE WIRELESS_RTS WIRELESS_FRAG WIRELESS_IWCONFIG WIRELESS_IWSPY WIRELESS_IWPRIV WIRELESS_WPA_DRIVER WIRELESS_WPA_REASSOCIATE CRDA_DOMAIN),
qw(DVB_ADAPTER_ID DVB_NETWORK_DEMUX DVB_NETWORK_PID),
qw(IPV6INIT IPV6TO4INIT),