diff options
-rw-r--r-- | plugins/huawei/mm-modem-helpers-huawei.c | 2 | ||||
-rw-r--r-- | plugins/huawei/tests/test-modem-helpers-huawei.c | 6 |
2 files changed, 7 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); diff --git a/plugins/huawei/tests/test-modem-helpers-huawei.c b/plugins/huawei/tests/test-modem-helpers-huawei.c index 46c90f44..70c40db2 100644 --- a/plugins/huawei/tests/test-modem-helpers-huawei.c +++ b/plugins/huawei/tests/test-modem-helpers-huawei.c @@ -154,10 +154,16 @@ typedef struct { static const DhcpTest dhcp_tests[] = { { "^DHCP:a3ec5c64,f8ffffff,a1ec5c64,a1ec5c64,2200b10a,74bba80a,236800,236800\r\n", "100.92.236.163", 29, "100.92.236.161", "10.177.0.34", "10.168.187.116" }, + { "^DHCP:0xa3ec5c64,0xf8ffffff,0xa1ec5c64,0xa1ec5c64,0x2200b10a,0x74bba80a,236800,236800\r\n", + "100.92.236.163", 29, "100.92.236.161", "10.177.0.34", "10.168.187.116" }, { "^DHCP: 1010A0A,FCFFFFFF,2010A0A,2010A0A,0,0,150000000,150000000\r\n", "10.10.1.1", 30, "10.10.1.2", "0.0.0.0", "0.0.0.0" }, { "^DHCP: CCDB080A,F8FFFFFF,C9DB080A,C9DB080A,E67B59C0,E77B59C0,85600,85600\r\n", "10.8.219.204", 29, "10.8.219.201", "192.89.123.230", "192.89.123.231" }, + { "^DHCP: 0xCCDB080A,0xF8FFFFFF,0xC9DB080A,0xC9DB080A,0xE67B59C0,0xE77B59C0,85600,85600\r\n", + "10.8.219.204", 29, "10.8.219.201", "192.89.123.230", "192.89.123.231" }, + { "^DHCP: 0XCCDB080A,0XF8FFFFFF,0XC9DB080A,0XC9DB080A,0XE67B59C0,0XE77B59C0,85600,85600\r\n", + "10.8.219.204", 29, "10.8.219.201", "192.89.123.230", "192.89.123.231" }, { NULL } }; |