ndisc: add __ndisc_opt_addr_space function
authorAlexander Aring <aar@pengutronix.de>
Wed, 15 Jun 2016 19:20:19 +0000 (21:20 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Jun 2016 03:41:22 +0000 (20:41 -0700)
This patch adds __ndisc_opt_addr_space as low-level function for
ndisc_opt_addr_space which doesn't depend on net_device parameter.

Cc: David S. Miller <davem@davemloft.net>
Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Cc: James Morris <jmorris@namei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: Patrick McHardy <kaber@trash.net>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Alexander Aring <aar@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ndisc.h

index 2d8edaad29cb1cf0fe1e9a6dc9ae8f2653a3334e..4cee82654fe5d1095922dad1f891a233617f7940 100644 (file)
@@ -127,10 +127,15 @@ static inline int ndisc_addr_option_pad(unsigned short type)
        }
 }
 
+static inline int __ndisc_opt_addr_space(unsigned char addr_len, int pad)
+{
+       return NDISC_OPT_SPACE(addr_len + pad);
+}
+
 static inline int ndisc_opt_addr_space(struct net_device *dev)
 {
-       return NDISC_OPT_SPACE(dev->addr_len +
-                              ndisc_addr_option_pad(dev->type));
+       return __ndisc_opt_addr_space(dev->addr_len,
+                                     ndisc_addr_option_pad(dev->type));
 }
 
 static inline u8 *ndisc_opt_addr_data(struct nd_opt_hdr *p,