aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 02:14:05 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 18:08:51 -0500
commit5a49d0e04d62ab3f85aea4d15e0ca8be9b0ee89b (patch)
treedd6c4fe04d03730256160e48c6a65ccbdbf57985
parentb6f21b268026165a239edb5f4d7120eacf7bc593 (diff)
netfilter: Use flowi4 and flowi6 in nf_conntrack_h323_main
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/netfilter/nf_conntrack_h323_main.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
index b969025cf82f..533a183e6661 100644
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -714,7 +714,6 @@ static int callforward_do_filter(const union nf_inet_addr *src,
714 u_int8_t family) 714 u_int8_t family)
715{ 715{
716 const struct nf_afinfo *afinfo; 716 const struct nf_afinfo *afinfo;
717 struct flowi fl1, fl2;
718 int ret = 0; 717 int ret = 0;
719 718
720 /* rcu_read_lock()ed by nf_hook_slow() */ 719 /* rcu_read_lock()ed by nf_hook_slow() */
@@ -722,17 +721,20 @@ static int callforward_do_filter(const union nf_inet_addr *src,
722 if (!afinfo) 721 if (!afinfo)
723 return 0; 722 return 0;
724 723
725 memset(&fl1, 0, sizeof(fl1));
726 memset(&fl2, 0, sizeof(fl2));
727
728 switch (family) { 724 switch (family) {
729 case AF_INET: { 725 case AF_INET: {
726 struct flowi4 fl1, fl2;
730 struct rtable *rt1, *rt2; 727 struct rtable *rt1, *rt2;
731 728
732 fl1.fl4_dst = src->ip; 729 memset(&fl1, 0, sizeof(fl1));
733 fl2.fl4_dst = dst->ip; 730 fl1.daddr = src->ip;
734 if (!afinfo->route((struct dst_entry **)&rt1, &fl1)) { 731
735 if (!afinfo->route((struct dst_entry **)&rt2, &fl2)) { 732 memset(&fl2, 0, sizeof(fl2));
733 fl2.daddr = dst->ip;
734 if (!afinfo->route((struct dst_entry **)&rt1,
735 flowi4_to_flowi(&fl1))) {
736 if (!afinfo->route((struct dst_entry **)&rt2,
737 flowi4_to_flowi(&fl2))) {
736 if (rt1->rt_gateway == rt2->rt_gateway && 738 if (rt1->rt_gateway == rt2->rt_gateway &&
737 rt1->dst.dev == rt2->dst.dev) 739 rt1->dst.dev == rt2->dst.dev)
738 ret = 1; 740 ret = 1;
@@ -745,12 +747,18 @@ static int callforward_do_filter(const union nf_inet_addr *src,
745#if defined(CONFIG_NF_CONNTRACK_IPV6) || \ 747#if defined(CONFIG_NF_CONNTRACK_IPV6) || \
746 defined(CONFIG_NF_CONNTRACK_IPV6_MODULE) 748 defined(CONFIG_NF_CONNTRACK_IPV6_MODULE)
747 case AF_INET6: { 749 case AF_INET6: {
750 struct flowi6 fl1, fl2;
748 struct rt6_info *rt1, *rt2; 751 struct rt6_info *rt1, *rt2;
749 752
750 memcpy(&fl1.fl6_dst, src, sizeof(fl1.fl6_dst)); 753 memset(&fl1, 0, sizeof(fl1));
751 memcpy(&fl2.fl6_dst, dst, sizeof(fl2.fl6_dst)); 754 ipv6_addr_copy(&fl1.daddr, &src->in6);
752 if (!afinfo->route((struct dst_entry **)&rt1, &fl1)) { 755
753 if (!afinfo->route((struct dst_entry **)&rt2, &fl2)) { 756 memset(&fl2, 0, sizeof(fl2));
757 ipv6_addr_copy(&fl2.daddr, &dst->in6);
758 if (!afinfo->route((struct dst_entry **)&rt1,
759 flowi6_to_flowi(&fl1))) {
760 if (!afinfo->route((struct dst_entry **)&rt2,
761 flowi6_to_flowi(&fl2))) {
754 if (!memcmp(&rt1->rt6i_gateway, &rt2->rt6i_gateway, 762 if (!memcmp(&rt1->rt6i_gateway, &rt2->rt6i_gateway,
755 sizeof(rt1->rt6i_gateway)) && 763 sizeof(rt1->rt6i_gateway)) &&
756 rt1->dst.dev == rt2->dst.dev) 764 rt1->dst.dev == rt2->dst.dev)