]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/netfilter/nf_conntrack_ftp.c
Merge branch 'i7300_idle' into release
[karo-tx-linux.git] / net / netfilter / nf_conntrack_ftp.c
index 7eff876bb8bc90405d1057556cd728c5f4178788..4f7107107e9974655a47fa7715615774a2259bc1 100644 (file)
@@ -318,7 +318,8 @@ static int find_nl_seq(u32 seq, const struct nf_ct_ftp_master *info, int dir)
 }
 
 /* We don't update if it's older than what we have. */
-static void update_nl_seq(u32 nl_seq, struct nf_ct_ftp_master *info, int dir,
+static void update_nl_seq(struct nf_conn *ct, u32 nl_seq,
+                         struct nf_ct_ftp_master *info, int dir,
                          struct sk_buff *skb)
 {
        unsigned int i, oldest = NUM_SEQ_TO_REMEMBER;
@@ -336,11 +337,11 @@ static void update_nl_seq(u32 nl_seq, struct nf_ct_ftp_master *info, int dir,
 
        if (info->seq_aft_nl_num[dir] < NUM_SEQ_TO_REMEMBER) {
                info->seq_aft_nl[dir][info->seq_aft_nl_num[dir]++] = nl_seq;
-               nf_conntrack_event_cache(IPCT_HELPINFO_VOLATILE, skb);
+               nf_conntrack_event_cache(IPCT_HELPINFO_VOLATILE, ct);
        } else if (oldest != NUM_SEQ_TO_REMEMBER &&
                   after(nl_seq, info->seq_aft_nl[dir][oldest])) {
                info->seq_aft_nl[dir][oldest] = nl_seq;
-               nf_conntrack_event_cache(IPCT_HELPINFO_VOLATILE, skb);
+               nf_conntrack_event_cache(IPCT_HELPINFO_VOLATILE, ct);
        }
 }
 
@@ -350,8 +351,9 @@ static int help(struct sk_buff *skb,
                enum ip_conntrack_info ctinfo)
 {
        unsigned int dataoff, datalen;
-       struct tcphdr _tcph, *th;
-       char *fb_ptr;
+       const struct tcphdr *th;
+       struct tcphdr _tcph;
+       const char *fb_ptr;
        int ret;
        u32 seq;
        int dir = CTINFO2DIR(ctinfo);
@@ -405,7 +407,7 @@ static int help(struct sk_buff *skb,
 
        /* Initialize IP/IPv6 addr to expected address (it's not mentioned
           in EPSV responses) */
-       cmd.l3num = ct->tuplehash[dir].tuple.src.l3num;
+       cmd.l3num = nf_ct_l3num(ct);
        memcpy(cmd.u3.all, &ct->tuplehash[dir].tuple.src.u3.all,
               sizeof(cmd.u3.all));
 
@@ -452,7 +454,7 @@ static int help(struct sk_buff *skb,
        daddr = &ct->tuplehash[!dir].tuple.dst.u3;
 
        /* Update the ftp info */
-       if ((cmd.l3num == ct->tuplehash[dir].tuple.src.l3num) &&
+       if ((cmd.l3num == nf_ct_l3num(ct)) &&
            memcmp(&cmd.u3.all, &ct->tuplehash[dir].tuple.src.u3.all,
                     sizeof(cmd.u3.all))) {
                /* Enrico Scholz's passive FTP to partially RNAT'd ftp
@@ -508,7 +510,7 @@ out_update_nl:
        /* Now if this ends in \n, update ftp info.  Seq may have been
         * adjusted by NAT code. */
        if (ends_in_nl)
-               update_nl_seq(seq, ct_ftp_info, dir, skb);
+               update_nl_seq(ct, seq, ct_ftp_info, dir, skb);
  out:
        spin_unlock_bh(&nf_ftp_lock);
        return ret;