~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/ipv6/netfilter/ip6t_REJECT.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        int tcphoff, needs_ack;
46
46
        const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
47
47
        struct ipv6hdr *ip6h;
 
48
#define DEFAULT_TOS_VALUE       0x0U
 
49
        const __u8 tclass = DEFAULT_TOS_VALUE;
48
50
        struct dst_entry *dst = NULL;
49
51
        u8 proto;
50
 
        struct flowi fl;
 
52
        struct flowi6 fl6;
51
53
 
52
54
        if ((!(ipv6_addr_type(&oip6h->saddr) & IPV6_ADDR_UNICAST)) ||
53
55
            (!(ipv6_addr_type(&oip6h->daddr) & IPV6_ADDR_UNICAST))) {
89
91
                return;
90
92
        }
91
93
 
92
 
        memset(&fl, 0, sizeof(fl));
93
 
        fl.proto = IPPROTO_TCP;
94
 
        ipv6_addr_copy(&fl.fl6_src, &oip6h->daddr);
95
 
        ipv6_addr_copy(&fl.fl6_dst, &oip6h->saddr);
96
 
        fl.fl_ip_sport = otcph.dest;
97
 
        fl.fl_ip_dport = otcph.source;
98
 
        security_skb_classify_flow(oldskb, &fl);
99
 
        dst = ip6_route_output(net, NULL, &fl);
 
94
        memset(&fl6, 0, sizeof(fl6));
 
95
        fl6.flowi6_proto = IPPROTO_TCP;
 
96
        ipv6_addr_copy(&fl6.saddr, &oip6h->daddr);
 
97
        ipv6_addr_copy(&fl6.daddr, &oip6h->saddr);
 
98
        fl6.fl6_sport = otcph.dest;
 
99
        fl6.fl6_dport = otcph.source;
 
100
        security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6));
 
101
        dst = ip6_route_output(net, NULL, &fl6);
100
102
        if (dst == NULL || dst->error) {
101
103
                dst_release(dst);
102
104
                return;
103
105
        }
104
 
        if (xfrm_lookup(net, &dst, &fl, NULL, 0))
 
106
        dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
 
107
        if (IS_ERR(dst))
105
108
                return;
106
109
 
107
110
        hh_len = (dst->dev->hard_header_len + 15)&~15;
123
126
        skb_put(nskb, sizeof(struct ipv6hdr));
124
127
        skb_reset_network_header(nskb);
125
128
        ip6h = ipv6_hdr(nskb);
126
 
        ip6h->version = 6;
 
129
        *(__be32 *)ip6h =  htonl(0x60000000 | (tclass << 20));
127
130
        ip6h->hop_limit = ip6_dst_hoplimit(dst);
128
131
        ip6h->nexthdr = IPPROTO_TCP;
129
132
        ipv6_addr_copy(&ip6h->saddr, &oip6h->daddr);