Commit 8ec5da41 authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller

ndisc: add __ndisc_fill_addr_option function

This patch adds __ndisc_fill_addr_option as low-level function for
ndisc_fill_addr_option 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: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Reviewed-by: default avatarStefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: default avatarAlexander Aring <aar@pengutronix.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f36ce84
...@@ -150,11 +150,10 @@ struct neigh_table nd_tbl = { ...@@ -150,11 +150,10 @@ struct neigh_table nd_tbl = {
}; };
EXPORT_SYMBOL_GPL(nd_tbl); EXPORT_SYMBOL_GPL(nd_tbl);
static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data) static void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data,
int data_len, int pad)
{ {
int pad = ndisc_addr_option_pad(skb->dev->type); int space = __ndisc_opt_addr_space(data_len, pad);
int data_len = skb->dev->addr_len;
int space = ndisc_opt_addr_space(skb->dev);
u8 *opt = skb_put(skb, space); u8 *opt = skb_put(skb, space);
opt[0] = type; opt[0] = type;
...@@ -172,6 +171,13 @@ static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data) ...@@ -172,6 +171,13 @@ static void ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data)
memset(opt, 0, space); memset(opt, 0, space);
} }
static inline void ndisc_fill_addr_option(struct sk_buff *skb, int type,
void *data)
{
__ndisc_fill_addr_option(skb, type, data, skb->dev->addr_len,
ndisc_addr_option_pad(skb->dev->type));
}
static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur, static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur,
struct nd_opt_hdr *end) struct nd_opt_hdr *end)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment