From 8e929b1e1b7f67b14dd7a03064c0a6e48fd8ec52 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 5 Jul 2011 23:27:50 -0500 Subject: [PATCH] ifcfg-rh: fix for three-digit prefixes The regex only caught prefixes up to 99; anything over that was truncated to two digits. --- src/settings/plugins/ifcfg-rh/reader.c | 4 ++-- src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index c79d124f85..0c1cfa5b7c 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -975,9 +975,9 @@ read_route6_file (const char *filename, NMSettingIP6Config *s_ip6, GError **erro const char *pattern_empty = "^\\s*(\\#.*)?$"; const char *pattern_to1 = "^\\s*(" IPV6_ADDR_REGEX "|default)" /* IPv6 or 'default' keyword */ - "(?:/(\\d{1,2}))?"; /* optional prefix */ + "(?:/(\\d{1,3}))?"; /* optional prefix */ const char *pattern_to2 = "to\\s+(" IPV6_ADDR_REGEX "|default)" /* IPv6 or 'default' keyword */ - "(?:/(\\d{1,2}))?"; /* optional prefix */ + "(?:/(\\d{1,3}))?"; /* optional prefix */ const char *pattern_via = "via\\s+(" IPV6_ADDR_REGEX ")"; /* IPv6 of gateway */ const char *pattern_metric = "metric\\s+(\\d+)"; /* metric */ diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index b84e784b8d..9f44b5b5b5 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -6491,7 +6491,7 @@ test_write_wired_static (void) struct in6_addr ip6, ip6_1, ip6_2; struct in6_addr route1_dest, route2_dest, route1_nexthop, route2_nexthop; struct in6_addr dns6_1, dns6_2; - const guint32 route1_prefix = 64, route2_prefix = 0; + const guint32 route1_prefix = 64, route2_prefix = 128; const guint32 route1_metric = 99, route2_metric = 1; NMIP4Address *addr; NMIP6Address *addr6;