|
|
c537d4 |
From 13a5a36d4da2cb456b338b94025150d8e3847a5f Mon Sep 17 00:00:00 2001
|
|
|
c537d4 |
From: Dominic Cleal <dcleal@redhat.com>
|
|
|
c537d4 |
Date: Wed, 12 Feb 2014 10:19:21 +0000
|
|
|
c537d4 |
Subject: [PATCH 2/2] IPRoute2: handle "/" in protocol names, swap ID and name
|
|
|
c537d4 |
fields
|
|
|
c537d4 |
|
|
|
c537d4 |
This is an incompatible change.
|
|
|
c537d4 |
|
|
|
c537d4 |
Fixes RHBZ#1063968
|
|
|
c537d4 |
|
|
|
c537d4 |
(cherry picked from commit bd6c783dc05ccf66af02fe24af703737823a99ad)
|
|
|
c537d4 |
|
|
|
c537d4 |
Conflicts:
|
|
|
c537d4 |
NEWS
|
|
|
c537d4 |
---
|
|
|
c537d4 |
lenses/iproute2.aug | 2 +-
|
|
|
c537d4 |
lenses/tests/test_iproute2.aug | 34 ++++++++++++++++++++++------------
|
|
|
c537d4 |
2 files changed, 23 insertions(+), 13 deletions(-)
|
|
|
c537d4 |
|
|
|
c537d4 |
diff --git a/lenses/iproute2.aug b/lenses/iproute2.aug
|
|
|
c537d4 |
index 6f6b1ba..fa3dcb7 100644
|
|
|
c537d4 |
--- a/lenses/iproute2.aug
|
|
|
c537d4 |
+++ b/lenses/iproute2.aug
|
|
|
c537d4 |
@@ -3,7 +3,7 @@ module IPRoute2 =
|
|
|
c537d4 |
|
|
|
c537d4 |
let empty = [ del /[ \t]*#?[ \t]*\n/ "\n" ]
|
|
|
c537d4 |
let id = Rx.hex | Rx.integer
|
|
|
c537d4 |
- let record = [ store id . del /[ \t]+/ "\t" . key /[a-zA-Z0-9-]+/ . Util.comment_or_eol ]
|
|
|
c537d4 |
+ let record = [ key id . del /[ \t]+/ "\t" . store /[a-zA-Z0-9\/-]+/ . Util.comment_or_eol ]
|
|
|
c537d4 |
|
|
|
c537d4 |
let lns = ( empty | Util.comment | record ) *
|
|
|
c537d4 |
|
|
|
c537d4 |
diff --git a/lenses/tests/test_iproute2.aug b/lenses/tests/test_iproute2.aug
|
|
|
c537d4 |
index cc24efe..2acd367 100644
|
|
|
c537d4 |
--- a/lenses/tests/test_iproute2.aug
|
|
|
c537d4 |
+++ b/lenses/tests/test_iproute2.aug
|
|
|
c537d4 |
@@ -24,6 +24,11 @@ let conf = "
|
|
|
c537d4 |
#
|
|
|
c537d4 |
0x00 default
|
|
|
c537d4 |
0x80 flash-override
|
|
|
c537d4 |
+
|
|
|
c537d4 |
+# From rt_protos
|
|
|
c537d4 |
+#
|
|
|
c537d4 |
+254 gated/aggr
|
|
|
c537d4 |
+253 gated/bgp
|
|
|
c537d4 |
"
|
|
|
c537d4 |
|
|
|
c537d4 |
test IPRoute2.lns get conf =
|
|
|
c537d4 |
@@ -32,22 +37,27 @@ test IPRoute2.lns get conf =
|
|
|
c537d4 |
{ }
|
|
|
c537d4 |
{ "#comment" = "reserved values" }
|
|
|
c537d4 |
{ }
|
|
|
c537d4 |
- { "local" = "255" }
|
|
|
c537d4 |
- { "main" = "254" }
|
|
|
c537d4 |
- { "default" = "253" }
|
|
|
c537d4 |
- { "unspec" = "0" }
|
|
|
c537d4 |
+ { "255" = "local" }
|
|
|
c537d4 |
+ { "254" = "main" }
|
|
|
c537d4 |
+ { "253" = "default" }
|
|
|
c537d4 |
+ { "0" = "unspec" }
|
|
|
c537d4 |
{ }
|
|
|
c537d4 |
{ "#comment" = "local" }
|
|
|
c537d4 |
{ }
|
|
|
c537d4 |
{ "#comment" = "1 inr.ruhep" }
|
|
|
c537d4 |
- { "h3g0" = "200" }
|
|
|
c537d4 |
- { "adsl1" = "201" }
|
|
|
c537d4 |
- { "adsl2" = "202" }
|
|
|
c537d4 |
- { "adsl3" = "203" }
|
|
|
c537d4 |
- { "adsl4" = "204" }
|
|
|
c537d4 |
- { "wifi0" = "205" }
|
|
|
c537d4 |
+ { "200" = "h3g0" }
|
|
|
c537d4 |
+ { "201" = "adsl1" }
|
|
|
c537d4 |
+ { "202" = "adsl2" }
|
|
|
c537d4 |
+ { "203" = "adsl3" }
|
|
|
c537d4 |
+ { "204" = "adsl4" }
|
|
|
c537d4 |
+ { "205" = "wifi0" }
|
|
|
c537d4 |
{ }
|
|
|
c537d4 |
{ "#comment" = "From rt_dsfield" }
|
|
|
c537d4 |
{ }
|
|
|
c537d4 |
- { "default" = "0x00" }
|
|
|
c537d4 |
- { "flash-override" = "0x80" }
|
|
|
c537d4 |
+ { "0x00" = "default" }
|
|
|
c537d4 |
+ { "0x80" = "flash-override" }
|
|
|
c537d4 |
+ { }
|
|
|
c537d4 |
+ { "#comment" = "From rt_protos" }
|
|
|
c537d4 |
+ { }
|
|
|
c537d4 |
+ { "254" = "gated/aggr" }
|
|
|
c537d4 |
+ { "253" = "gated/bgp" }
|
|
|
c537d4 |
--
|
|
|
c537d4 |
1.8.5.3
|
|
|
c537d4 |
|