ndisc: add __ndisc_opt_addr_space function

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>
This commit is contained in:
Alexander Aring 2016-06-15 21:20:19 +02:00 committed by David S. Miller
parent 848484c931
commit 1e82f961ac

View file

@ -127,9 +127,14 @@ 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 +
return __ndisc_opt_addr_space(dev->addr_len,
ndisc_addr_option_pad(dev->type));
}