mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 08:48:07 +02:00
2005-10-17 Robert Love <rml@novell.com>
* src/backends/NetworkManagerDebian.c,
src/backends/NetworkManagerRedHat,
src/backends/NetworkManagerSuSE.c: allow '#' as a valid resolv.conf
comment delimiter.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1028 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
2d747adc14
commit
60785e336d
4 changed files with 12 additions and 5 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2005-10-17 Robert Love <rml@novell.com>
|
||||
|
||||
* src/backends/NetworkManagerDebian.c,
|
||||
src/backends/NetworkManagerRedHat,
|
||||
src/backends/NetworkManagerSuSE.c: allow '#' as a valid resolv.conf
|
||||
comment delimiter.
|
||||
|
||||
2005-10-17 Robert Love <rml@novell.com>
|
||||
|
||||
* src/backends/NetworkManagerSuSE.c: use SYSCONFDIR not open-coded
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ static void set_ip4_config_from_resolv_conf (const char *filename, NMIP4Config *
|
|||
char *line = split_contents[i];
|
||||
|
||||
/* Ignore comments */
|
||||
if (!line || (line[0] == ';'))
|
||||
if (!line || (line[0] == ';') || (line[0] == '#'))
|
||||
continue;
|
||||
|
||||
line = g_strstrip (line);
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ static void set_ip4_config_from_resolv_conf (const char *filename, NMIP4Config *
|
|||
char *line = split_contents[i];
|
||||
|
||||
/* Ignore comments */
|
||||
if (!line || (line[0] == ';'))
|
||||
if (!line || (line[0] == ';') || (line[0] == '#'))
|
||||
continue;
|
||||
|
||||
line = g_strstrip (line);
|
||||
|
|
|
|||
|
|
@ -358,14 +358,14 @@ static void set_ip4_config_from_resolv_conf (const char *filename, NMIP4Config *
|
|||
|
||||
if (!(split_contents = g_strsplit (contents, "\n", 0)))
|
||||
goto out;
|
||||
|
||||
|
||||
len = g_strv_length (split_contents);
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
char *line = split_contents[i];
|
||||
|
||||
/* Ignore comments */
|
||||
if (!line || (line[0] == ';'))
|
||||
if (!line || (line[0] == ';') || (line[0] == '#'))
|
||||
continue;
|
||||
|
||||
line = g_strstrip (line);
|
||||
|
|
@ -400,7 +400,7 @@ static void set_ip4_config_from_resolv_conf (const char *filename, NMIP4Config *
|
|||
}
|
||||
else if ((strncmp (line, "nameserver", 10) == 0) && (strlen (line) > 10))
|
||||
{
|
||||
guint32 addr = (guint32) (inet_addr (line + 11));
|
||||
guint32 addr = (guint32) (inet_addr (line + 11));
|
||||
|
||||
if (addr != (guint32) -1)
|
||||
nm_ip4_config_add_nameserver (ip4_config, addr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue