diff options
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r-- | net/ipv6/ndisc.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 1776a0deee7f..7ce266f34cc7 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c | |||
@@ -389,6 +389,31 @@ static struct sk_buff *ndisc_alloc_skb(struct net_device *dev, | |||
389 | return skb; | 389 | return skb; |
390 | } | 390 | } |
391 | 391 | ||
392 | static void ip6_nd_hdr(struct sock *sk, | ||
393 | struct sk_buff *skb, struct net_device *dev, | ||
394 | const struct in6_addr *saddr, | ||
395 | const struct in6_addr *daddr, | ||
396 | int proto, int len) | ||
397 | { | ||
398 | struct ipv6hdr *hdr; | ||
399 | |||
400 | skb->protocol = htons(ETH_P_IPV6); | ||
401 | skb->dev = dev; | ||
402 | |||
403 | skb_reset_network_header(skb); | ||
404 | skb_put(skb, sizeof(struct ipv6hdr)); | ||
405 | hdr = ipv6_hdr(skb); | ||
406 | |||
407 | ip6_flow_hdr(hdr, 0, 0); | ||
408 | |||
409 | hdr->payload_len = htons(len); | ||
410 | hdr->nexthdr = proto; | ||
411 | hdr->hop_limit = inet6_sk(sk)->hop_limit; | ||
412 | |||
413 | hdr->saddr = *saddr; | ||
414 | hdr->daddr = *daddr; | ||
415 | } | ||
416 | |||
392 | static struct sk_buff *ndisc_build_skb(struct net_device *dev, | 417 | static struct sk_buff *ndisc_build_skb(struct net_device *dev, |
393 | const struct in6_addr *daddr, | 418 | const struct in6_addr *daddr, |
394 | const struct in6_addr *saddr, | 419 | const struct in6_addr *saddr, |