Commit c24831a1 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

net: skbuff: hide csum_not_inet when CONFIG_IP_SCTP not set

SCTP is not universally deployed, allow hiding its bit
from the skb.
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eb6fba75
...@@ -983,7 +983,9 @@ struct sk_buff { ...@@ -983,7 +983,9 @@ struct sk_buff {
__u8 decrypted:1; __u8 decrypted:1;
#endif #endif
__u8 slow_gro:1; __u8 slow_gro:1;
#if IS_ENABLED(CONFIG_IP_SCTP)
__u8 csum_not_inet:1; __u8 csum_not_inet:1;
#endif
#ifdef CONFIG_NET_SCHED #ifdef CONFIG_NET_SCHED
__u16 tc_index; /* traffic control index */ __u16 tc_index; /* traffic control index */
...@@ -5060,7 +5062,19 @@ static inline void skb_reset_redirect(struct sk_buff *skb) ...@@ -5060,7 +5062,19 @@ static inline void skb_reset_redirect(struct sk_buff *skb)
static inline bool skb_csum_is_sctp(struct sk_buff *skb) static inline bool skb_csum_is_sctp(struct sk_buff *skb)
{ {
#if IS_ENABLED(CONFIG_IP_SCTP)
return skb->csum_not_inet; return skb->csum_not_inet;
#else
return 0;
#endif
}
static inline void skb_reset_csum_not_inet(struct sk_buff *skb)
{
skb->ip_summed = CHECKSUM_NONE;
#if IS_ENABLED(CONFIG_IP_SCTP)
skb->csum_not_inet = 0;
#endif
} }
static inline void skb_set_kcov_handle(struct sk_buff *skb, static inline void skb_set_kcov_handle(struct sk_buff *skb,
......
...@@ -3315,8 +3315,7 @@ int skb_crc32c_csum_help(struct sk_buff *skb) ...@@ -3315,8 +3315,7 @@ int skb_crc32c_csum_help(struct sk_buff *skb)
skb->len - start, ~(__u32)0, skb->len - start, ~(__u32)0,
crc32c_csum_stub)); crc32c_csum_stub));
*(__le32 *)(skb->data + offset) = crc32c_csum; *(__le32 *)(skb->data + offset) = crc32c_csum;
skb->ip_summed = CHECKSUM_NONE; skb_reset_csum_not_inet(skb);
skb->csum_not_inet = 0;
out: out:
return ret; return ret;
} }
......
...@@ -376,8 +376,7 @@ static int tcf_csum_sctp(struct sk_buff *skb, unsigned int ihl, ...@@ -376,8 +376,7 @@ static int tcf_csum_sctp(struct sk_buff *skb, unsigned int ihl,
sctph->checksum = sctp_compute_cksum(skb, sctph->checksum = sctp_compute_cksum(skb,
skb_network_offset(skb) + ihl); skb_network_offset(skb) + ihl);
skb->ip_summed = CHECKSUM_NONE; skb_reset_csum_not_inet(skb);
skb->csum_not_inet = 0;
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment