aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154/6lowpan/tx.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-09-30 10:20:09 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-09-30 13:23:57 +0200
commit72d53b116264d5e570f610b3971dae4721aa5c0f (patch)
tree827f46282aae1be8cab5f4d13ed606ed3934fef6 /net/ieee802154/6lowpan/tx.c
parentmac802154: check on len instead mac_len (diff)
downloadlinux-dev-72d53b116264d5e570f610b3971dae4721aa5c0f.tar.xz
linux-dev-72d53b116264d5e570f610b3971dae4721aa5c0f.zip
ieee802154: 6lowpan: change datagram var types
This patch changes datagram size variable from u16 type to unsigned int. The reason is that an IPv6 header has an MAX_UIN16 payload length, but the datagram size is payload + IPv6 header length. This avoids overflows at some places. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to '')
-rw-r--r--net/ieee802154/6lowpan/tx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ieee802154/6lowpan/tx.c b/net/ieee802154/6lowpan/tx.c
index 7e0563eaea98..5ecf8af7154b 100644
--- a/net/ieee802154/6lowpan/tx.c
+++ b/net/ieee802154/6lowpan/tx.c
@@ -131,8 +131,8 @@ lowpan_xmit_fragment(struct sk_buff *skb, const struct ieee802154_hdr *wpan_hdr,
static int
lowpan_xmit_fragmented(struct sk_buff *skb, struct net_device *ldev,
- const struct ieee802154_hdr *wpan_hdr, u16 dgram_size,
- u16 dgram_offset)
+ const struct ieee802154_hdr *wpan_hdr,
+ unsigned int dgram_size, unsigned int dgram_offset)
{
__be16 frag_tag;
u8 frag_hdr[5];
@@ -194,7 +194,7 @@ err:
}
static int lowpan_header(struct sk_buff *skb, struct net_device *ldev,
- u16 *dgram_size, u16 *dgram_offset)
+ unsigned int *dgram_size, unsigned int *dgram_offset)
{
struct wpan_dev *wpan_dev = lowpan_dev_info(ldev)->wdev->ieee802154_ptr;
struct ieee802154_addr sa, da;
@@ -244,7 +244,7 @@ netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *ldev)
{
struct ieee802154_hdr wpan_hdr;
int max_single, ret;
- u16 dgram_size, dgram_offset;
+ unsigned int dgram_size, dgram_offset;
pr_debug("package xmit\n");