~ubuntu-branches/debian/sid/network-manager/sid

« back to all changes in this revision

Viewing changes to debian/patches/51-normalized-keys.patch

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2011-03-06 20:59:46 UTC
  • Revision ID: james.westby@ubuntu.com-20110306205946-fpdcb3ordico3ylg
Tags: 0.8.2-6
* debian/patches/83-dnsmasq-send-no-config-file-instead-of-a-bogus-one.patch
  - Newer versions of dnsmasq validate the option parameters more strictly.
    Instead of passing a bogus file name simply use --conf-file without
    additional parameters. (Closes: #615082)
* debian/control
  - Remove old Conflicts/Replaces which were required for upgrades to
    squeeze.
  - Bump Breaks against network-manager-gnome to (<< 0.8.2) to avoid
    partial upgrades which can lead to problems with user settings for
    ethernet connections. (Closes: #612291)
* debian/ifblacklist_migrate.sh
  - Only comment out iface lines if we have an exact match for the network
    interface. (Closes: #612247)
* debian/patches/51-normalized-keys.patch
  - Normalize keys in ifupdown parser, so we accept options with either
    hyphens or underscores, like e.g. bridge_ports and bridge-ports.
    (Closes: #609831)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: network-manager/system-settings/plugins/ifupdown/interface_parser.c
 
2
===================================================================
 
3
--- network-manager.orig/system-settings/plugins/ifupdown/interface_parser.c    2011-03-06 20:49:32.229089569 +0100
 
4
+++ network-manager/system-settings/plugins/ifupdown/interface_parser.c 2011-03-06 20:53:09.749089571 +0100
 
5
@@ -51,6 +51,7 @@
 
6
 void add_data(const char *key,const char *data)
 
7
 {
 
8
        if_data *ret;
 
9
+       char *idx;
 
10
 
 
11
        // Check if there is a block where we can attach our data
 
12
        if (first == NULL)
 
13
@@ -58,6 +59,11 @@
 
14
 
 
15
        ret = (if_data*) calloc(1,sizeof(struct _if_data));
 
16
        ret->key = g_strdup(key);
 
17
+       // Normalize keys. Convert '_' to '-', as ifupdown accepts both variants.
 
18
+       // When querying keys via ifparser_getkey(), use '-'.
 
19
+       while ((idx = strrchr(ret->key, '_'))) {
 
20
+               *idx = '-';
 
21
+       }
 
22
        ret->data = g_strdup(data);
 
23
 
 
24
        if (last->info == NULL)
 
25
Index: network-manager/system-settings/plugins/ifupdown/plugin.c
 
26
===================================================================
 
27
--- network-manager.orig/system-settings/plugins/ifupdown/plugin.c      2011-03-06 20:49:36.721089570 +0100
 
28
+++ network-manager/system-settings/plugins/ifupdown/plugin.c   2011-03-06 20:50:13.493089573 +0100
 
29
@@ -368,7 +368,7 @@
 
30
                        /* Bridge configuration */
 
31
                        if(!strncmp ("br", block->name, 2)) {
 
32
                                /* Try to find bridge ports */
 
33
-                               const char *ports = ifparser_getkey (block, "bridge_ports");
 
34
+                               const char *ports = ifparser_getkey (block, "bridge-ports");
 
35
                                if (ports) {
 
36
                                        PLUGIN_PRINT("SCPlugin-Ifupdown", "found bridge ports %s for %s", ports, block->name);
 
37
                                        char **port_ifaces = g_strsplit_set (ports, " \t", -1);