/* Return IP protocol version from skb header. * Return 0 if protocol is not IPv4/IPv6 or cannot be read.
*/ staticinline __be16 ovpn_ip_check_protocol(struct sk_buff *skb)
{
__be16 proto = 0;
/* skb could be non-linear, * make sure IP header is in non-fragmented part
*/ if (!pskb_network_may_pull(skb, sizeof(struct iphdr))) return 0;
if (ip_hdr(skb)->version == 4) {
proto = htons(ETH_P_IP);
} elseif (ip_hdr(skb)->version == 6) { if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr))) return 0;
proto = htons(ETH_P_IPV6);
}
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.