-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[POC] Azure Integration in RIOT OS #20223
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
APPLICATION = azure_pnp_demo | ||
|
||
# If no BOARD is found in the environment, use this default: | ||
BOARD ?= native | ||
|
||
# This has to be the absolute path to the RIOT base directory: | ||
RIOTBASE ?= $(CURDIR)/../.. | ||
|
||
# Comment this out to disable code in RIOT that does safety checking | ||
# which is not needed in a production environment but helps in the | ||
# development process: | ||
DEVELHELP ?= 1 | ||
|
||
# Change this to 0 show compiler invocation lines by default: | ||
QUIET ?= 1 | ||
|
||
WIFI_SSID ?= "Your_WiFi_name" | ||
WIFI_PASS ?= "Your_secure_password" | ||
|
||
# USEMODULE += mqtts_riot_iface | ||
|
||
CFLAGS += -DDEFAULT_CERT_DIR_CA=\"$(CURDIR)/certificates/digiCert_ca_azure.pem\" | ||
CFLAGS += -DDEFAULT_CERT_DIR_DEVICE_CERT_CHAIN=\"$(CURDIR)/certificates/az-riot-pnp-module-test-02-full-chain.cert.pem\" | ||
CFLAGS += -DDEFAULT_CERT_DIR_DEVICE_PRIVATE_KEY=\"$(CURDIR)/certificates/az-riot-pnp-module-test-02.key.pem\" | ||
|
||
CFLAGS += -DAZ_RIOT_DPS_REGISTRATION_ID=\"az-riot-pnp-module-test-02\" | ||
CFLAGS += -DAZ_RIOT_DPS_IDSCOPE=\"0ne00B1BDDA\" | ||
|
||
CFLAGS += -DDAZ_RIOT_HUB_HOST=\"TRHN-HUB.azure-devices.net\" | ||
CFLAGS += -DAZ_RIOT_HUB_DEVICEID=\"az-riot-pnp-module-test-02\" | ||
|
||
# Optionally include remoteDNS support. This includes resolution of names at an | ||
# upstream DNS server and the handling of RDNSS options in Router Advertisements | ||
# to auto-configure that upstream DNS server. | ||
# USEMODULE += sock_dns # include DNS client | ||
# USEMODULE += gnrc_ipv6_nib_dns # include RDNSS option handling | ||
|
||
|
||
USEMODULE += shell | ||
USEMODULE += shell_cmds_default | ||
USEMODULE += ps | ||
USEMODULE += netdev_default | ||
|
||
|
||
EXTERNAL_MODULE_DIRS += $(RIOTBASE)/modules | ||
USEMODULE += az_riot_pnp_iface | ||
|
||
|
||
# #### dns | ||
USEMODULE += sock_dns | ||
USEMODULE += auto_init_sock_dns | ||
# USEMODULE += gnrc_ipv6_nib_dns | ||
CFLAGS += -DCONFIG_AUTO_INIT_SOCK_DNS_SERVER_ADDR=\"fd12:dead:beef::1\" | ||
# #### dns | ||
CFLAGS += -DCONFIG_DNS_MSG_LEN=256 | ||
|
||
CFLAGS += -Wno-error=unused-parameter | ||
CFLAGS += -Wno-error=unused-value | ||
CFLAGS += -Wno-error=unused-variable | ||
|
||
CFLAGS += -Wno-strict-prototypes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should not be set by an application, if the warnings are in your code you should fix them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The warnings are in the package, I have added these flags in the package itself and forgot to clean the application. |
||
|
||
include $(RIOTBASE)/Makefile.include | ||
|
||
ifneq (,$(filter arch_esp,$(FEATURES_USED))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can set those unconditionally so users of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have started with the paho mqtt example, I kept these as it is. I think it would be nice if I remove all the wifi related setup, since this POC can only run on Native due to some limitations (how I read the certificate from memory using dynamic memory allocation) and it does not use any wifi feature. I missed cleaning this make file. |
||
CFLAGS += -DWIFI_SSID=\"$(WIFI_SSID)\" | ||
CFLAGS += -DWIFI_PASS=\"$(WIFI_PASS)\" | ||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Put board specific dependencies here | ||
|
||
ifneq (,$(filter arch_esp,$(FEATURES_USED))) | ||
USEMODULE += esp_wifi | ||
endif | ||
|
||
ifeq ($(BOARD),native) | ||
USEMODULE += netdev_default | ||
Comment on lines
+7
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why only native? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I will remove the checks. |
||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
BOARD_INSUFFICIENT_MEMORY := \ | ||
airfy-beacon \ | ||
arduino-duemilanove \ | ||
arduino-leonardo \ | ||
arduino-mega2560 \ | ||
arduino-nano \ | ||
arduino-uno \ | ||
atmega1284p \ | ||
atmega328p \ | ||
atmega328p-xplained-mini \ | ||
atxmega-a3bu-xplained \ | ||
blackpill-stm32f103c8 \ | ||
blackpill-stm32f103cb \ | ||
bluepill-stm32f030c8 \ | ||
bluepill-stm32f103c8 \ | ||
bluepill-stm32f103cb \ | ||
calliope-mini \ | ||
derfmega128 \ | ||
hifive1 \ | ||
hifive1b \ | ||
i-nucleo-lrwan1 \ | ||
im880b \ | ||
mega-xplained \ | ||
microbit \ | ||
microduino-corerf \ | ||
msb-430 \ | ||
msb-430h \ | ||
nrf51dongle \ | ||
nrf6310 \ | ||
nucleo-f030r8 \ | ||
nucleo-f031k6 \ | ||
nucleo-f042k6 \ | ||
nucleo-f070rb \ | ||
nucleo-f072rb \ | ||
nucleo-f302r8 \ | ||
nucleo-f303k8 \ | ||
nucleo-f334r8 \ | ||
nucleo-l011k4 \ | ||
nucleo-l031k6 \ | ||
nucleo-l053r8 \ | ||
samd10-xmini \ | ||
saml10-xpro \ | ||
saml11-xpro \ | ||
slstk3400a \ | ||
stk3200 \ | ||
stm32f030f4-demo \ | ||
stm32f0discovery \ | ||
stm32f7508-dk \ | ||
stm32g0316-disco \ | ||
stm32l0538-disco \ | ||
stm32mp157c-dk2 \ | ||
telosb \ | ||
waspmote-pro \ | ||
yunjia-nrf51822 \ | ||
z1 \ | ||
zigduino \ | ||
# |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
|
||
## Software to install | ||
Download and install ``Azure IoT explorer`` to test the IoT Hub part. It is also available for Linux, can be downloaded from [Azure IoT explorer](https://github.com/Azure/azure-iot-explorer/releases).<br/> | ||
Once the ``Azure IoT explorer`` is installed, add a connection to the IoT Hub usign the connection string of the instance in Azure portal. Optionaly, conneting to DPS is also possible.<br/> | ||
Opening ``Azure IoT explorer`` then selecting the IoT hub connection will list all the devices are registered with the IoT Hub.<br/> | ||
Select device when you are trying to send or receive messages for example D2C or C2D. | ||
|
||
## Pre-Configuration | ||
### Azure configuration | ||
If Azure portal setup is not done yet, please see the [Azure Portal README](./docs/Readme.md). | ||
|
||
### NAT64 and DNS64 configuration | ||
Here is a nice document by Professor Oliver Hahm [NAT64 Configuration](https://teaching.dahahm.de/riot/2023/09/29/RIOT_GNRC_ipv4.html) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of having the user go through the trouble of setting this all up themselves I'd just direct them to a public DNS64/NAT64 service and give this as optional information if they really want to set up their own. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But then we should also add a test that checks whether the public service is still available. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we could run such a service on the community server, then we could make it the default in RIOT |
||
|
||
### Obtain IP | ||
DNS64 currently is not configured from RIOT. Therefore, NAT64 IP of corresponding service enpoint have to be retrived manually. | ||
Following is the example used in the example | ||
|
||
global.azure-devices-provisioning.net 64:ff9b::3374:91ca<br/> | ||
TRHN-HUB.azure-devices.net 64:ff9b::2871:b0b5 | ||
|
||
#### optional : | ||
IP can be obtained using ``dig TRHN-HUB.azure-devices.net +short AAAA @2001:4860:4860::64`` where the IP of the DNS64 has to be specified. | ||
|
||
### Generating certificate | ||
This project offers a set of tools to generate certificates. | ||
1. open the script file ``/tools/certificate_tools/az_gen_cert.sh``, change the ``DeviceID`` to whatever device ID you prefer. | ||
It will generate a root CA, intermediate CA, and a device certificate. It will also generate the device certificate chain which is needed for this demo. | ||
The device certificate chain and the device private key will be stored in the certificate and the private directory. | ||
2. Check the appropiate permissions for the files and move ``device certificate chain`` and the ``device private key`` to the certificates folder of this application. | ||
3. Along with this two files, take the global digi cert CA from the applications certificate directory. | ||
4. see the application make file and add the paths to your certificates. | ||
5. If you need proof-of-possion, use the ``/tools/certificate_tools/verify_az_cert_gen.sh``. Open the file and change the Verification code to that you have got from Azure portal. | ||
Executing this command will generate a verification certificate in ``/tools/certificate_tools/certificate``. The code will be part of the name of the verification certificate. | ||
Please check the file permissions of the certificate and the upload it to Azure if you need Proof-of-possesion. | ||
|
||
### Modify make file | ||
1. along with the certificates, update ``AZ_RIOT_DPS_REGISTRATION_ID`` to the device ID you have chosen for device certificate. | ||
``AZ_RIOT_DPS_IDSCOPE`` to the ID scope of your DPS. | ||
2. Please don't forget to specify certificate location. | ||
|
||
# Testing | ||
### Running az_pnp_demo application | ||
1. first run ``/tools/network_config.sh``, it will create one tap interface and set an ip``fec0:affe::1`` to tapbr0. | ||
2. Running the applicaiton with ``sudo PORT=tap0 make all term``<br/> | ||
then check the interface number with ``ifconfig``<br/> | ||
then set ip with ``ifconfig 6 add fd12:dead:beef::200/64`` please change the interface 6 to the one got from <br/> | ||
then set ip with ``nib route add 6 :: fd12:dead:beef::1`` according to NAT64<br/> | ||
now ``ping 64:ff9b::3374:91ca`` test the reachability of NAT64 IP<br/> | ||
|
||
## Using Device Provisioning Service (DPS) | ||
> *Warning:* Since DNS64 is not working now, put the NAT64 IP of DPS in ``($RIOT_BASE)/modules/gnrc_wolfssl_tls/gnrc_wolfssl_tlc.c`` in function ``tcp_connect`` replace remoteIP variable before you run the application. Currently the IP is hard-coded. DNS has to perform here to dynamic retrival of IP in future. | ||
2. Once the application is compiled and running. Use ``con_dps`` command to connect to DPS. | ||
3. Once connected, use ``sub_dps`` command to subscribe DPS topics. | ||
4. Use ``reg_device`` command to provision this device. It will reply with a operation ID when status is assigning. | ||
5. Copy the ``operation_id`` then use ``query`` command with the ``operation_id`` as parameter. It will reply with the detail of the IoT Hub that has been assigned. | ||
Additionaly, the ``device_id`` that has been assigned to this device. | ||
6. Copy the IoT Hub address and the device ID. In this example, IoT hub address is ``TRHN-HUB.azure-devices.net`` and device id is ``az-riot-pnp-module-test-02``. | ||
7. Check the IoT Hub in the portal in the ``Devices`` section to confirm the device registration. | ||
8. An example from RIOT console.<br/> | ||
<img src="docs/images/device_provisioning_RIOT_terminal.png" alt="device_provisioning_RIOT_terminal" width="500"/> <br/> | ||
|
||
### state | ||
## RIOT device is successfully provisioned using x509 certificate | ||
|
||
## Using IoT Hub | ||
|
||
> *Warning:* Again, since DNS64 is not configured, put the NAT64 IP of IoT Hub in ``($RIOT_BASE)/modules/gnrc_wolfssl_tls/gnrc_wolfssl_tlc.c`` in function ``tcp_connect`` replace remoteIP variable. Then run the application again and follow the IP setup. | ||
|
||
1. Once the application is compiled and running. Do not forget to set IPs as shown earlier. | ||
2. Use ``con_hub`` command to connect to IoT Hub with the hub address and device ID. For example, ``con_hub TRHN-HUB.azure-devices.net az-riot-pnp-module-test-02`` | ||
Remember regardless of this addres the connection will use the IP in ``($RIOT_BASE)/modules/gnrc_wolfssl_tls/gnrc_wolfssl_tlc.c`` in function ``tcp_connect`` , as DN64 is not working now. | ||
3. Once connected, use ``sub_hub`` command to subscribe IoT Hub topics. | ||
4. Open ``Azure IoT explorer`` to test the IoT Hub part and navigate to the device that the application is working with. | ||
In the Telemetry section, start receiving the telemetry by pressing the start button.<br/> | ||
<img src="docs/images/D2C_at_explorer.png" alt="D2C at explorer" width="500"/> <br/> | ||
5. Send telemetry using ``send_telemetry`` command. Check ``Azure IoT explorer``, it should show the message sent from RIOT see the image above. | ||
6. From ``Azure IoT explorer`` send Cloud-to-Device (C2D) message. and check the RIOT terminal for the message arrival.<br/> | ||
<img src="docs/images/C2D_from_explorer.png" alt="C2D from explorer" width="500"/> <br/> | ||
7. From ``Azure IoT explorer`` Invoke a direct method and check the RIOT terminal for message arrival.<br/> | ||
<img src="docs/images/direct_method_invoke_from_IoT_explorer.png" alt="direct_method_invoke_from_IoT_explorer" width="700"/> | ||
8. From ``Azure IoT explorer`` update the device twin and save it. Check the RIOT terminal for message arrival.<br/> | ||
<img src="docs/images/DTw_from_explorer.png" alt="DTw_from_explorer" width="500"/> <br/> | ||
9. The RIOT terminal should show something similiar to the following:<br/> | ||
<img src="docs/images/all_operations_at_riot.png" alt="all_operations_at_riot.png" width="500"/> <br/> | ||
|
||
### state | ||
## RIOT device fully supports D2C, and C2D messages. And partially supports "Direct method" and "Device Twin" (Only receiving is supported right now) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDjDCCAnSgAwIBAgIQBFld1JGW1u3xp7VB4ViaVTANBgkqhkiG9w0BAQsFADA0 | ||
MTIwMAYDVQQDDClBenVyZSBJb1QgSHViIEludGVybWVkaWF0ZSBDZXJ0IFRlc3Qg | ||
T25seTAeFw0yMzEyMjgwMjEzMDlaFw0yNDAyMjYwMjEzMDlaMCUxIzAhBgNVBAMM | ||
GmF6LXJpb3QtcG5wLW1vZHVsZS10ZXN0LTAyMIIBIjANBgkqhkiG9w0BAQEFAAOC | ||
AQ8AMIIBCgKCAQEAsQcTyCGKrI9M4grm40k+vDOIOrt4CSJZ5ahJ5RwhzQsmu8Yl | ||
tBhOsjmXiINFZnXMGTV20TH6Z70FbJfj8CkKTRbJ8QR8lYk2XeeQaxp0cjNPuBIV | ||
OdDdln1fwxDJvFzAOZio79DprByZpnoU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2daWwebK5BeNQITNa1VjXMfW6ZqCDqZAt | ||
WyrxMio8fmQitoDySXgOffzmPGDSG19FuRyh6HlEto6hjCreyRSrG6uslGE2VDpD | ||
1nR5Vn8M0l+ThRQi4Beyq8Z9C+/DpB//kQ== | ||
-----END CERTIFICATE----- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
-----BEGIN PRIVATE KEY----- | ||
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCxBxPIIYqsj0zi | ||
CubjST68M4g6u3gJIlnlqEnlHCHNCya7xiW0GE6yOZeIg0VmdcwZNXbRMfpnvQVs | ||
l+PwKQpNFsnxBHyViTZd55BrGnRyM0+4EhU50N2WfV/DEMm8XMA5mKjv0OmsHJmm | ||
ehTR5AJOrux4x0vG62q/t5ADyIkmdbx/9SLojhbyAhVfFu/W70TNn4UpJrgIZcfE | ||
S+ndU6I4ymGJBn2S+5ZyyqCJfCVDGq65B90Ujd2PrsOCmtT/UOTnR1IDTCOm6y/s | ||
lmfFriRgiGKsxggQ765rM82ztJQPOP5BdirBu26z6qZDnrxYLEZNAyNdlq7Wcjj2 | ||
7FpGXudxAgMBAAECggEACzbkj5VjCzgaFGkWY/2cMMtJl6w6mBw0pQd6hD4Pp2/2 | ||
aId5P1Bu49F2169hMnLHQYLmilgSgdyH6cTcLAxIL8aqzPmOHuGjWmLfU47zI4I7 | ||
9vAw/LROOp3/TASAkyMuYOJaiV6q/uaM6+6TP7ykUhxjXz9Y0zrPTLfciAYofLwg | ||
5Evup2wCRT4x6U1UKOWT0+cnvRGAyo2Zb8E2gKPL1ISrTID1eVxP6cZcXYUDjD5b | ||
28ksM1rg+omuiaFyixJHj6DW33qMzQpGWzVfctIuK8Tf9twEjMmM/dq3psITZmeK | ||
cB2BW94esXKGA1d8SrenLWouK7kbx6oB4237VqnrMQKBgQDpsmOyOiaXiQKuOsbl | ||
tKRIIbADCbY+7r4/O5THZ/s5VlLr7f44/6YdOXDnzpLr9gsafTb5gxE4LhKPiW3W | ||
GUOXx1/mJQkp9TDrwTJCrNb7oQnJARuMkKZlcaZHEKiTrOLwg/Ax/Pg926hDWMgQ | ||
TL6hFeQTFPjjqgOI1nDQmRw5RQKBgQDB7CnPWgfGskj6B/l1TyMrm53j0p06TeYu | ||
u3wbtIfMfY6NhRCSs716/H5m3vW8r9QcKzobDVcijMtj7VZr/OC4xYYhAvHp6dsb | ||
kOyP90HwCuzD/LDeui4/5/S8ybSI1UHWmDio1OiwFIKhXmIHuTc5keLi8o9lOB7C | ||
s4iqYSdaPQKBgDIZvmndMZzXEK4Nh8qDGZ0lK7jbAiknwb2IpnLBhghay1gtI41Q | ||
sWoegGgRz0mq6+J36atAQBbNOclv6w41SFpnsdWDJx3JpP1F4+KLb2NuuMxQ4nkW | ||
IbYp0T33Akz2iYiKoJn247lPOBmIFQv5h/y81rKIknssXameX3049eYJAoGAL3TB | ||
zpJzsLZUkYt+Cq0xKCzO+L/D5k7F883B023chbh8ODnGEoCV8BD2RepuLJzCxZn2 | ||
gERFfJkD9RJRwd+ChvUfm9iCpwGpsxdGLP0PT9T8mAGwrvDU/KKhC8o4ufumPwPF | ||
adugjeaXCTJ1vvoef6Ip6ev+F4EiVfdljHx2CukCgYAooUK3OfiOXtk3uAG/eRL+ | ||
6PlAKQj15wKpjjOC/ja6a/5LKuqgFIb/Wk2ZXj5dFwxrxDSqL4nbwXndfNCtYrNL | ||
JRV2A+XV+orjGTUSVvjrKb8OqHEpA7rWJjAPl0V3LfhDT3u4UOnXbJ3MAK8CUpzA | ||
ihjSaJCrBgjwrOlL7fcIzA== | ||
-----END PRIVATE KEY----- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ | ||
RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDV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5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS | ||
R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp | ||
-----END CERTIFICATE----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with the default? (I think that's Google's DNS)
fd12:dead:beef::1
is not a global address, so that won't work.Or do we need DNS64 here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we do need DNS64 for now since - according to Microsoft - Azure IoT do not support IPv6 right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need DNS64 here. For example, RIOT has "global.azure-devices-provisioning.net" the address of Azure DPS which supports only IPv4. Since the POC is using gnrc, we need a IPv6 version of the DPS address. I setup a nat64 on my linux machine. When I use
dig global.azure-devices-provisioning.net +short AAAA @2001:4860:4860::64
it returnsWhich RIOT can not (or I don't know how to) parse using
sock_dns_query
function. Any help or a commit here would be much more appreciated. This you can find ingnrc_wolfssl_tls.c
as a commented todo option and also as warning in the Readme.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But could you also use a public server like
2001:67c:2b0::6
so users don’t have to do the setup first?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My current setup with nat64 and
nib
RIOT application can only access address prefixed with 64:ff9b::/96, any other public IP is not reachable since I have created the tap interface without uplink.The packet got lost at the tapbr0. I might have missed the routing configuration, but it did not follow the default routing for some reason.
I need some help here due to my lack of expertise in networking.
Therefore, I used google's public dns64 in my linux machine. (2001:4860:4860::64)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I use -u, for example,
-u eth0
, I miss the nat64 interface.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But then you can use a public DNS64/NAT64 service and don't have to set up anything yourself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing so, I get the following response with multiple answers, and the last one containing the IP(highlighted), but
dns_msg_parse_reply
can not parse the IP from it and I get -74(BadMsg) error returned. Please check the Wireshark screenshot below.Note: in the make file I had to do the following
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh looks like this uncovers a bug in our DNS parsing code - it fails here.
Unfortunately I have no idea what that while loop is supposed to do - maybe @miri64 has an idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#20857 provides a fix