if (proto == IPPROTO_UDPLITE) {
err = udplite_checksum_init(skb, uh); if (err) return err;
if (UDP_SKB_CB(skb)->partial_cov) {
skb->csum = ip6_compute_pseudo(skb, proto); return0;
}
}
/* To support RFC 6936 (allow zero checksum in UDP/IPV6 for tunnels) *weacceptachecksumofzerohere.Whenwefindthesocket *fortheUDPpacketwe'llcheckifthatsocketallowszerochecksum *forIPv6(setbysocketoption). * *Note,weareonlyinterestedin!=0or==0,thusthe *forcetoint.
*/
err = (__force int)skb_checksum_init_zero_check(skb, proto, uh->check,
ip6_compute_pseudo); if (err) return err;
if (skb->ip_summed == CHECKSUM_COMPLETE && !skb->csum_valid) { /* If SW calculated the value, we know it's bad */ if (skb->csum_complete_sw) return1;
/* HW says the value is bad. Let's validate that. *skb->csumisnolongerthefullpacketchecksum, *sodon'ttreatisassuch.
*/
skb_checksum_complete_unset(skb);
}
return0;
}
EXPORT_SYMBOL(udp6_csum_init);
/* Function to set UDP checksum for an IPv6 UDP packet. This is intended *forthesimplecaselikewhensettingthechecksumforaUDPtunnel.
*/ void udp6_set_csum(bool nocheck, struct sk_buff *skb, conststruct in6_addr *saddr, conststruct in6_addr *daddr, int len)
{ struct udphdr *uh = udp_hdr(skb);
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.