LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH 20/26] IPVS: Add IPv6 Netfilter hooks and add/modify support

To: "Julius R. Volz" <juliusv@xxxxxxxxxx>
Subject: Re: [PATCH 20/26] IPVS: Add IPv6 Netfilter hooks and add/modify support functions.
Cc: lvs-devel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, horms@xxxxxxxxxxxx, davem@xxxxxxxxxxxxx, vbusam@xxxxxxxxxx
From: Brian Haley <brian.haley@xxxxxx>
Date: Wed, 11 Jun 2008 21:55:35 -0400
Julius R. Volz wrote:
+#ifdef CONFIG_IP_VS_IPV6
+void ip_vs_nat_icmp_v6(struct sk_buff *skb, struct ip_vs_protocol *pp,
+                   struct ip_vs_conn *cp, int inout)
+{
+       struct ipv6hdr *iph      = ipv6_hdr(skb);
+       unsigned int icmp_offset = sizeof(struct ipv6hdr);
+       struct icmp6hdr *icmph   = (struct icmp6hdr *)(skb_network_header(skb) +
+                                                     icmp_offset);
+       struct ipv6hdr *ciph     = (struct ipv6hdr *)(icmph + 1);
+
+       if (inout) {
+               iph->saddr = cp->vaddr.v6;
+               ciph->daddr = cp->vaddr.v6;
+       } else {
+               iph->daddr = cp->daddr.v6;
+               ciph->saddr = cp->daddr.v6;
+       }

ipv6_addr_copy().

+       /* mangle the packet */
+       if (pp->snat_handler_v6 && !pp->snat_handler_v6(skb, pp, cp))
+               goto drop;
+       ipv6_hdr(skb)->saddr = cp->vaddr.v6;

ipv6_addr_copy().

-Brian
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>