Commit graph

150 commits

Author SHA1 Message Date
Dan Williams
43ba4eb04b ifcfg-rh: fix testcase after 4abb300c96 2012-03-15 17:56:34 -05:00
Tore Anderson
4abb300c96 core: allow IPv4 to fail by default
(comments by dcbw)
This allows out-of-the-box connectivity	on IPv6-only networks.
Once caveat is that connections	where the user currently
expects	no IPv4	connectivity to	terminate the connection and
retry will no longer do	so until IPv6 also times out, and if
that network where IPv4	is expected to fail also has an IPv6
router sending advertisements, the connection will succeed
instead	of failing.  That can be resolved by setting the
right bit in the connection's config file; and it's expected
that the number	of users who expect IPv4 failure on a
network	with usable IPv6 connectivity is quite small
compared to the	benefit	of OOB IPv6 connectivity.
2012-03-15 15:58:24 -05:00
Dan Williams
cfa1536fa8 ifcfg-rh: fix distcheck 2012-03-13 14:50:36 -05:00
Jiří Klimeš
a0b658281f ifnet: use nm_connection_get_setting_connection() to get 'connection' setting 2012-03-13 12:23:40 +01:00
Mu Qiao
e7380561d5 ifnet: remove system prefix
As all connections are system connection so the prefix is meaningless.
Drop it now.
2012-03-09 12:46:49 -06:00
Mu Qiao
e3a1b6e065 ifnet: ignore per-user connections
Ifnet currently does not deal with user agent service. Any connection
that comes with flagged secrets or is not system connection will be
ignored by the plugin. Thanks to David Narvaez for his great help on
this problem.
2012-03-09 12:45:25 -06:00
Jiří Klimeš
79757f10f3 ifcfg-rh: use single quotes when quoting WPA passphrases (WPA_PSK) (rh #798102)
Single quotes ensure we don't break initscripts (bash processing) when the
string contains special characters. Special handling is necessary for single
quotes characters. They have to be escaped and the whole string has to be
prepended with '$' character so that bash is happy.
This change also filters out CR and LF characters as they break WPA_PSK
variable and could pose security issues.
2012-03-07 14:45:37 +01:00
Dan Winship
49214066a4 Fix capitalization of "InfiniBand"
"InfiniBand" has a capital "B". Fix that everywhere it's being used as
a human-readable string.

In particular, the RH initscripts recognize "TYPE=infiniband" and
"TYPE=InfiniBand", but not "TYPE=Infiniband", which is what we were
writing before.
2012-03-06 13:23:29 -05:00
Dan Williams
723bab41ea ifcfg-rh: remove duplicate tests 2012-03-06 00:36:55 -06:00
Dan Winship
51f2bd0198 ifcfg-rh: don't write out a fake minimal IP4 config for bond slaves
The writer had code to fake up a simple IP4 config if the connection
didn't already have one. Make sure we don't do that in the bond case.
2012-03-05 15:55:43 -05:00
Dan Williams
10b32be37b ifcfg-rh: various VLAN cleanups
Add some testcases checking for DEVICE/PHYSDEV/VLAN_ID variations,
and read/write the new VLAN_ID tag, which we can use in
combination with the 'parent' property to determine the interface
name if no interface name/DEVICE is given.
2012-03-01 17:40:17 -06:00
Thomas Graf
cf597e698a ifcfg-rh: writer support for bonding connections
For bonding-master:
  TYPE=bond
  BONDING_MASTER=yes
  DEVICE=<NAME>
  BONDING_OPTS="..."

For bonding-slaves:
  MASTER=<NAME>

v2: Resolved test failures after feedback from Jirka.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-03-01 17:32:51 -06:00
Jiří Klimeš
ff0e71607d build: fix build 2012-03-01 17:48:31 +01:00
Dan Williams
ca3c39abd3 wifi: let WEXT be disabled with --with-wext=no
It's still enabled by default if you don't pass --with-wext=no.
But now it's possible to build without WEXT entirely.
2012-02-29 23:11:04 -06:00
Jiří Klimeš
88dc641e6e ifcfg-rh: read/write IPV6_PRIVACY and IPV6_PRIVACY_PREFER_PUBLIC_IP 2012-02-27 16:28:25 +01:00
Dan Williams
e41218caaa ifnet: misc fixes (constness, error initialization) (bgo #670508) 2012-02-25 20:50:29 -06:00
Mu Qiao
4641649cc1 ifnet: backup configuration files before writing (bgo #670508) 2012-02-25 20:50:27 -06:00
Mu Qiao
cd867534da ifnet: remove wep_tx_keyidx only when necessary (bgo #670508)
Always removing wep_tx_keyidx will cause wpa_supplicant.conf being
written even if nothing has been changed. Now it will be removed only
when wep is not used anymore.
2012-02-25 20:50:24 -06:00
Mu Qiao
28047305db ifnet: fix IP comparison (bgo #670508)
IP comparison was not working due to different IP formats. Now this is
fixed.
2012-02-25 20:50:18 -06:00
Dan Williams
750cb8bb89 ifnet: add testcase for # in passphrase (bgo #670381) 2012-02-25 20:33:00 -06:00
Alexandre Rostovtsev
3feb769efa ifnet: do not truncate WPA passwords at '#' character (bgo #670381)
We need to do the same thing as wpa_supplicant's own config file parser
and ignore '#' characters that occur between the first and last '"'
characters in a config file line.

https://bugzilla.gnome.org/show_bug.cgi?id=670381
2012-02-25 20:32:39 -06:00
Weiping Pan
e8ffca398f ifcfg-rh: add "VLAN=yes" in ifcfg
Check "VLAN=yes" if "TYPE=Vlan" is missing.
They have the same meaning.

This patch is based on NM/vlan branch,
commit 703196fcdb96ad0d4bf8dac572235e65ba02e844

Signed-off-by: Weiping Pan <wpan@redhat.com>
2012-02-24 14:35:15 -06:00
Colin Walters
74ec56d956 build: fix srcdir != builddir for new generated headers 2012-02-22 16:27:28 -06:00
Weiping Pan
ccea442504 ifcfg-rh: add ifcfg-vlan writer
add write_vlan_setting() and modify test-ifcfg-rh.c to test it.

Signed-off-by: Weiping Pan <wpan@redhat.com>

(updates by dcbw for changes made to original patch series)
2012-02-16 15:20:50 -06:00
Dan Williams
b2d9fa2ecd ifcfg-rh: fix parsing of REORDER_HDR
It's a boolean value not a string.  Second, apparently the
kernel turns it on by default these days, so if it's missing
then assume it's supposed to be TRUE.
2012-02-16 15:05:55 -06:00
Dan Williams
ca689a0287 ifcfg-rh: clean up master interface/connection handling
VLAN and bonding both need it so putting these bits in the
code that creates the NMSettingConnection isn't quite right.
2012-02-16 15:05:55 -06:00
Weiping Pan
ee4b05cfc6 ifcfg-rh: add ifcfg-vlan parser
The example of ifcfg-vlan is as followed:

VLAN=yes
TYPE=Vlan
DEVICE=vlan43  or "DEVICE=eth9.43"
PHYSDEV=eth9
REORDER_HDR=0
VLAN_FLAGS=GVRP,LOOSE_BINDING
VLAN_INGRESS_PRIORITY_MAP=0:1,2:5
VLAN_EGRESS_PRIORITY_MAP=12:3,14:7
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.43.149
NETMASK=255.255.255.0

And we try to make it compitable with the format used by initscripts,
and there is no need to change anything in ifcfg-eth9.

Signed-off-by: Weiping Pan <wpan@redhat.com>

(dcbw: complete VLAN testcase)
2012-02-16 15:05:55 -06:00
Dan Williams
3f963d308a build: fix distcheck due to missing ifcfg-rh test files 2012-02-16 15:05:26 -06:00
Thomas Graf
4f166d719b bonding: convert individual bonding options to a dict
Removes all bonding options properties and adds a "options" dict to hold
them all. Accessible via accessor functions. ifcfg interface is
unchanged.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-02-15 21:49:05 -06:00
Thomas Graf
5a3e1caec1 ifcfg-rh: add bonding test cases
Adds two simple test cases for bonding masters and bonding slaves.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-02-15 21:28:33 -06:00
Dan Winship
839eab5564 Use glib-mkenums to generate enum types
Rather than generating enum classes by hand (and complaining in each
file that "this should really be standard"), use glib-mkenums.

Unfortunately, we need a very new version of glib-mkenums in order to
deal with NM's naming conventions and to fix a few other bugs, so just
import that into the source tree temporarily.

Also, to simplify the use of glib-mkenums, import Makefile.glib from
https://bugzilla.gnome.org/654395.

To avoid having to run glib-mkenums for every subdirectory of src/,
add a new "generated" directory, and put the generated enums files
there.

Finally, use Makefile.glib for marshallers too, and generate separate
ones for libnm-glib and NetworkManager.
2012-02-15 11:42:15 -05:00
Alexandre Rostovtsev
fe29aa967c ifnet: properly unquote hostnames with g_shell_unquote() (bgo #669148)
If /etc/conf.d/hostname contains "hostname='foo'", then the hostname
needs to be set to "foo", not "'foo'".

https://bugzilla.gnome.org/show_bug.cgi?id=669148
2012-02-13 11:03:28 +01:00
Dan Williams
d721d02c18 ifcfg-rh: sub filename characters that are annoying to type
Since people apparently hate any extra typing, and tools just can't
find it in them to deal with human readable file names, escape some
of the more annoying characters in shell-land.

Suggested by David Lutterkort
2012-02-09 18:38:27 -06:00
Dan Winship
c79b8085ee ifcfg-rh: belatedly add writer support for infiniband (and tests) 2012-02-02 12:24:03 -06:00
Jiří Klimeš
847edde23a ifcfg-rh: add read/write support for EAP-FAST 2012-01-27 12:54:20 +01:00
Dan Winship
b860c7be4a infiniband: add transport-mode property
Add transport-mode property to NMSettingInfiniband (and parse it
correctly in ifcfg-rh), and set it up properly on the device in
NMDeviceInfiniband.
2012-01-26 09:58:48 -06:00
Dan Williams
93f289bc13 ifcfg-rh: use correct location of wireless.h
We used to require wireless-tools.  We no longer do, so use the
kernel includes header here that we checked for at configure time.
2012-01-23 12:08:32 -06:00
Dan Williams
644e245c0b keyfile: crash less if conf_file is NULL
If for some reason we have no config file, don't segfault.
2012-01-13 16:42:58 -06:00
Colin Walters
8c6d3040dc keyfile: fix mismatched strdup/g_free
g_strdup is also NULL safe.
2012-01-13 00:34:23 -06:00
Colin Walters
dab7dfaf35 build: fix srcdir != builddir
nm-version.h is in ${top_builddir}/include.
2012-01-09 14:20:36 -06:00
Dan Williams
ff53b383f7 ifupdown: clean up IPv4/IPv6 parsing and fix some memleaks 2011-12-12 21:30:46 -06:00
Guido Günther
2c83670ed7 ifupdown: add support for ipv6 connections 2011-12-12 20:13:13 -06:00
Guido Günther
72bef29d5d ifupdown: add ifparser_haskey function 2011-12-12 20:10:36 -06:00
Guido Günther
92a3bc9e4c ifupdown: cleanup indentation
and remove unused variables.
2011-12-12 20:09:16 -06:00
Dan Williams
80852aa96a ifnet: make testcases happy
ifnet_plugin_get_conf_file() needs to be defined for the testcases.
2011-12-12 20:07:54 -06:00
Dan Williams
1d0c27590e ifnet: use SYSCONFDIR not /etc 2011-12-12 20:04:25 -06:00
Dan Williams
c579bf95a5 trivial: spacing fixes 2011-12-12 20:02:56 -06:00
Mu Qiao
6d09316b6f ifnet: support writing openrc style 2011-12-12 20:02:00 -06:00
Mu Qiao
76619e4529 ifnet: support reading openrc style
IP configuration like 192.168.1.{2..4} is not supported anymore.
2011-12-12 19:44:03 -06:00
Guido Günther
6dcd9114cb ifupdown: add testcase to verify parsing into NMConnection 2011-12-07 17:58:44 -06:00