X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fcompat.h;h=3b8d577ef1284c64724370d8a1f90fb8b9855f5b;hb=72e8bf28bb38e8816435c64859fb350215b6a9e6;hp=3113b961e7b4ba336a07e3bfa189df2f76f84f64;hpb=24f974c481bc5230552b23d96312f645f7533cd3;p=sliver-openvswitch.git diff --git a/datapath/compat.h b/datapath/compat.h index 3113b961e..3b8d577ef 100644 --- a/datapath/compat.h +++ b/datapath/compat.h @@ -81,4 +81,37 @@ static inline void skb_clear_rxhash(struct sk_buff *skb) #define SET_NETNSOK .netnsok = true, #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#ifdef CONFIG_NETFILTER +static inline u32 skb_get_mark(struct sk_buff *skb) +{ + return skb->nfmark; +} + +static inline void skb_set_mark(struct sk_buff *skb, u32 mark) +{ + skb->nfmark = mark; +} +#else /* CONFIG_NETFILTER */ +static inline u32 skb_get_mark(struct sk_buff *skb) +{ + return 0; +} + +static inline void skb_set_mark(struct sk_buff *skb, u32 mark) +{ +} +#endif +#else /* before 2.6.20 */ +static inline u32 skb_get_mark(struct sk_buff *skb) +{ + return skb->mark; +} + +static inline void skb_set_mark(struct sk_buff *skb, u32 mark) +{ + skb->mark = mark; +} +#endif /* after 2.6.20 */ + #endif /* compat.h */