]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/netfilter/ipt_TOS.c
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / net / ipv4 / netfilter / ipt_TOS.c
index cedf9f7d9d6ef650fbeef90dc2609f7d45f8836f..25f5d0b3906523b9a0e0fc2fd4f0758ce69fb95f 100644 (file)
@@ -29,13 +29,13 @@ target(struct sk_buff **pskb,
        const void *targinfo)
 {
        const struct ipt_tos_target_info *tosinfo = targinfo;
-       struct iphdr *iph = (*pskb)->nh.iph;
+       struct iphdr *iph = ip_hdr(*pskb);
 
        if ((iph->tos & IPTOS_TOS_MASK) != tosinfo->tos) {
                __u8 oldtos;
                if (!skb_make_writable(pskb, sizeof(struct iphdr)))
                        return NF_DROP;
-               iph = (*pskb)->nh.iph;
+               iph = ip_hdr(*pskb);
                oldtos = iph->tos;
                iph->tos = (iph->tos & IPTOS_PREC_MASK) | tosinfo->tos;
                nf_csum_replace2(&iph->check, htons(oldtos), htons(iph->tos));
@@ -43,7 +43,7 @@ target(struct sk_buff **pskb,
        return XT_CONTINUE;
 }
 
-static int
+static bool
 checkentry(const char *tablename,
           const void *e_void,
           const struct xt_target *target,
@@ -58,12 +58,12 @@ checkentry(const char *tablename,
            && tos != IPTOS_MINCOST
            && tos != IPTOS_NORMALSVC) {
                printk(KERN_WARNING "TOS: bad tos value %#x\n", tos);
-               return 0;
+               return false;
        }
-       return 1;
+       return true;
 }
 
-static struct xt_target ipt_tos_reg = {
+static struct xt_target ipt_tos_reg __read_mostly = {
        .name           = "TOS",
        .family         = AF_INET,
        .target         = target,