// SPDX-License-Identifier: GPL-2.0-or-later /* * 6LoWPAN IPv6 UDP compression according to RFC6282 * * Authors: * Alexander Aring <aar@pengutronix.de> * * Original written by: * Alexander Smirnov <alex.bluesman.smirnov@gmail.com> * Jon Smirl <jonsmirl@gmail.com>
*/
/* checksum */ if (tmp & LOWPAN_NHC_UDP_CS_C) {
pr_debug_ratelimited("checksum elided currently not supported\n");
fail = true;
} else {
fail |= lowpan_fetch_skb(skb, &uh.check, sizeof(uh.check));
}
if (fail) return -EINVAL;
/* UDP length needs to be inferred from the lower layers * here, we obtain the hint from the remaining size of the * frame
*/ switch (lowpan_dev(skb->dev)->lltype) { case LOWPAN_LLTYPE_IEEE802154: if (lowpan_802154_cb(skb)->d_size)
uh.len = htons(lowpan_802154_cb(skb)->d_size - sizeof(struct ipv6hdr)); else
uh.len = htons(skb->len + sizeof(struct udphdr)); break; default:
uh.len = htons(skb->len + sizeof(struct udphdr)); break;
}
pr_debug("uncompressed UDP length: src = %d", ntohs(uh.len));
/* replace the compressed UDP head by the uncompressed UDP * header
*/
err = skb_cow(skb, needed); if (unlikely(err)) return err;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.