swh:1:snp:c3bf2749e3476071fa748f67b0ffa2fdc5fe49d9
Raw File
Tip revision: def9d2780727cec3313ed3522d0123158d87224d authored by Linus Torvalds on 20 January 2020, 00:02:49 UTC
Linux 5.5-rc7
Tip revision: def9d27
nf_reject.h
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _NF_REJECT_H
#define _NF_REJECT_H

#include <linux/types.h>
#include <uapi/linux/in.h>

static inline bool nf_reject_verify_csum(__u8 proto)
{
	/* Skip protocols that don't use 16-bit one's complement checksum
	 * of the entire payload.
	 */
	switch (proto) {
		/* Protocols with other integrity checks. */
		case IPPROTO_AH:
		case IPPROTO_ESP:
		case IPPROTO_SCTP:

		/* Protocols with partial checksums. */
		case IPPROTO_UDPLITE:
		case IPPROTO_DCCP:

		/* Protocols with optional checksums. */
		case IPPROTO_GRE:
			return false;
	}
	return true;
}

#endif /* _NF_REJECT_H */
back to top