The concept is fine. Please add some comments to the code about what is happening and why. The proposed patch is too sparse and has no comments.
> + skb = alloc_skb(hlen + sizeof(struct ipv6hdr) + sizeof(*msg) + > + ndisc_opt_addr_space(dev, > + NDISC_NEIGHBOUR_ADVERTISEMENT) + > + tlen, GFP_ATOMIC); > + if (!skb) > + return; Why not netdev_alloc_skb which takes care of padding and setting skb->dev? Rather than doing copy/paste of the code to generate a ND message, it would be better to have one function in IPv6 code that handles that. That would keep from having to fix code in two places in the future. Is there some way to extend ndisc_send_na?