[riot-notifications] [RIOT-OS/RIOT] net/mqttsn: fix client ID length to comply to the standard (#11791)

Martine Lenders notifications at github.com
Thu Jul 4 12:15:15 CEST 2019


miri64 approved this pull request.

ACK. The specs do indeed give this restriction I tested as follows:

# Emcute

I tested with `examples/emcute_mqttsn` on `native`

Terminal 1:
```
dist/tools/tapsetup/tapsetup
ip addr list dev tapbr0
```
copy link-local address `<tap_ll>`
```
make -C examples/emcute_mqttsn/ clean all term
```
```
nib route add 5 default <tap_ll>
ifconfig 5 add affe::1
ifconfig
```

copy link-local address `<riot_ll>`

Terminal 2:
```
sudo ip addr beef::1 dev tapbr0
sudo ip route add affe::/64 via <riot_ll> dev tapbr0
make -C examples/emcute_mqttsn/ mosquitto_rsmb
```

Terminal 1:
```
con beef::1
```

Works as expected, `Ctrl+C` out of `pyterm`

Patch

```diff
diff --git a/examples/emcute_mqttsn/main.c b/examples/emcute_mqttsn/main.c
index f8b3ddec85..3757f9ad8a 100644
--- a/examples/emcute_mqttsn/main.c
+++ b/examples/emcute_mqttsn/main.c
@@ -29,7 +29,7 @@
 #include "net/ipv6/addr.h"
 
 #define EMCUTE_PORT         (1883U)
-#define EMCUTE_ID           ("gertrud")
+#define EMCUTE_ID           "emcute test ............"
 #define EMCUTE_PRIO         (THREAD_PRIORITY_MAIN - 1)
 
 #define NUMOFSUBS           (16U)
```

Terminal 1
```
python -c "print(len(\"emcute test ............\"))" # yields 24
make -C examples/emcute_mqttsn/ clean all term
```

As expected, `emcute` runs into an assertion failure:

```
sys/net/application_layer/emcute/emcute.c:495 => 0x565e1cba
*** RIOT kernel panic:
FAILED ASSERTION.
```

# Asymcute
I tested with `examples/asymcute_mqttsn` on `native` (and assume the steps to configure the host system were already done in emcute…)

Terminal 2:
```
make -C examples/emcute_mqttsn/ mosquitto_rsmb
```

Terminal 1:
```
make -C examples/asymcute_mqttsn/ clean all term
```
```
nib route add 6 default <tap_ll>
ifconfig 6 add affe::1
connect test [beef::1]
```

Works as expected, `Ctrl+C` out of `pyterm`

```
python -c "print(len(\"asymcute test ..........\"))" # yields 24
make -C examples/emcute_mqttsn/ term
```
```
nib route add 6 default <tap_ll>
ifconfig 6 add affe::1
connect "asymcute test .........." [beef::1]
```

yields as expected

```
error: failed to issue CONNECT request
```








-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11791#pullrequestreview-257957368
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190704/1931d814/attachment.html>


More information about the notifications mailing list