/* In both cases we assume, that caller reserved enough room for headers.  */
static void ipv6_push_rthdr(struct sk_buff *skb, u8 *proto, struct ipv6_rt_hdr *opt, struct in6_addr **addr_p)
/* In both cases we assume, that caller reserved enough room for headers.  */
static void ipv6_push_rthdr(struct sk_buff *skb, u8 *proto, struct ipv6_rt_hdr *opt, struct in6_addr **addr_p)
{
	struct rt0_hdr *phdr, *ihdr;
	int hops;
	ihdr = (struct rt0_hdr *) opt;
	phdr = (struct rt0_hdr *) skb_push(skb, (ihdr->rt_hdr.hdrlen + 1) << 3);
	memcpy(phdr, ihdr, sizeof(struct rt0_hdr));
	hops = ihdr->rt_hdr.hdrlen >> 1;
	if (hops > 1)
		memcpy(phdr->addr, ihdr->addr + 1,
		       (hops - 1) * sizeof(struct in6_addr));
	ipv6_addr_copy(phdr->addr + (hops - 1), *addr_p);
	*addr_p = ihdr->addr;
	phdr->rt_hdr.nexthdr = *proto;
	*proto = NEXTHDR_ROUTING;
}