Project

General

Profile

Bug #3031

ofono: wrong first DNS reported in log

Added by pespin about 1 year ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
03/04/2018
Due date:
% Done:

100%

Spec Reference:

Description

I saw in a test that once the context is attached successfully, ofono prints the properties:

/sierra_2: context activated {apn='inet46', path='/sierra_2/context2', properties={AccessPointName='inet46', Active=True, AuthenticationMethod='chap', IPv6.Settings={}, Name='Internet', Password='', Protocol='ip', Settings={Address='176.16.46.1', DomainNameServers=['8.8.8.8', '8.8.8.8'], Gateway='176.16.46.2', Interface='wwan1', Method='static', Netmask='255.255.255.252'}, Type='internet', Username='ogt'}, user='ogt'}

However, osmo-ggsn config for that IP states 1st DNS server is 192.168.0.1 instead of 8.8.8.8:

 apn inet46
  gtpu-mode tun
  tun-device tun46
  type-support v4v6
  ip prefix dynamic 176.16.46.0/24
  ip dns 0 192.168.100.1
  ip dns 1 8.8.8.8
  ip ifconfig 176.16.46.0/24
  ipv6 prefix dynamic fde4:8dba:82e1:2000:0:0:0:0/56
  ipv6 dns 0 2001:4860:4860::8888
  ipv6 dns 1 2001:4860:4860::8844
  ipv6 ifconfig fde4:8dba:82e1:2000:0:0:0:0/56
  ipv6 link-local fe80::1111:1111:1111:1112/64
  no shutdown

It would be nice to check the pcap traces to see if the 1st address is announced correctly or not, then it may be an ofono/modem issue.

History

#1 Updated by pespin about 1 year ago

osmo-ggsn seems to be sending the DNS in PCO fine according to pcap trace.

#2 Updated by pespin about 1 year ago

Packet forwarded to the MS by sgsn is fine too. the modem or ofono is changing the ip. Maybe the change is done to avoid presenting private address as a DNS?

#3 Updated by pespin about 1 year ago

  • Subject changed from wrong first DNS reported in log to ofono: wrong first DNS reported in log

#4 Updated by laforge about 1 year ago

Hi Pau,

On Sun, Mar 04, 2018 at 07:31:52PM +0000, pespin [REDMINE] wrote:

Packet forwarded to the MS by sgsn is fine too. the modem or ofono is changing the ip. Maybe the change is done to avoid presenting private address as a DNS?

I highly doubt this is intentional. Almost all operators will hand out private IP addresses
to the mobile phones, and I wouldn't be surprised if many/most also operate their own DNS servers
behind the GGSN. There would be no need for those to be public addresses.

Also, at least with modem modules like those in osmo-gsm-tester, they're
used in machine-to-machine use cases where people sometimes use a
"private APN" that will not have any public internet connectivity.

I suspect this change is unintentional. Maybe the second address is read
twice from an array, rather than 1st + 2nd somewhere in ofono or in the
modem firmware. Looking at QMI traces would help to establish whcih of
the two is faulty. Also, comparing against other modem models gives an
idea if it's more likely ofono or the modem.

#5 Updated by pespin 5 months ago

Update: This issue still happens. Today in osmo-gsm-tester prod:

19:24:43.160707 tst                          /gobi_2: context activated {apn='inet46', path='/gobi_2/context2', properties={AccessPointName='inet46', Active=True, AuthenticationMethod='chap', IPv6.Settings={}, Name='Internet', Password='', Protocol='ip', Settings={Address='176.16.46.2', DomainNameServers=['8.8.8.8', '8.8.8.8'], Gateway='176.16.46.1', Interface='wwan2', Method='static', Netmask='255.255.255.252'}, Type='internet', Username='ogt'}, user='ogt'}

And the osmo-ggsn config:

  ip dns 0 192.168.100.1
  ip dns 1 8.8.8.8

ofono output:

Dec 11 19:28:18 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs.c:get_ss_info_cb()
Dec 11 19:28:18 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs.c:handle_ss_info()
Dec 11 19:28:18 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs.c:extract_ss_info()
Dec 11 19:28:18 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs.c:extract_ss_info() radio in use 4
Dec 11 19:28:18 osmo-gsm-tester-prod ofonod[11951]: src/gprs.c:registration_status_cb() /gobi_1 error 0 status 1
Dec 11 19:28:18 osmo-gsm-tester-prod ofonod[11951]: src/gprs.c:ofono_gprs_status_notify() /gobi_1 status registered (1)
Dec 11 19:28:19 osmo-gsm-tester-prod ofonod[11951]: src/gprs.c:add_context() Registering new context
Dec 11 19:28:19 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:qmi_activate_primary() cid 1
Dec 11 19:28:19 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/qmibridge.c:ask_qmi() _REQ: QMI QMUX:
                                                    QMI   length  = 35
                                                    QMI   flags   = 0x00
                                                    QMI   service = "wds" 
                                                    QMI   client  = 6
                                                    QMI QMI:
                                                    QMI   flags       = "none" 
                                                    QMI   transaction = 328
                                                    QMI   tlv_length  = 23
                                                    QMI   message     = "Start Network" (0x0020)
                                                    QMI TLV:
                                                    QMI   type       = "APN" (0x14)
                                                    QMI   length     = 6
                                                    QMI   value      = 69:6E:65:74:34:36
                                                    QMI   translated = inet46
                                                    QMI TLV:
                                                    QMI   type       = "IP Family Preference" (0x19)
                                                    QMI   length     = 1
                                                    QMI   value      = 04
                                                    QMI   translated = ipv4
                                                    QMI TLV:
                                                    QMI   type       = "Authentication Preference" (0x16)
                                                    QMI   length     = 1
                                                    QMI   value      = 02
                                                    QMI   translated = chap
                                                    QMI TLV:
                                                    QMI   type       = "Username" (0x17)
                                                    QMI   length     = 3
                                                    QMI   value      = 6F:67:74
                                                    QMI   translated = ogt
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/qmibridge.c:ask_qmi() READ: QMI QMUX:
                                                    QMI   length  = 26
                                                    QMI   flags   = 0x80
                                                    QMI   service = "wds" 
                                                    QMI   client  = 6
                                                    QMI QMI:
                                                    QMI   flags       = "response" 
                                                    QMI   transaction = 328
                                                    QMI   tlv_length  = 14
                                                    QMI   message     = "Start Network" (0x0020)
                                                    QMI TLV:
                                                    QMI   type       = "Result" (0x02)
                                                    QMI   length     = 4
                                                    QMI   value      = 00:00:00:00
                                                    QMI   translated = SUCCESS
                                                    QMI TLV:
                                                    QMI   type       = "Packet Data Handle" (0x01)
                                                    QMI   length     = 4
                                                    QMI   value      = 78:2A:D3:47
                                                    QMI   translated = 1205021304
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:start_net_cb()
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:start_net_cb() packet handle 1205021304
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/qmibridge.c:ask_qmi() _REQ: QMI QMUX:
                                                    QMI   length  = 12
                                                    QMI   flags   = 0x00
                                                    QMI   service = "wds" 
                                                    QMI   client  = 6
                                                    QMI QMI:
                                                    QMI   flags       = "none" 
                                                    QMI   transaction = 329
                                                    QMI   tlv_length  = 0
                                                    QMI   message     = "Get Current Settings" (0x002D)
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/qmibridge.c:ask_qmi() READ: QMI QMUX:
                                                    QMI   length  = 26
                                                    QMI   flags   = 0x80
                                                    QMI   service = "wds" 
                                                    QMI   client  = 6
                                                    QMI QMI:
                                                    QMI   flags       = "indication" 
                                                    QMI   transaction = 0
                                                    QMI   tlv_length  = 14
                                                    QMI   message     = "Packet Service Status" (0x0022)
                                                    QMI TLV:
                                                    QMI   type       = "Connection Status" (0x01)
                                                    QMI   length     = 2
                                                    QMI   value      = 02:00
                                                    QMI   translated = [ status = 'connected' reconfiguration_required = 'no' ]
                                                    QMI TLV:
                                                    QMI   type       = "IP Family" (0x12)
                                                    QMI   length     = 1
                                                    QMI   value      = 04
                                                    QMI   translated = ipv4
                                                    QMI TLV:
                                                    QMI   type   = 0x13
                                                    QMI   length = 2
                                                    QMI   value  = 80:88
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:pkt_status_notify()
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:pkt_status_notify() conn status 2
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:pkt_status_notify() ip family 4
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/qmibridge.c:ask_qmi() READ: QMI QMUX:
                                                    QMI   length  = 128
                                                    QMI   flags   = 0x80
                                                    QMI   service = "wds" 
                                                    QMI   client  = 6
                                                    QMI QMI:
                                                    QMI   flags       = "response" 
                                                    QMI   transaction = 329
                                                    QMI   tlv_length  = 116
                                                    QMI   message     = "Get Current Settings" (0x002D)
                                                    QMI TLV:
                                                    QMI   type       = "Result" (0x02)
                                                    QMI   length     = 4
                                                    QMI   value      = 00:00:00:00
                                                    QMI   translated = SUCCESS
                                                    QMI TLV:
                                                    QMI   type       = "IPv4 Address" (0x1e)
                                                    QMI   length     = 4
                                                    QMI   value      = 01:2E:10:B0
                                                    QMI   translated = 2953850369
                                                    QMI TLV:
                                                    QMI   type       = "Primary IPv4 DNS Address" (0x15)
                                                    QMI   length     = 4
                                                    QMI   value      = 01:64:A8:C0
                                                    QMI   translated = 3232261121
                                                    QMI TLV:
                                                    QMI   type       = "Secondary IPv4 DNS Address" (0x16)
                                                    QMI   length     = 4
                                                    QMI   value      = 08:08:08:08
                                                    QMI   translated = 134744072
                                                    QMI TLV:
                                                    QMI   type       = "IPv4 Gateway Address" (0x20)
                                                    QMI   length     = 4
                                                    QMI   value      = 02:2E:10:B0
                                                    QMI   translated = 2953850370
                                                    QMI TLV:
                                                    QMI   type       = "IPv4 Gateway Subnet Mask" (0x21)
                                                    QMI   length     = 4
                                                    QMI   value      = FC:FF:FF:FF
                                                    QMI   translated = 4294967292
                                                    QMI TLV:
                                                    QMI   type       = "PCSCF Domain Name List" (0x24)
                                                    QMI   length     = 1
                                                    QMI   value      = 00
                                                    QMI   translated = {}
                                                    QMI TLV:
                                                    QMI   type       = "PCSCF Server Address List" (0x23)
                                                    QMI   length     = 1
                                                    QMI   value      = 00
                                                    QMI   translated = {}
                                                    QMI TLV:
                                                    QMI   type       = "Profile ID" (0x1f)
                                                    QMI   length     = 2
                                                    QMI   value      = 00:01
                                                    QMI   translated = [ profile_type = '3gpp' profile_index = '1' ]
                                                    QMI TLV:
                                                    QMI   type       = "Profile Name" (0x10)
                                                    QMI   length     = 8
                                                    QMI   value      = 70:72:6F:66:69:6C:65:31
                                                    QMI   translated = profile1
                                                    QMI TLV:
                                                    QMI   type       = "PDP Type" (0x11)
                                                    QMI   length     = 1
                                                    QMI   value      = 03
                                                    QMI   translated = ipv4-or-ipv6
                                                    QMI TLV:
                                                    QMI   type       = "APN Name" (0x14)
                                                    QMI   length     = 6
                                                    QMI   value      = 69:6E:65:74:34:36
                                                    QMI   translated = inet46
                                                    QMI TLV:
                                                    QMI   type       = "Authentication" (0x1d)
                                                    QMI   length     = 1
                                                    QMI   value      = 02
                                                    QMI   translated = chap
                                                    QMI TLV:
                                                    QMI   type       = "Username" (0x1b)
                                                    QMI   length     = 3
                                                    QMI   value      = 6F:67:74
                                                    QMI   translated = ogt
                                                    QMI TLV:
                                                    QMI   type       = "GPRS Granted QoS" (0x19)
                                                    QMI   length     = 20
                                                    QMI   value      = 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
                                                    QMI   translated = [ precedence_class = '0' delay_class = '0' reliability_class = '0' peak_throughput_class = '0' mean_throughput_class = '0' ]
                                                    QMI TLV:
                                                    QMI   type       = "PCSCF Address Using PCO" (0x22)
                                                    QMI   length     = 1
                                                    QMI   value      = 00
                                                    QMI   translated = 0
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:get_settings_cb()
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:get_settings_cb() APN: inet46
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:get_settings_cb() PDP type 3
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:get_settings_cb() IP addr: 176.16.46.1
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:get_settings_cb() Gateway: 176.16.46.2
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:get_settings_cb() Gateway netmask: 255.255.255.252
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:get_settings_cb() Primary DNS: 192.168.100.1
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: drivers/qmimodem/gprs-context.c:get_settings_cb() Secondary DNS: 8.8.8.8
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: src/modem.c:get_modem_property() modem 0x559e699006d0 property NetworkInterface
Dec 11 19:28:20 osmo-gsm-tester-prod ofonod[11951]: src/gprs.c:pri_activate_callback() 0x559e698f4f00

#6 Updated by pespin 5 months ago

So it seems Primary and Secondary DNS are parsed correctly in ofono, but forwarded incorrectly in the DBus interface.

#7 Updated by pespin 5 months ago

ofono code path:
get_settings_cb (drivers/qmimodem/gprs-context.c)
ofono_gprs_context_set_ipv4_dns_servers (src/gprs.c)
context_settings_append_ipv4 (src/gprs.c)
ofono_dbus_dict_append_array (src/dbus.c)
append_array_variant (src/dbus.c)
dbus_message_iter_append_basic (src/dbus.c)

I don't see any related difference in ofono indicating that the issue is fixed in master.
Looked at: git diff 1.23..master -- src/dbus.c src/gprs.c drivers/qmimodem/gprs-context.c

I did a quick look at master code and I cannot see the issue right away.

#8 Updated by pespin 5 months ago

  • File 0001-qmi-Fix-Secondary-DNS-overwriting-Primary-DNS.patch added

This patch should fix it, I'll send it now to ofono ML.

#9 Updated by pespin 5 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 80

#10 Updated by pespin 5 months ago

  • File deleted (0001-qmi-Fix-Secondary-DNS-overwriting-Primary-DNS.patch)

#12 Updated by pespin 5 months ago

  • Assignee changed from pespin to lynxis
  • % Done changed from 80 to 90

Patch has been merged upstream in master (1749018577d43ff8b3bf0fe565a4814e1d84de88), after 1.26 (so will be available for 1.27).

assigning to lynxis so he takes that into account when upgrading and packaging our ofono branch.

#13 Updated by lynxis about 1 month ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

The ofono branch got rebased (by pespin) to catch this patch up.

#14 Updated by pespin about 1 month ago

I confirm the issue is fixed with new ofono we use now.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)