netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Julius Volz" <juliusv@google.com>
To: "Simon Horman" <horms@verge.net.au>
Cc: netdev@vger.kernel.org, lvs-devel@vger.kernel.org,
	kaber@trash.net, vbusam@google.com
Subject: Re: [PATCHv3 16/24] IPVS: Add/adjust Netfilter hook functions and helpers for v6
Date: Wed, 3 Sep 2008 11:01:10 +0200	[thread overview]
Message-ID: <f4845fc0809030201x3961e795xdbdbe2c1060afb5@mail.gmail.com> (raw)
In-Reply-To: <20080903054359.GB16875@verge.net.au>

On Wed, Sep 3, 2008 at 7:44 AM, Simon Horman <horms@verge.net.au> wrote:
> On Tue, Sep 02, 2008 at 03:55:47PM +0200, Julius Volz wrote:
>> Add Netfilter hook functions or modify existing ones, if possible, to
>> process IPv6 packets. Some support functions are also added/modified for
>> this. ip_vs_nat_icmp_v6() was already added in the patch that added the v6
>> xmit functions, as it is called from one of them.
>
> Hi Julius,
>
> I was looking over this code a bit more closely to rebase someone
> elses patch (which I intend to post very soon). I noticed two
> minor things.
>
> 1) ipl doesn't seem to be needed in ip_vs_out_icmp() any more.
>   But actually I'm quite ok with it staying there because the
>   patch I was working on will need it.

ihl is still used for the length of the first IP header in the skb.
The struct "ip_vs_iphdr ciph" is only used later, for the embedded IP
header in the ICMP packet. It's needed because pp->conn_out_get()
expects a pointer to this struct as a parameter. I hope that makes
sense or did I miss something?

> 2) I wonder if iph could be initialised earleir in ip_vs_out_icmp_v6()

I'll answer this below:

