/* To support RFC 6936 (allow zero checksum in UDP/IPV6 for tunnels) * we accept a checksum of zero here. When we find the socket * for the UDP packet we'll check if that socket allows zero checksum * for IPv6 (set by socket option). * * Note, we are only interested in != 0 or == 0, thus the * force to int.
*/
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) return 1;
/* HW says the value is bad. Let's validate that. * skb->csum is no longer the full packet checksum, * so don't treat is as such.
*/
skb_checksum_complete_unset(skb);
}
return 0;
}
EXPORT_SYMBOL(udp6_csum_init);
/* Function to set UDP checksum for an IPv6 UDP packet. This is intended * for the simple case like when setting the checksum for a UDP tunnel.
*/ 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.