From a6a1faca24996aaab9527353e6112919cd99ca73 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 20 May 2003 04:56:40 -0700 Subject: [NET]: Clean up the divert ifdef mess. --- include/linux/divert.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'include/linux') diff --git a/include/linux/divert.h b/include/linux/divert.h index 66e56ec15b66..38497a643657 100644 --- a/include/linux/divert.h +++ b/include/linux/divert.h @@ -107,11 +107,24 @@ struct divert_cf /* diverter functions */ #include + +#ifdef CONFIG_NET_DIVERT int alloc_divert_blk(struct net_device *); void free_divert_blk(struct net_device *); int divert_ioctl(unsigned int cmd, struct divert_cf *arg); void divert_frame(struct sk_buff *skb); - +static inline void handle_diverter(struct sk_buff *skb) +{ + /* if diversion is supported on device, then divert */ + if (skb->dev->divert && skb->dev->divert->divert) + divert_frame(skb); +} + +#else +# define alloc_divert_blk(dev) (0) +# define free_divert_blk(dev) do {} while (0) +# define divert_ioctl(cmd, arg) (-ENOPKG) +# define handle_diverter(skb) do {} while (0) +#endif #endif - #endif /* _LINUX_DIVERT_H */ -- cgit v1.2.3