> [snip]
>
>> @@ -727,11 +759,117 @@ static int ip_vs_out_icmp(struct sk_buff *skb, int *related)
>
>>       return verdict;
>>  }
>>
>> -static inline int is_tcp_reset(const struct sk_buff *skb)
>> +#ifdef CONFIG_IP_VS_IPV6
>> +static int ip_vs_out_icmp_v6(struct sk_buff *skb, int *related)
>> +{
>> +     struct ipv6hdr *iph;
>> +     struct icmp6hdr _icmph, *ic;
>> +     struct ipv6hdr  _ciph, *cih;    /* The ip header contained
>> +                                        within the ICMP */
>> +     struct ip_vs_iphdr ciph;
>> +     struct ip_vs_conn *cp;
>> +     struct ip_vs_protocol *pp;
>> +     unsigned int offset, verdict;
>> +
>> +     *related = 1;
>> +
>> +     /* reassemble IP fragments */
>> +     if (ipv6_hdr(skb)->nexthdr == IPPROTO_FRAGMENT) {
>> +             if (ip_vs_gather_frags_v6(skb, IP_DEFRAG_VS_OUT))
>> +                     return NF_STOLEN;
>> +     }
>> +
>> +     iph = ipv6_hdr(skb);
>
> Would it be worthwhile rearanging things so that iph is intialised
> before "/* reassemble IP fragments */" and used instead
> of ipv6_hdr(skb)->nexthdr in the if statement?

I followed the same structure as in the v4 version of ip_vs_out_icmp()
here. I think this might be needed because ip_vs_gather_frags{_v6}
changes the location of the IP header in the skb during reassembly?

>> +     offset = sizeof(struct ipv6hdr);
>> +     ic = skb_header_pointer(skb, offset, sizeof(_icmph), &_icmph);
>> +     if (ic == NULL)
>> +             return NF_DROP;
>> +
>> +     IP_VS_DBG(12, "Outgoing ICMPv6 (%d,%d) " NIP6_FMT "->" NIP6_FMT "\n",
>> +               ic->icmp6_type, ntohs(icmpv6_id(ic)),
>> +               NIP6(iph->saddr), NIP6(iph->daddr));
>
> [snip]
>
>



-- 
Julius Volz - Corporate Operations - SysOps

Google Switzerland GmbH - Identification No.: CH-020.4.028.116-1

  reply	other threads:[~2008-09-03  9:01 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-02 13:55 [PATCHv3 00/24] Add first IPv6 support to IPVS Julius Volz
2008-09-02 13:55 ` [PATCHv3 01/24] IPVS: Add CONFIG_IP_VS_IPV6 option for IPv6 support Julius Volz
2008-09-02 13:55 ` [PATCHv3 02/24] IPVS: Change IPVS data structures to support IPv6 addresses Julius Volz
2008-09-02 13:55 ` [PATCHv3 03/24] IPVS: Add general v4/v6 helper functions / data structures Julius Volz
2008-09-02 13:55 ` [PATCHv3 04/24] IPVS: Add debug macros for v4 and v6 address output Julius Volz
2008-09-02 13:55 ` [PATCHv3 05/24] IPVS: Add internal versions of sockopt interface structs Julius Volz
2008-09-02 13:55 ` [PATCHv3 06/24] IPVS: Convert __ip_vs_svc_get() and __ip_vs_fwm_get() Julius Volz
2008-09-02 13:55 ` [PATCHv3 07/24] IPVS: Add v6 support to ip_vs_service_get() Julius Volz
2008-09-02 13:55 ` [PATCHv3 08/24] IPVS: Add IPv6 support flag to schedulers Julius Volz
2008-09-02 13:55 ` [PATCHv3 09/24] IPVS: Add 'af' args to protocol handler functions Julius Volz
2008-09-02 13:55 ` [PATCHv3 10/24] IPVS: Add protocol debug functions for IPv6 Julius Volz
2008-09-05 12:43   ` [PATCH] ipvs: Mark tcp/udp v4 and v6 debug functions static Sven Wegener
2008-09-02 13:55 ` [PATCHv3 11/24] IPVS: Extend protocol DNAT/SNAT and state handlers Julius Volz
2008-09-02 13:55 ` [PATCHv3 12/24] IPVS: Extend functions for getting/creating connections Julius Volz
2008-09-05 11:46   ` [PATCH] ipvs: Use pointer to address from sync message Sven Wegener
2008-09-05 12:28     ` Julius Volz
2008-09-06  4:26       ` Simon Horman
2008-09-06  9:04         ` Julius Volz
2008-09-08  1:47           ` Simon Horman
2008-09-02 13:55 ` [PATCHv3 13/24] IPVS: Add IPv6 support to xmit() support functions Julius Volz
2008-09-02 13:55 ` [PATCHv3 14/24] IPVS: Add and bind IPv6 xmit functions Julius Volz
2008-09-02 13:55 ` [PATCHv3 15/24] IPVS: Extend scheduling functions for IPv6 support Julius Volz
2008-09-02 13:55 ` [PATCHv3 16/24] IPVS: Add/adjust Netfilter hook functions and helpers for v6 Julius Volz
2008-09-03  5:44   ` Simon Horman
2008-09-03  9:01     ` Julius Volz [this message]
2008-09-05  0:47       ` Simon Horman
2008-09-02 13:55 ` [PATCHv3 17/24] IPVS: Convert real server lookup functions Julius Volz
2008-09-02 13:55 ` [PATCHv3 18/24] IPVS: Convert procfs files for IPv6 entry output Julius Volz
2008-09-02 13:55 ` [PATCHv3 19/24] IVPS: Disable sync daemon for IPv6 connections Julius Volz
2008-09-02 13:55 ` [PATCHv3 20/24] IPVS: Turn off FTP application helper for IPv6 Julius Volz
2008-09-02 13:55 ` [PATCHv3 21/24] IPVS: Add function to determine if IPv6 address is local Julius Volz
2008-09-05 14:53   ` [PATCH] ipvs: Reject ipv6 link-local addresses for destinations Sven Wegener
2008-09-02 13:55 ` [PATCHv3 22/24] IPVS: Adjust various debug outputs to use new macros Julius Volz
2008-09-02 13:55 ` [PATCHv3 23/24] IPVS: Activate IPv6 Netfilter hooks Julius Volz
2008-09-02 13:55 ` [PATCHv3 24/24] IPVS: Allow adding IPv6 services from userspace Julius Volz
2008-09-05 11:47   ` [PATCH] ipvs: Return negative error values from ip_vs_edit_service() Sven Wegener
2008-09-03  0:40 ` [PATCHv3 00/24] Add first IPv6 support to IPVS Simon Horman
2008-09-03  9:03   ` Julius Volz
2008-09-05  1:25 ` Simon Horman
2008-09-05 11:05   ` Julius Volz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4845fc0809030201x3961e795xdbdbe2c1060afb5@mail.gmail.com \
    --to=juliusv@google.com \
    --cc=horms@verge.net.au \
    --cc=kaber@trash.net \
    --cc=lvs-devel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vbusam@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).