]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
authorDavid S. Miller <davem@davemloft.net>
Thu, 21 Oct 2010 15:21:34 +0000 (08:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Oct 2010 15:21:34 +0000 (08:21 -0700)
1  2 
net/ipv4/netfilter/arp_tables.c
net/ipv6/af_inet6.c
net/ipv6/netfilter/ip6_tables.c
net/ipv6/tcp_ipv6.c
net/netfilter/ipvs/ip_vs_proto_sctp.c
net/netfilter/nf_conntrack_sip.c
net/netfilter/nf_tproxy_core.c

index 8b642f1524684fddfef0797ce4ea7ce6cca01a41,d756edae59ec6f3c85074b3809fd7dbe62daa08b..3cad2591ace0c15fdad446ab528b0f40c2624d09
@@@ -72,7 -72,7 +72,7 @@@ static inline int arp_devaddr_compare(c
        for (i = 0; i < len; i++)
                ret |= (hdr_addr[i] ^ ap->addr[i]) & ap->mask[i];
  
 -      return (ret != 0);
 +      return ret != 0;
  }
  
  /*
@@@ -228,7 -228,7 +228,7 @@@ arpt_error(struct sk_buff *skb, const s
        return NF_DROP;
  }
  
- static inline const struct arpt_entry_target *
+ static inline const struct xt_entry_target *
  arpt_get_target_c(const struct arpt_entry *e)
  {
        return arpt_get_target((struct arpt_entry *)e);
@@@ -282,7 -282,7 +282,7 @@@ unsigned int arpt_do_table(struct sk_bu
  
        arp = arp_hdr(skb);
        do {
-               const struct arpt_entry_target *t;
+               const struct xt_entry_target *t;
  
                if (!arp_packet_match(arp, skb->dev, indev, outdev, &e->arp)) {
                        e = arpt_next_entry(e);
                if (!t->u.kernel.target->target) {
                        int v;
  
-                       v = ((struct arpt_standard_target *)t)->verdict;
+                       v = ((struct xt_standard_target *)t)->verdict;
                        if (v < 0) {
                                /* Pop from stack? */
-                               if (v != ARPT_RETURN) {
+                               if (v != XT_RETURN) {
                                        verdict = (unsigned)(-v) - 1;
                                        break;
                                }
                /* Target might have changed stuff. */
                arp = arp_hdr(skb);
  
-               if (verdict == ARPT_CONTINUE)
+               if (verdict == XT_CONTINUE)
                        e = arpt_next_entry(e);
                else
                        /* Verdict */
@@@ -377,7 -377,7 +377,7 @@@ static int mark_source_chains(const str
                e->counters.pcnt = pos;
  
                for (;;) {
-                       const struct arpt_standard_target *t
+                       const struct xt_standard_target *t
                                = (void *)arpt_get_target_c(e);
                        int visited = e->comefrom & (1 << hook);
  
                        /* Unconditional return/END. */
                        if ((e->target_offset == sizeof(struct arpt_entry) &&
                             (strcmp(t->target.u.user.name,
-                                    ARPT_STANDARD_TARGET) == 0) &&
+                                    XT_STANDARD_TARGET) == 0) &&
                             t->verdict < 0 && unconditional(&e->arp)) ||
                            visited) {
                                unsigned int oldpos, size;
  
                                if ((strcmp(t->target.u.user.name,
-                                           ARPT_STANDARD_TARGET) == 0) &&
+                                           XT_STANDARD_TARGET) == 0) &&
                                    t->verdict < -NF_MAX_VERDICT - 1) {
                                        duprintf("mark_source_chains: bad "
                                                "negative verdict (%i)\n",
                                int newpos = t->verdict;
  
                                if (strcmp(t->target.u.user.name,
-                                          ARPT_STANDARD_TARGET) == 0 &&
+                                          XT_STANDARD_TARGET) == 0 &&
                                    newpos >= 0) {
                                        if (newpos > newinfo->size -
                                                sizeof(struct arpt_entry)) {
  
  static inline int check_entry(const struct arpt_entry *e, const char *name)
  {
-       const struct arpt_entry_target *t;
+       const struct xt_entry_target *t;
  
        if (!arp_checkentry(&e->arp)) {
                duprintf("arp_tables: arp check failed %p %s.\n", e, name);
                return -EINVAL;
        }
  
-       if (e->target_offset + sizeof(struct arpt_entry_target) > e->next_offset)
+       if (e->target_offset + sizeof(struct xt_entry_target) > e->next_offset)
                return -EINVAL;
  
        t = arpt_get_target_c(e);
  
  static inline int check_target(struct arpt_entry *e, const char *name)
  {
-       struct arpt_entry_target *t = arpt_get_target(e);
+       struct xt_entry_target *t = arpt_get_target(e);
        int ret;
        struct xt_tgchk_param par = {
                .table     = name,
  static inline int
  find_check_entry(struct arpt_entry *e, const char *name, unsigned int size)
  {
-       struct arpt_entry_target *t;
+       struct xt_entry_target *t;
        struct xt_target *target;
        int ret;
  
@@@ -536,7 -536,7 +536,7 @@@ out
  
  static bool check_underflow(const struct arpt_entry *e)
  {
-       const struct arpt_entry_target *t;
+       const struct xt_entry_target *t;
        unsigned int verdict;
  
        if (!unconditional(&e->arp))
        t = arpt_get_target_c(e);
        if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
                return false;
-       verdict = ((struct arpt_standard_target *)t)->verdict;
+       verdict = ((struct xt_standard_target *)t)->verdict;
        verdict = -verdict - 1;
        return verdict == NF_DROP || verdict == NF_ACCEPT;
  }
@@@ -566,7 -566,7 +566,7 @@@ static inline int check_entry_size_and_
        }
  
        if (e->next_offset
-           < sizeof(struct arpt_entry) + sizeof(struct arpt_entry_target)) {
+           < sizeof(struct arpt_entry) + sizeof(struct xt_entry_target)) {
                duprintf("checking: element %p size %u\n",
                         e, e->next_offset);
                return -EINVAL;
  static inline void cleanup_entry(struct arpt_entry *e)
  {
        struct xt_tgdtor_param par;
-       struct arpt_entry_target *t;
+       struct xt_entry_target *t;
  
        t = arpt_get_target(e);
        par.target   = t->u.kernel.target;
@@@ -794,7 -794,7 +794,7 @@@ static int copy_entries_to_user(unsigne
        /* FIXME: use iterator macros --RR */
        /* ... then go back and fix counters and names */
        for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){
-               const struct arpt_entry_target *t;
+               const struct xt_entry_target *t;
  
                e = (struct arpt_entry *)(loc_cpu_entry + off);
                if (copy_to_user(userptr + off
  
                t = arpt_get_target_c(e);
                if (copy_to_user(userptr + off + e->target_offset
-                                + offsetof(struct arpt_entry_target,
+                                + offsetof(struct xt_entry_target,
                                            u.user.name),
                                 t->u.kernel.target->name,
                                 strlen(t->u.kernel.target->name)+1) != 0) {
@@@ -844,7 -844,7 +844,7 @@@ static int compat_calc_entry(const stru
                             const struct xt_table_info *info,
                             const void *base, struct xt_table_info *newinfo)
  {
-       const struct arpt_entry_target *t;
+       const struct xt_entry_target *t;
        unsigned int entry_offset;
        int off, i, ret;
  
@@@ -895,7 -895,7 +895,7 @@@ static int compat_table_info(const stru
  static int get_info(struct net *net, void __user *user,
                      const int *len, int compat)
  {
-       char name[ARPT_TABLE_MAXNAMELEN];
+       char name[XT_TABLE_MAXNAMELEN];
        struct xt_table *t;
        int ret;
  
        if (copy_from_user(name, user, sizeof(name)) != 0)
                return -EFAULT;
  
-       name[ARPT_TABLE_MAXNAMELEN-1] = '\0';
+       name[XT_TABLE_MAXNAMELEN-1] = '\0';
  #ifdef CONFIG_COMPAT
        if (compat)
                xt_compat_lock(NFPROTO_ARP);
@@@ -1204,7 -1204,7 +1204,7 @@@ static int do_add_counters(struct net *
  #ifdef CONFIG_COMPAT
  static inline void compat_release_entry(struct compat_arpt_entry *e)
  {
-       struct arpt_entry_target *t;
+       struct xt_entry_target *t;
  
        t = compat_arpt_get_target(e);
        module_put(t->u.kernel.target->me);
@@@ -1220,7 -1220,7 +1220,7 @@@ check_compat_entry_size_and_hooks(struc
                                  const unsigned int *underflows,
                                  const char *name)
  {
-       struct arpt_entry_target *t;
+       struct xt_entry_target *t;
        struct xt_target *target;
        unsigned int entry_offset;
        int ret, off, h;
@@@ -1288,7 -1288,7 +1288,7 @@@ compat_copy_entry_from_user(struct comp
                            unsigned int *size, const char *name,
                            struct xt_table_info *newinfo, unsigned char *base)
  {
-       struct arpt_entry_target *t;
+       struct xt_entry_target *t;
        struct xt_target *target;
        struct arpt_entry *de;
        unsigned int origsize;
@@@ -1474,7 -1474,7 +1474,7 @@@ out_unlock
  }
  
  struct compat_arpt_replace {
-       char                            name[ARPT_TABLE_MAXNAMELEN];
+       char                            name[XT_TABLE_MAXNAMELEN];
        u32                             valid_hooks;
        u32                             num_entries;
        u32                             size;
@@@ -1567,7 -1567,7 +1567,7 @@@ static int compat_copy_entry_to_user(st
                                     struct xt_counters *counters,
                                     unsigned int i)
  {
-       struct arpt_entry_target *t;
+       struct xt_entry_target *t;
        struct compat_arpt_entry __user *ce;
        u_int16_t target_offset, next_offset;
        compat_uint_t origsize;
@@@ -1628,7 -1628,7 +1628,7 @@@ static int compat_copy_entries_to_user(
  }
  
  struct compat_arpt_get_entries {
-       char name[ARPT_TABLE_MAXNAMELEN];
+       char name[XT_TABLE_MAXNAMELEN];
        compat_uint_t size;
        struct compat_arpt_entry entrytable[0];
  };
@@@ -1828,7 -1828,7 +1828,7 @@@ void arpt_unregister_table(struct xt_ta
  /* The built-in targets: standard (NULL) and error. */
  static struct xt_target arpt_builtin_tg[] __read_mostly = {
        {
-               .name             = ARPT_STANDARD_TARGET,
+               .name             = XT_STANDARD_TARGET,
                .targetsize       = sizeof(int),
                .family           = NFPROTO_ARP,
  #ifdef CONFIG_COMPAT
  #endif
        },
        {
-               .name             = ARPT_ERROR_TARGET,
+               .name             = XT_ERROR_TARGET,
                .target           = arpt_error,
-               .targetsize       = ARPT_FUNCTION_MAXNAMELEN,
+               .targetsize       = XT_FUNCTION_MAXNAMELEN,
                .family           = NFPROTO_ARP,
        },
  };
diff --combined net/ipv6/af_inet6.c
index 60220985bb806ecf5b366315bdfe5508757c86f8,4869797c1afa1486fb93c64d5e5b4ac7a70d37f4..54e8e42f7a88ad675aae5fb4782d6ce36d9a4ba9
@@@ -343,7 -343,8 +343,8 @@@ int inet6_bind(struct socket *sock, str
                         */
                        v4addr = LOOPBACK4_IPV6;
                        if (!(addr_type & IPV6_ADDR_MULTICAST)) {
-                               if (!ipv6_chk_addr(net, &addr->sin6_addr,
+                               if (!inet->transparent &&
+                                   !ipv6_chk_addr(net, &addr->sin6_addr,
                                                   dev, 0)) {
                                        err = -EADDRNOTAVAIL;
                                        goto out_unlock;
@@@ -467,7 -468,7 +468,7 @@@ int inet6_getname(struct socket *sock, 
        if (ipv6_addr_type(&sin->sin6_addr) & IPV6_ADDR_LINKLOCAL)
                sin->sin6_scope_id = sk->sk_bound_dev_if;
        *uaddr_len = sizeof(*sin);
 -      return(0);
 +      return 0;
  }
  
  EXPORT_SYMBOL(inet6_getname);
@@@ -488,7 -489,7 +489,7 @@@ int inet6_ioctl(struct socket *sock, un
        case SIOCADDRT:
        case SIOCDELRT:
  
 -              return(ipv6_route_ioctl(net, cmd, (void __user *)arg));
 +              return ipv6_route_ioctl(net, cmd, (void __user *)arg);
  
        case SIOCSIFADDR:
                return addrconf_add_ifaddr(net, (void __user *) arg);
                return sk->sk_prot->ioctl(sk, cmd, arg);
        }
        /*NOTREACHED*/
 -      return(0);
 +      return 0;
  }
  
  EXPORT_SYMBOL(inet6_ioctl);
index 6b331e9b57065c32c94ac15f53bd592b2020c7af,c683e9e7023bd6a55b2778da36bff7d5fe3d61bf..51df035897e77dfa5b89e6328817cfcb638702cb
@@@ -82,13 -82,13 +82,13 @@@ EXPORT_SYMBOL_GPL(ip6t_alloc_initial_ta
  int
  ip6t_ext_hdr(u8 nexthdr)
  {
 -      return ( (nexthdr == IPPROTO_HOPOPTS)   ||
 -               (nexthdr == IPPROTO_ROUTING)   ||
 -               (nexthdr == IPPROTO_FRAGMENT)  ||
 -               (nexthdr == IPPROTO_ESP)       ||
 -               (nexthdr == IPPROTO_AH)        ||
 -               (nexthdr == IPPROTO_NONE)      ||
 -               (nexthdr == IPPROTO_DSTOPTS) );
 +      return  (nexthdr == IPPROTO_HOPOPTS)   ||
 +              (nexthdr == IPPROTO_ROUTING)   ||
 +              (nexthdr == IPPROTO_FRAGMENT)  ||
 +              (nexthdr == IPPROTO_ESP)       ||
 +              (nexthdr == IPPROTO_AH)        ||
 +              (nexthdr == IPPROTO_NONE)      ||
 +              (nexthdr == IPPROTO_DSTOPTS);
  }
  
  /* Returns whether matches rule or not. */
@@@ -215,7 -215,7 +215,7 @@@ static inline bool unconditional(const 
        return memcmp(ipv6, &uncond, sizeof(uncond)) == 0;
  }
  
- static inline const struct ip6t_entry_target *
+ static inline const struct xt_entry_target *
  ip6t_get_target_c(const struct ip6t_entry *e)
  {
        return ip6t_get_target((struct ip6t_entry *)e);
@@@ -260,9 -260,9 +260,9 @@@ get_chainname_rulenum(const struct ip6t
                      const char *hookname, const char **chainname,
                      const char **comment, unsigned int *rulenum)
  {
-       const struct ip6t_standard_target *t = (void *)ip6t_get_target_c(s);
+       const struct xt_standard_target *t = (void *)ip6t_get_target_c(s);
  
-       if (strcmp(t->target.u.kernel.target->name, IP6T_ERROR_TARGET) == 0) {
+       if (strcmp(t->target.u.kernel.target->name, XT_ERROR_TARGET) == 0) {
                /* Head of user chain: ERROR target with chainname */
                *chainname = t->target.data;
                (*rulenum) = 0;
  
                if (s->target_offset == sizeof(struct ip6t_entry) &&
                    strcmp(t->target.u.kernel.target->name,
-                          IP6T_STANDARD_TARGET) == 0 &&
+                          XT_STANDARD_TARGET) == 0 &&
                    t->verdict < 0 &&
                    unconditional(&s->ipv6)) {
                        /* Tail of chains: STANDARD target (return/policy) */
@@@ -369,7 -369,7 +369,7 @@@ ip6t_do_table(struct sk_buff *skb
        e = get_entry(table_base, private->hook_entry[hook]);
  
        do {
-               const struct ip6t_entry_target *t;
+               const struct xt_entry_target *t;
                const struct xt_entry_match *ematch;
  
                IP_NF_ASSERT(e);
                if (!t->u.kernel.target->target) {
                        int v;
  
-                       v = ((struct ip6t_standard_target *)t)->verdict;
+                       v = ((struct xt_standard_target *)t)->verdict;
                        if (v < 0) {
                                /* Pop from stack? */
-                               if (v != IP6T_RETURN) {
+                               if (v != XT_RETURN) {
                                        verdict = (unsigned)(-v) - 1;
                                        break;
                                }
                acpar.targinfo = t->data;
  
                verdict = t->u.kernel.target->target(skb, &acpar);
-               if (verdict == IP6T_CONTINUE)
+               if (verdict == XT_CONTINUE)
                        e = ip6t_next_entry(e);
                else
                        /* Verdict */
@@@ -474,7 -474,7 +474,7 @@@ mark_source_chains(const struct xt_tabl
                e->counters.pcnt = pos;
  
                for (;;) {
-                       const struct ip6t_standard_target *t
+                       const struct xt_standard_target *t
                                = (void *)ip6t_get_target_c(e);
                        int visited = e->comefrom & (1 << hook);
  
                        /* Unconditional return/END. */
                        if ((e->target_offset == sizeof(struct ip6t_entry) &&
                             (strcmp(t->target.u.user.name,
-                                    IP6T_STANDARD_TARGET) == 0) &&
+                                    XT_STANDARD_TARGET) == 0) &&
                             t->verdict < 0 &&
                             unconditional(&e->ipv6)) || visited) {
                                unsigned int oldpos, size;
  
                                if ((strcmp(t->target.u.user.name,
-                                           IP6T_STANDARD_TARGET) == 0) &&
+                                           XT_STANDARD_TARGET) == 0) &&
                                    t->verdict < -NF_MAX_VERDICT - 1) {
                                        duprintf("mark_source_chains: bad "
                                                "negative verdict (%i)\n",
                                int newpos = t->verdict;
  
                                if (strcmp(t->target.u.user.name,
-                                          IP6T_STANDARD_TARGET) == 0 &&
+                                          XT_STANDARD_TARGET) == 0 &&
                                    newpos >= 0) {
                                        if (newpos > newinfo->size -
                                                sizeof(struct ip6t_entry)) {
        return 1;
  }
  
- static void cleanup_match(struct ip6t_entry_match *m, struct net *net)
+ static void cleanup_match(struct xt_entry_match *m, struct net *net)
  {
        struct xt_mtdtor_param par;
  
  static int
  check_entry(const struct ip6t_entry *e, const char *name)
  {
-       const struct ip6t_entry_target *t;
+       const struct xt_entry_target *t;
  
        if (!ip6_checkentry(&e->ipv6)) {
                duprintf("ip_tables: ip check failed %p %s.\n", e, name);
                return -EINVAL;
        }
  
-       if (e->target_offset + sizeof(struct ip6t_entry_target) >
+       if (e->target_offset + sizeof(struct xt_entry_target) >
            e->next_offset)
                return -EINVAL;
  
        return 0;
  }
  
- static int check_match(struct ip6t_entry_match *m, struct xt_mtchk_param *par)
+ static int check_match(struct xt_entry_match *m, struct xt_mtchk_param *par)
  {
        const struct ip6t_ip6 *ipv6 = par->entryinfo;
        int ret;
  }
  
  static int
- find_check_match(struct ip6t_entry_match *m, struct xt_mtchk_param *par)
+ find_check_match(struct xt_entry_match *m, struct xt_mtchk_param *par)
  {
        struct xt_match *match;
        int ret;
@@@ -643,7 -643,7 +643,7 @@@ err
  
  static int check_target(struct ip6t_entry *e, struct net *net, const char *name)
  {
-       struct ip6t_entry_target *t = ip6t_get_target(e);
+       struct xt_entry_target *t = ip6t_get_target(e);
        struct xt_tgchk_param par = {
                .net       = net,
                .table     = name,
@@@ -670,7 -670,7 +670,7 @@@ static in
  find_check_entry(struct ip6t_entry *e, struct net *net, const char *name,
                 unsigned int size)
  {
-       struct ip6t_entry_target *t;
+       struct xt_entry_target *t;
        struct xt_target *target;
        int ret;
        unsigned int j;
  
  static bool check_underflow(const struct ip6t_entry *e)
  {
-       const struct ip6t_entry_target *t;
+       const struct xt_entry_target *t;
        unsigned int verdict;
  
        if (!unconditional(&e->ipv6))
        t = ip6t_get_target_c(e);
        if (strcmp(t->u.user.name, XT_STANDARD_TARGET) != 0)
                return false;
-       verdict = ((struct ip6t_standard_target *)t)->verdict;
+       verdict = ((struct xt_standard_target *)t)->verdict;
        verdict = -verdict - 1;
        return verdict == NF_DROP || verdict == NF_ACCEPT;
  }
@@@ -752,7 -752,7 +752,7 @@@ check_entry_size_and_hooks(struct ip6t_
        }
  
        if (e->next_offset
-           < sizeof(struct ip6t_entry) + sizeof(struct ip6t_entry_target)) {
+           < sizeof(struct ip6t_entry) + sizeof(struct xt_entry_target)) {
                duprintf("checking: element %p size %u\n",
                         e, e->next_offset);
                return -EINVAL;
  static void cleanup_entry(struct ip6t_entry *e, struct net *net)
  {
        struct xt_tgdtor_param par;
-       struct ip6t_entry_target *t;
+       struct xt_entry_target *t;
        struct xt_entry_match *ematch;
  
        /* Cleanup all matches */
@@@ -985,8 -985,8 +985,8 @@@ copy_entries_to_user(unsigned int total
        /* ... then go back and fix counters and names */
        for (off = 0, num = 0; off < total_size; off += e->next_offset, num++){
                unsigned int i;
-               const struct ip6t_entry_match *m;
-               const struct ip6t_entry_target *t;
+               const struct xt_entry_match *m;
+               const struct xt_entry_target *t;
  
                e = (struct ip6t_entry *)(loc_cpu_entry + off);
                if (copy_to_user(userptr + off
                        m = (void *)e + i;
  
                        if (copy_to_user(userptr + off + i
-                                        + offsetof(struct ip6t_entry_match,
+                                        + offsetof(struct xt_entry_match,
                                                    u.user.name),
                                         m->u.kernel.match->name,
                                         strlen(m->u.kernel.match->name)+1)
  
                t = ip6t_get_target_c(e);
                if (copy_to_user(userptr + off + e->target_offset
-                                + offsetof(struct ip6t_entry_target,
+                                + offsetof(struct xt_entry_target,
                                            u.user.name),
                                 t->u.kernel.target->name,
                                 strlen(t->u.kernel.target->name)+1) != 0) {
@@@ -1053,7 -1053,7 +1053,7 @@@ static int compat_calc_entry(const stru
                             const void *base, struct xt_table_info *newinfo)
  {
        const struct xt_entry_match *ematch;
-       const struct ip6t_entry_target *t;
+       const struct xt_entry_target *t;
        unsigned int entry_offset;
        int off, i, ret;
  
@@@ -1105,7 -1105,7 +1105,7 @@@ static int compat_table_info(const stru
  static int get_info(struct net *net, void __user *user,
                      const int *len, int compat)
  {
-       char name[IP6T_TABLE_MAXNAMELEN];
+       char name[XT_TABLE_MAXNAMELEN];
        struct xt_table *t;
        int ret;
  
        if (copy_from_user(name, user, sizeof(name)) != 0)
                return -EFAULT;
  
-       name[IP6T_TABLE_MAXNAMELEN-1] = '\0';
+       name[XT_TABLE_MAXNAMELEN-1] = '\0';
  #ifdef CONFIG_COMPAT
        if (compat)
                xt_compat_lock(AF_INET6);
@@@ -1415,14 -1415,14 +1415,14 @@@ do_add_counters(struct net *net, const 
  
  #ifdef CONFIG_COMPAT
  struct compat_ip6t_replace {
-       char                    name[IP6T_TABLE_MAXNAMELEN];
+       char                    name[XT_TABLE_MAXNAMELEN];
        u32                     valid_hooks;
        u32                     num_entries;
        u32                     size;
        u32                     hook_entry[NF_INET_NUMHOOKS];
        u32                     underflow[NF_INET_NUMHOOKS];
        u32                     num_counters;
-       compat_uptr_t           counters;       /* struct ip6t_counters * */
+       compat_uptr_t           counters;       /* struct xt_counters * */
        struct compat_ip6t_entry entries[0];
  };
  
@@@ -1431,7 -1431,7 +1431,7 @@@ compat_copy_entry_to_user(struct ip6t_e
                          unsigned int *size, struct xt_counters *counters,
                          unsigned int i)
  {
-       struct ip6t_entry_target *t;
+       struct xt_entry_target *t;
        struct compat_ip6t_entry __user *ce;
        u_int16_t target_offset, next_offset;
        compat_uint_t origsize;
  }
  
  static int
- compat_find_calc_match(struct ip6t_entry_match *m,
+ compat_find_calc_match(struct xt_entry_match *m,
                       const char *name,
                       const struct ip6t_ip6 *ipv6,
                       unsigned int hookmask,
  
  static void compat_release_entry(struct compat_ip6t_entry *e)
  {
-       struct ip6t_entry_target *t;
+       struct xt_entry_target *t;
        struct xt_entry_match *ematch;
  
        /* Cleanup all matches */
@@@ -1509,7 -1509,7 +1509,7 @@@ check_compat_entry_size_and_hooks(struc
                                  const char *name)
  {
        struct xt_entry_match *ematch;
-       struct ip6t_entry_target *t;
+       struct xt_entry_target *t;
        struct xt_target *target;
        unsigned int entry_offset;
        unsigned int j;
@@@ -1591,7 -1591,7 +1591,7 @@@ compat_copy_entry_from_user(struct comp
                            unsigned int *size, const char *name,
                            struct xt_table_info *newinfo, unsigned char *base)
  {
-       struct ip6t_entry_target *t;
+       struct xt_entry_target *t;
        struct xt_target *target;
        struct ip6t_entry *de;
        unsigned int origsize;
@@@ -1899,7 -1899,7 +1899,7 @@@ compat_do_ip6t_set_ctl(struct sock *sk
  }
  
  struct compat_ip6t_get_entries {
-       char name[IP6T_TABLE_MAXNAMELEN];
+       char name[XT_TABLE_MAXNAMELEN];
        compat_uint_t size;
        struct compat_ip6t_entry entrytable[0];
  };
@@@ -2054,7 -2054,7 +2054,7 @@@ do_ip6t_get_ctl(struct sock *sk, int cm
  
        case IP6T_SO_GET_REVISION_MATCH:
        case IP6T_SO_GET_REVISION_TARGET: {
-               struct ip6t_get_revision rev;
+               struct xt_get_revision rev;
                int target;
  
                if (*len != sizeof(rev)) {
@@@ -2191,7 -2191,7 +2191,7 @@@ static int icmp6_checkentry(const struc
  /* The built-in targets: standard (NULL) and error. */
  static struct xt_target ip6t_builtin_tg[] __read_mostly = {
        {
-               .name             = IP6T_STANDARD_TARGET,
+               .name             = XT_STANDARD_TARGET,
                .targetsize       = sizeof(int),
                .family           = NFPROTO_IPV6,
  #ifdef CONFIG_COMPAT
  #endif
        },
        {
-               .name             = IP6T_ERROR_TARGET,
+               .name             = XT_ERROR_TARGET,
                .target           = ip6t_error,
-               .targetsize       = IP6T_FUNCTION_MAXNAMELEN,
+               .targetsize       = XT_FUNCTION_MAXNAMELEN,
                .family           = NFPROTO_IPV6,
        },
  };
diff --combined net/ipv6/tcp_ipv6.c
index 8d93f6d81979c68111bbd05a1a94792b43846edc,ba5258ef1c57c76cdd92597880fde716924276d7..7e41e2cbb85e39b78ea3c66c5b85273fc04fa036
@@@ -139,7 -139,7 +139,7 @@@ static int tcp_v6_connect(struct sock *
                return -EINVAL;
  
        if (usin->sin6_family != AF_INET6)
 -              return(-EAFNOSUPPORT);
 +              return -EAFNOSUPPORT;
  
        memset(&fl, 0, sizeof(fl));
  
@@@ -1409,7 -1409,7 +1409,7 @@@ static struct sock * tcp_v6_syn_recv_so
  
        newsk = tcp_create_openreq_child(sk, req, skb);
        if (newsk == NULL)
-               goto out;
+               goto out_nonewsk;
  
        /*
         * No need to charge this sock to the relevant IPv6 refcnt debug socks
        }
  #endif
  
+       if (__inet_inherit_port(sk, newsk) < 0) {
+               sock_put(newsk);
+               goto out;
+       }
        __inet6_hash(newsk, NULL);
-       __inet_inherit_port(sk, newsk);
  
        return newsk;
  
  out_overflow:
        NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENOVERFLOWS);
- out:
-       NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
+ out_nonewsk:
        if (opt && opt != np->opt)
                sock_kfree_s(sk, opt, opt->tot_len);
        dst_release(dst);
+ out:
+       NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
        return NULL;
  }
  
index 2f982a4c47709fe42e061a5d65565041d8b97cbf,d254345bfda7066504c305832340dc4105f827fb..1ea96bcd342b8fc81eb437a6826fc6652c2be4c2
@@@ -31,6 -31,8 +31,8 @@@ sctp_conn_schedule(int af, struct sk_bu
        if ((sch->type == SCTP_CID_INIT) &&
            (svc = ip_vs_service_get(af, skb->mark, iph.protocol,
                                     &iph.daddr, sh->dest))) {
+               int ignored;
                if (ip_vs_todrop()) {
                        /*
                         * It seems that we are very loaded.
@@@ -44,8 -46,8 +46,8 @@@
                 * Let the virtual server select a real server for the
                 * incoming connection, and create a connection entry.
                 */
-               *cpp = ip_vs_schedule(svc, skb);
-               if (!*cpp) {
+               *cpp = ip_vs_schedule(svc, skb, pp, &ignored);
+               if (!*cpp && !ignored) {
                        *verdict = ip_vs_leave(svc, skb, pp);
                        return 0;
                }
@@@ -61,7 -63,6 +63,7 @@@ sctp_snat_handler(struct sk_buff *skb
  {
        sctp_sctphdr_t *sctph;
        unsigned int sctphoff;
 +      struct sk_buff *iter;
        __be32 crc32;
  
  #ifdef CONFIG_IP_VS_IPV6
@@@ -90,8 -91,8 +92,8 @@@
  
        /* Calculate the checksum */
        crc32 = sctp_start_cksum((u8 *) sctph, skb_headlen(skb) - sctphoff);
 -      for (skb = skb_shinfo(skb)->frag_list; skb; skb = skb->next)
 -              crc32 = sctp_update_cksum((u8 *) skb->data, skb_headlen(skb),
 +      skb_walk_frags(skb, iter)
 +              crc32 = sctp_update_cksum((u8 *) iter->data, skb_headlen(iter),
                                          crc32);
        crc32 = sctp_end_cksum(crc32);
        sctph->checksum = crc32;
@@@ -103,9 -104,9 +105,9 @@@ static in
  sctp_dnat_handler(struct sk_buff *skb,
                  struct ip_vs_protocol *pp, struct ip_vs_conn *cp)
  {
 -
        sctp_sctphdr_t *sctph;
        unsigned int sctphoff;
 +      struct sk_buff *iter;
        __be32 crc32;
  
  #ifdef CONFIG_IP_VS_IPV6
  
        /* Calculate the checksum */
        crc32 = sctp_start_cksum((u8 *) sctph, skb_headlen(skb) - sctphoff);
 -      for (skb = skb_shinfo(skb)->frag_list; skb; skb = skb->next)
 -              crc32 = sctp_update_cksum((u8 *) skb->data, skb_headlen(skb),
 +      skb_walk_frags(skb, iter)
 +              crc32 = sctp_update_cksum((u8 *) iter->data, skb_headlen(iter),
                                          crc32);
        crc32 = sctp_end_cksum(crc32);
        sctph->checksum = crc32;
  static int
  sctp_csum_check(int af, struct sk_buff *skb, struct ip_vs_protocol *pp)
  {
 -      struct sk_buff *list = skb_shinfo(skb)->frag_list;
        unsigned int sctphoff;
        struct sctphdr *sh, _sctph;
 +      struct sk_buff *iter;
        __le32 cmp;
        __le32 val;
        __u32 tmp;
        cmp = sh->checksum;
  
        tmp = sctp_start_cksum((__u8 *) sh, skb_headlen(skb));
 -      for (; list; list = list->next)
 -              tmp = sctp_update_cksum((__u8 *) list->data,
 -                                      skb_headlen(list), tmp);
 +      skb_walk_frags(skb, iter)
 +              tmp = sctp_update_cksum((__u8 *) iter->data,
 +                                      skb_headlen(iter), tmp);
  
        val = sctp_end_cksum(tmp);
  
        if (val != cmp) {
                /* CRC failure, dump it. */
-               IP_VS_DBG_RL_PKT(0, pp, skb, 0,
+               IP_VS_DBG_RL_PKT(0, af, pp, skb, 0,
                                "Failed checksum for");
                return 0;
        }
index f64de95448669242cf23ac5d8a38987c2f8cd344,715ce54d2fc4d15661f5ea1d41f3899b6224316c..bcf47eb518effb4645440a6f64726089984eaeb7
@@@ -130,6 -130,44 +130,44 @@@ static int digits_len(const struct nf_c
        return len;
  }
  
+ static int iswordc(const char c)
+ {
+       if (isalnum(c) || c == '!' || c == '"' || c == '%' ||
+           (c >= '(' && c <= '/') || c == ':' || c == '<' || c == '>' ||
+           c == '?' || (c >= '[' && c <= ']') || c == '_' || c == '`' ||
+           c == '{' || c == '}' || c == '~')
+               return 1;
+       return 0;
+ }
+ static int word_len(const char *dptr, const char *limit)
+ {
+       int len = 0;
+       while (dptr < limit && iswordc(*dptr)) {
+               dptr++;
+               len++;
+       }
+       return len;
+ }
+ static int callid_len(const struct nf_conn *ct, const char *dptr,
+                     const char *limit, int *shift)
+ {
+       int len, domain_len;
+       len = word_len(dptr, limit);
+       dptr += len;
+       if (!len || dptr == limit || *dptr != '@')
+               return len;
+       dptr++;
+       len++;
+       domain_len = word_len(dptr, limit);
+       if (!domain_len)
+               return 0;
+       return len + domain_len;
+ }
  /* get media type + port length */
  static int media_len(const struct nf_conn *ct, const char *dptr,
                     const char *limit, int *shift)
@@@ -152,6 -190,9 +190,9 @@@ static int parse_addr(const struct nf_c
        const char *end;
        int ret = 0;
  
+       if (!ct)
+               return 0;
        memset(addr, 0, sizeof(*addr));
        switch (nf_ct_l3num(ct)) {
        case AF_INET:
@@@ -296,6 -337,7 +337,7 @@@ static const struct sip_header ct_sip_h
        [SIP_HDR_VIA_TCP]               = SIP_HDR("Via", "v", "TCP ", epaddr_len),
        [SIP_HDR_EXPIRES]               = SIP_HDR("Expires", NULL, NULL, digits_len),
        [SIP_HDR_CONTENT_LENGTH]        = SIP_HDR("Content-Length", "l", NULL, digits_len),
+       [SIP_HDR_CALL_ID]               = SIP_HDR("Call-Id", "i", NULL, callid_len),
  };
  
  static const char *sip_follow_continuation(const char *dptr, const char *limit)
@@@ -1376,7 -1418,7 +1418,7 @@@ static int sip_help_tcp(struct sk_buff 
        unsigned int msglen, origlen;
        const char *dptr, *end;
        s16 diff, tdiff = 0;
 -      int ret;
 +      int ret = NF_ACCEPT;
        typeof(nf_nat_sip_seq_adjust_hook) nf_nat_sip_seq_adjust;
  
        if (ctinfo != IP_CT_ESTABLISHED &&
index daab8c4a903ca20103c1c5d6ebe997fdb657f581,db655638d76dbefb5c0017b3811c4ca43b0f9990..4d87befb04c04c793a54360de809e5eb64ee44c2
  #include <net/udp.h>
  #include <net/netfilter/nf_tproxy_core.h>
  
- struct sock *
- nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
-                     const __be32 saddr, const __be32 daddr,
-                     const __be16 sport, const __be16 dport,
-                     const struct net_device *in, bool listening_only)
- {
-       struct sock *sk;
-       /* look up socket */
-       switch (protocol) {
-       case IPPROTO_TCP:
-               if (listening_only)
-                       sk = __inet_lookup_listener(net, &tcp_hashinfo,
-                                                   daddr, ntohs(dport),
-                                                   in->ifindex);
-               else
-                       sk = __inet_lookup(net, &tcp_hashinfo,
-                                          saddr, sport, daddr, dport,
-                                          in->ifindex);
-               break;
-       case IPPROTO_UDP:
-               sk = udp4_lib_lookup(net, saddr, sport, daddr, dport,
-                                    in->ifindex);
-               break;
-       default:
-               WARN_ON(1);
-               sk = NULL;
-       }
-       pr_debug("tproxy socket lookup: proto %u %08x:%u -> %08x:%u, listener only: %d, sock %p\n",
-                protocol, ntohl(saddr), ntohs(sport), ntohl(daddr), ntohs(dport), listening_only, sk);
-       return sk;
- }
- EXPORT_SYMBOL_GPL(nf_tproxy_get_sock_v4);
  
  static void
  nf_tproxy_destructor(struct sk_buff *skb)
  int
  nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk)
  {
 -      if (inet_sk(sk)->transparent) {
 +      bool transparent = (sk->sk_state == TCP_TIME_WAIT) ?
 +                              inet_twsk(sk)->tw_transparent :
 +                              inet_sk(sk)->transparent;
 +
 +      if (transparent) {
                skb_orphan(skb);
                skb->sk = sk;
                skb->destructor = nf_tproxy_destructor;