]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netfilter/xt_dccp.c
[NETFILTER]: {ip, nf}_conntrack_sctp: fix remotely triggerable NULL ptr dereference...
[linux-2.6-omap-h63xx.git] / net / netfilter / xt_dccp.c
index 24895902cfe0592bce10776f7299981b0db668d6..83224ec89cc08348205daaf58a7104ea79773e53 100644 (file)
@@ -39,7 +39,7 @@ dccp_find_option(u_int8_t option,
                 bool *hotdrop)
 {
        /* tcp.doff is only 4 bits, ie. max 15 * 4 bytes */
-       unsigned char *op;
+       const unsigned char *op;
        unsigned int optoff = __dccp_hdr_len(dh);
        unsigned int optlen = dh->dccph_doff*4 - __dccp_hdr_len(dh);
        unsigned int i;
@@ -81,7 +81,7 @@ dccp_find_option(u_int8_t option,
 static inline bool
 match_types(const struct dccp_hdr *dh, u_int16_t typemask)
 {
-       return (typemask & (1 << dh->dccph_type));
+       return typemask & (1 << dh->dccph_type);
 }
 
 static inline bool
@@ -113,11 +113,11 @@ match(const struct sk_buff *skb,
                return false;
        }
 
-       return  DCCHECK(((ntohs(dh->dccph_sport) >= info->spts[0])
-                       && (ntohs(dh->dccph_sport) <= info->spts[1])),
+       return  DCCHECK(ntohs(dh->dccph_sport) >= info->spts[0]
+                       && ntohs(dh->dccph_sport) <= info->spts[1],
                        XT_DCCP_SRC_PORTS, info->flags, info->invflags)
-               && DCCHECK(((ntohs(dh->dccph_dport) >= info->dpts[0])
-                       && (ntohs(dh->dccph_dport) <= info->dpts[1])),
+               && DCCHECK(ntohs(dh->dccph_dport) >= info->dpts[0]
+                       && ntohs(dh->dccph_dport) <= info->dpts[1],
                        XT_DCCP_DEST_PORTS, info->flags, info->invflags)
                && DCCHECK(match_types(dh, info->typemask),
                           XT_DCCP_TYPE, info->flags, info->invflags)
@@ -140,7 +140,7 @@ checkentry(const char *tablename,
                && !(info->invflags & ~info->flags);
 }
 
-static struct xt_match xt_dccp_match[] = {
+static struct xt_match xt_dccp_match[] __read_mostly = {
        {
                .name           = "dccp",
                .family         = AF_INET,