Skip to content

Commit bf0afe6

Browse files
committed
Smack: Fix build when NETWORK_SECMARK is not set
Use proper conditional compilation for the secmark field in the network skb. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
1 parent 322dd63 commit bf0afe6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

security/smack/smack_lsm.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3838,13 +3838,20 @@ static int smk_skb_to_addr_ipv6(struct sk_buff *skb, struct sockaddr_in6 *sip)
38383838
*
38393839
* Returns smack_known of the secmark or NULL if that won't work.
38403840
*/
3841+
#ifdef CONFIG_NETWORK_SECMARK
38413842
static struct smack_known *smack_from_skb(struct sk_buff *skb)
38423843
{
38433844
if (skb == NULL || skb->secmark == 0)
38443845
return NULL;
38453846

38463847
return smack_from_secid(skb->secmark);
38473848
}
3849+
#else
3850+
static inline struct smack_known *smack_from_skb(struct sk_buff *skb)
3851+
{
3852+
return NULL;
3853+
}
3854+
#endif
38483855

38493856
/**
38503857
* smack_from_netlbl - Smack data from the IP options in an skb

0 commit comments

Comments
 (0)