Getaddrinfo failing after closing socket

Hi, I am running on a FX30S LTE-M WP77 with legato 19.11.5…

I can successufly create a data connection, resolve hostname using getaddrinfo.
I then close the socket.

I use le_data_Request and socket / close…

However any subsequent attempts to resolve a hostname then fail with "Temporary failure in name resolution "

cm data, shows there is a connection with DNS and gateway IP addresses.

root@fx30s:~# cm data
Index: 1
APN: *****
PDP Type: IPV4
Connected: yes
Interface: rmnet_data0
Family[IPv4]: inet
IP[IPv4]: ********
Gateway[IPv4]: *********
Dns1[IPv4]: 8.8.8.8
Dns2[IPv4]: 212.9.0.136

ping my.host.name
nslookup my.host.name 8.8.8.8
ping 8.8.8.8

all fails. They where fine before the initial connection in the legato app.
resolv.conf is correctly populated.

Any thoughts?

Thanks,Karl

If you disconnect data connection by “cm data connnect -1”, and thr restart data channel by “cm data”, can it be resolved?

Just tries that… it did not work.

Then is this network problem?

No I don’t think so… after reboot it work every time… the problem is repeatable…

Device reboots
connected to bearer
created data connection
getaddrinfo and open socket
send /rec data
close socket

ping, nslookup etc don’t work anymore

Thanks,

then how about you do radio on off?
cm radio off
cm radio on

you might also need to capture wireshark log on rmnet interface to see what happens inside

busy setting up tcpdump so I can do just that… will try radio on off… but that would not be a solution…

you can see here for wireshark log capturing:

I just get no reply… when “ping 8.8.8.8”

even after re-estabishment of data channel?
even after restart of radio by “cm radio”?

How do you reproduce the issue?

  1. cm data connect
  2. ping 8.8.8.8
  3. wait for some time
  4. ping does not work

it seems turning radio off then on resolves the issue.

To recreate… I start my app which
a) turns the radio on (if off) with le_mrc_SetRadioPower(LE_ON)
b) wait for network registration (in the le_mrc_AddNetRegStateEventHandler)
c) request data connection with le_data_Request()
d) wait for connection in le_data_AddConnectionStateHandler

At this point I can ping successfully to 8.8.8.8

then in my app it
e) get IP address for hostname using getaddrinfo and getnameinfo
f) create a non blocking socket using “connect”
g) send/receive data over socket
h) close the socket once done.

At this point I cannot ping to 8.8.8.8 anymore… I get no response as per tcpdump…

cm radio and cm data suggest I still have a connection… however I can’t successfully send/rec anything over rmnet…

cm data connect -1 followed by cm data connect does not seem to solve it… I need to cm radio off and then cm radio on…

However that is a problem as I cannot turn the radio off and on for each socket connection…

I assume I am doing something wrong… but can’t work out what…

can you reproduce the issue with cm tool only?

  1. cm data connect
  2. ping 8.8.8.8
  3. wait for some time

If I turn my app off and do the above… it does not fail… so something in the app is causing this… but what?

one idea is to try the modemdemo application, if it works, and then you can port the code there to your application
In this way, you don’t need to debug your current code