diff options
author | David S. Miller <davem@davemloft.net> | 2018-11-16 20:26:30 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-16 20:26:30 -0800 |
commit | 5594923f6e708d393c906e38399b3d4a65d390e9 (patch) | |
tree | 185e10cb675041c528f4f7b641032f7059fb2d6e /net/batman-adv/bat_v_elp.c | |
parent | dfa0d55ff6be64e7b6881212a291cb95f8da3b08 (diff) | |
parent | d7d8bbb40a5b1f682ee6589e212934f4c6b8ad60 (diff) | |
download | linux-stable-5594923f6e708d393c906e38399b3d4a65d390e9.tar.gz linux-stable-5594923f6e708d393c906e38399b3d4a65d390e9.tar.bz2 linux-stable-5594923f6e708d393c906e38399b3d4a65d390e9.zip |
Merge tag 'batadv-net-for-davem-20181114' of git://git.open-mesh.org/linux-merge
Simon Wunderlich says:
====================
Here are two batman-adv bugfixes:
- Explicitly pad short ELP packets with zeros, by Sven Eckelmann
- Fix packet size calculation when merging fragments,
by Sven Eckelmann
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/batman-adv/bat_v_elp.c')
-rw-r--r-- | net/batman-adv/bat_v_elp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/batman-adv/bat_v_elp.c b/net/batman-adv/bat_v_elp.c index 9f481cfdf77d..e8090f099eb8 100644 --- a/net/batman-adv/bat_v_elp.c +++ b/net/batman-adv/bat_v_elp.c @@ -352,19 +352,21 @@ out: */ int batadv_v_elp_iface_enable(struct batadv_hard_iface *hard_iface) { + static const size_t tvlv_padding = sizeof(__be32); struct batadv_elp_packet *elp_packet; unsigned char *elp_buff; u32 random_seqno; size_t size; int res = -ENOMEM; - size = ETH_HLEN + NET_IP_ALIGN + BATADV_ELP_HLEN; + size = ETH_HLEN + NET_IP_ALIGN + BATADV_ELP_HLEN + tvlv_padding; hard_iface->bat_v.elp_skb = dev_alloc_skb(size); if (!hard_iface->bat_v.elp_skb) goto out; skb_reserve(hard_iface->bat_v.elp_skb, ETH_HLEN + NET_IP_ALIGN); - elp_buff = skb_put_zero(hard_iface->bat_v.elp_skb, BATADV_ELP_HLEN); + elp_buff = skb_put_zero(hard_iface->bat_v.elp_skb, + BATADV_ELP_HLEN + tvlv_padding); elp_packet = (struct batadv_elp_packet *)elp_buff; elp_packet->packet_type = BATADV_ELP; |