1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _NF_REJECT_H
3 #define _NF_REJECT_H
4 
5 static inline bool nf_reject_verify_csum(__u8 proto)
6 {
7 	/* Skip protocols that don't use 16-bit one's complement checksum
8 	 * of the entire payload.
9 	 */
10 	switch (proto) {
11 		/* Protocols with other integrity checks. */
12 		case IPPROTO_AH:
13 		case IPPROTO_ESP:
14 		case IPPROTO_SCTP:
15 
16 		/* Protocols with partial checksums. */
17 		case IPPROTO_UDPLITE:
18 		case IPPROTO_DCCP:
19 
20 		/* Protocols with optional checksums. */
21 		case IPPROTO_GRE:
22 			return false;
23 	}
24 	return true;
25 }
26 
27 #endif /* _NF_REJECT_H */
28