[riot-notifications] [RIOT-OS/RIOT] gnrc_netif/lorawan: drop netif header on send (#16584)

José Alamos notifications at github.com
Thu Jun 24 15:30:21 CEST 2021


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description
This PR fixes a memory leak introduced by #16080. The netif hdr was not being released on send.

<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->


### Testing procedure
On current master:
```
2021-06-24 15:22:42,977 # ifconfig 3 up
> ifconfig
2021-06-24 15:22:53,247 # ifconfig
2021-06-24 15:22:53,258 # Iface  3  HWaddr: 26:01:4F:A0  Frequency: 869524963Hz  RSSI: 99  BW: 125kHz  SF: 12  CR: 4/5  Link: up 
2021-06-24 15:22:53,265 #            TX-Power: 14dBm  State: SLEEP  Demod margin.: 0  Num gateways.: 0 
2021-06-24 15:22:53,267 #           IQ_INVERT  
2021-06-24 15:22:53,271 #           RX_SINGLE  OTAA  L2-PDU:767  
2021-06-24 15:22:53,272 #           
txtsnd 3 01 "THIS IS RIOT!"
2021-06-24 15:22:58,717 # txtsnd 3 01 "THIS IS RIOT!"
ifconfig 3 set dr 5
2021-06-24 15:23:14,571 # ifconfig 3 set dr 5
2021-06-24 15:23:14,576 # success: set datarate on interface 3 to 5
txtsnd 3 01 "THIS IS RIOT!"
2021-06-24 15:23:16,002 # txtsnd 3 01 "THIS IS RIOT!"
> txtsnd 3 01 "THIS IS RIOT!"
2021-06-24 15:23:23,133 # txtsnd 3 01 "THIS IS RIOT!"
> txtsnd 3 01 "THIS IS RIOT!"
2021-06-24 15:23:36,768 # txtsnd 3 01 "THIS IS RIOT!"
> 2021-06-24 15:23:37,889 # PKTDUMP: data received:
2021-06-24 15:23:37,894 # ~~ SNIP  0 - size:   4 byte, type: NETTYPE_UNDEF (0)
2021-06-24 15:23:37,897 # 00000000  DE  AD  BE  EF
2021-06-24 15:23:37,901 # ~~ SNIP  1 - size:   9 byte, type: NETTYPE_NETIF (-1)
2021-06-24 15:23:37,905 # if_pid: 3  rssi: -32768  lqi: 0
2021-06-24 15:23:37,905 # flags: 0x0
2021-06-24 15:23:37,907 # src_l2addr: (nil)
2021-06-24 15:23:37,908 # dst_l2addr: 01
2021-06-24 15:23:37,912 # ~~ PKT    -  2 snips, total size:  13 byte
pktbuf
2021-06-24 15:23:44,918 # pktbuf
2021-06-24 15:23:44,924 # packet buffer: first byte: 0x2000119c, last byte: 0x2000139c (size: 512)
2021-06-24 15:23:44,928 #   position of last byte used: 128
2021-06-24 15:23:44,933 # ~ unused: 0x2000119c (next: (nil), size:  512) ~
> 
```

With this PR:
```
2021-06-24 15:22:42,977 # ifconfig 3 up
> ifconfig
2021-06-24 15:22:53,247 # ifconfig
2021-06-24 15:22:53,258 # Iface  3  HWaddr: 26:01:4F:A0  Frequency: 869524963Hz  RSSI: 99  BW: 125kHz  SF: 12  CR: 4/5  Link: up 
2021-06-24 15:22:53,265 #            TX-Power: 14dBm  State: SLEEP  Demod margin.: 0  Num gateways.: 0 
2021-06-24 15:22:53,267 #           IQ_INVERT  
2021-06-24 15:22:53,271 #           RX_SINGLE  OTAA  L2-PDU:767  
2021-06-24 15:22:53,272 #           
txtsnd 3 01 "THIS IS RIOT!"
2021-06-24 15:22:58,717 # txtsnd 3 01 "THIS IS RIOT!"
ifconfig 3 set dr 5
2021-06-24 15:23:14,571 # ifconfig 3 set dr 5
2021-06-24 15:23:14,576 # success: set datarate on interface 3 to 5
txtsnd 3 01 "THIS IS RIOT!"
2021-06-24 15:23:16,002 # txtsnd 3 01 "THIS IS RIOT!"
> txtsnd 3 01 "THIS IS RIOT!"
2021-06-24 15:23:23,133 # txtsnd 3 01 "THIS IS RIOT!"
> txtsnd 3 01 "THIS IS RIOT!"
2021-06-24 15:23:36,768 # txtsnd 3 01 "THIS IS RIOT!"
> 2021-06-24 15:23:37,889 # PKTDUMP: data received:
2021-06-24 15:23:37,894 # ~~ SNIP  0 - size:   4 byte, type: NETTYPE_UNDEF (0)
2021-06-24 15:23:37,897 # 00000000  DE  AD  BE  EF
2021-06-24 15:23:37,901 # ~~ SNIP  1 - size:   9 byte, type: NETTYPE_NETIF (-1)
2021-06-24 15:23:37,905 # if_pid: 3  rssi: -32768  lqi: 0
2021-06-24 15:23:37,905 # flags: 0x0
2021-06-24 15:23:37,907 # src_l2addr: (nil)
2021-06-24 15:23:37,908 # dst_l2addr: 01
2021-06-24 15:23:37,912 # ~~ PKT    -  2 snips, total size:  13 byte
pktbuf
2021-06-24 15:23:44,918 # pktbuf
2021-06-24 15:23:44,924 # packet buffer: first byte: 0x2000119c, last byte: 0x2000139c (size: 512)
2021-06-24 15:23:44,928 #   position of last byte used: 128
2021-06-24 15:23:44,933 # ~ unused: 0x2000119c (next: (nil), size:  512) ~

```

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references
#16080
<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/16584

-- Commit Summary --

  * gnrc_netif/lorawan: drop netif header on send

-- File Changes --

    M sys/net/gnrc/netif/lorawan/gnrc_netif_lorawan.c (5)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/16584.patch
https://github.com/RIOT-OS/RIOT/pull/16584.diff

-- 
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/16584
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210624/d989574f/attachment.htm>


More information about the notifications mailing list