aboutsummaryrefslogtreecommitdiff
path: root/plugins/huawei/mm-modem-helpers-huawei.c
diff options
context:
space:
mode:
authorBen Chan <benchan@chromium.org>2018-01-26 14:25:56 -0800
committerDan Williams <dcbw@redhat.com>2018-01-27 12:13:18 -0600
commit456e1e0d0cb8f6f49d83359bcdb65b04fdbf77ff (patch)
tree40c04f2ebd7fdaf8e25f7463e94f9b300ead5fc9 /plugins/huawei/mm-modem-helpers-huawei.c
parent90b89bb9f4d055bc5713b733503e7d39c54ca55f (diff)
huawei: handle optional 0x prefix on hex numbers in ^DHCP response
On Huawei ME936, the hex numbers in the response to AT^DHCP contain the 0x prefix, e.g. AT^DHCP? ^DHCP: 0xda7d0e0a,0xff000000,0xdb7d0e0a,0xdb7d0e0a,0x01261aac,0x00000000,100000000,50000000 This patch updates mm_huawei_parse_dhcp_response() to handle the optional 0x prefix.
Diffstat (limited to 'plugins/huawei/mm-modem-helpers-huawei.c')
-rw-r--r--plugins/huawei/mm-modem-helpers-huawei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/huawei/mm-modem-helpers-huawei.c b/plugins/huawei/mm-modem-helpers-huawei.c
index fde1c791..e92552ed 100644
--- a/plugins/huawei/mm-modem-helpers-huawei.c
+++ b/plugins/huawei/mm-modem-helpers-huawei.c
@@ -230,7 +230,7 @@ mm_huawei_parse_dhcp_response (const char *reply,
* actually 10.10.1.1.
*/
- r = g_regex_new ("\\^DHCP:\\s*([0-9a-fA-F]+),([0-9a-fA-F]+),([0-9a-fA-F]+),([0-9a-fA-F]+),([0-9a-fA-F]+),([0-9a-fA-F]+),.*$", 0, 0, NULL);
+ r = g_regex_new ("\\^DHCP:\\s*(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),(?:0[xX])?([0-9a-fA-F]+),.*$", 0, 0, NULL);
g_assert (r != NULL);
matched = g_regex_match_full (r, reply, -1, 0, 0, &match_info, &match_error);