/* In UDPv4 a zero checksum means that the transmitter generated no * checksum. UDP-Lite (like IPv6) mandates checksums, hence packets
* with a zero checksum field are illegal. */ if (uh->check == 0) {
net_dbg_ratelimited("UDPLite: zeroed checksum field\n"); return 1;
}
cscov = ntohs(uh->len);
if (cscov == 0) /* Indicates that full coverage is required. */
; elseif (cscov < 8 || cscov > skb->len) { /* * Coverage length violates RFC 3828: log and discard silently.
*/
net_dbg_ratelimited("UDPLite: bad csum coverage %d/%d\n",
cscov, skb->len); return 1;
/* Fast-path computation of checksum. Socket may not be locked. */ staticinline __wsum udplite_csum(struct sk_buff *skb)
{ constint off = skb_transport_offset(skb); conststruct sock *sk = skb->sk; int len = skb->len - off;
if (udp_test_bit(UDPLITE_SEND_CC, sk)) {
u16 pcslen = READ_ONCE(udp_sk(sk)->pcslen);
if (pcslen < len) { if (pcslen > 0)
len = pcslen;
udp_hdr(skb)->len = htons(pcslen);
}
}
skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
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.