Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[NETFILTER]: Remove redundant parentheses/braces

Removes redundant parentheses and braces (And add one pair in a
xt_tcpudp.c macro).

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jan Engelhardt and committed by
David S. Miller
7c4e36bc 170b197c

+90 -110
+4 -7
net/ipv4/netfilter/ipt_CLUSTERIP.c
··· 122 122 list_for_each(pos, &clusterip_configs) { 123 123 struct clusterip_config *c = list_entry(pos, 124 124 struct clusterip_config, list); 125 - if (c->clusterip == clusterip) { 125 + if (c->clusterip == clusterip) 126 126 return c; 127 - } 128 127 } 129 128 130 129 return NULL; ··· 154 155 { 155 156 int n; 156 157 157 - for (n = 0; n < i->num_local_nodes; n++) { 158 + for (n = 0; n < i->num_local_nodes; n++) 158 159 set_bit(i->local_nodes[n] - 1, &c->local_nodes); 159 - } 160 160 } 161 161 162 162 static struct clusterip_config * ··· 253 255 dport = ports[1]; 254 256 break; 255 257 default: 256 - if (net_ratelimit()) { 258 + if (net_ratelimit()) 257 259 printk(KERN_NOTICE "CLUSTERIP: unknown protocol `%u'\n", 258 260 iph->protocol); 259 - } 260 261 sport = dport = 0; 261 262 } 262 263 ··· 283 286 } 284 287 285 288 /* node numbers are 1..n, not 0..n */ 286 - return ((hashval % config->num_total_nodes)+1); 289 + return (hashval % config->num_total_nodes) + 1; 287 290 } 288 291 289 292 static inline int
+2 -2
net/ipv4/netfilter/ipt_ECN.c
··· 58 58 59 59 if ((!(einfo->operation & IPT_ECN_OP_SET_ECE) || 60 60 tcph->ece == einfo->proto.tcp.ece) && 61 - ((!(einfo->operation & IPT_ECN_OP_SET_CWR) || 62 - tcph->cwr == einfo->proto.tcp.cwr))) 61 + (!(einfo->operation & IPT_ECN_OP_SET_CWR) || 62 + tcph->cwr == einfo->proto.tcp.cwr)) 63 63 return true; 64 64 65 65 if (!skb_make_writable(pskb, ip_hdrlen(*pskb) + sizeof(*tcph)))
+1 -1
net/ipv4/netfilter/ipt_TTL.c
··· 75 75 info->mode); 76 76 return false; 77 77 } 78 - if ((info->mode != IPT_TTL_SET) && (info->ttl == 0)) 78 + if (info->mode != IPT_TTL_SET && info->ttl == 0) 79 79 return false; 80 80 return true; 81 81 }
+3 -6
net/ipv4/netfilter/ipt_ULOG.c
··· 179 179 unsigned int groupnum = ffs(loginfo->nl_group) - 1; 180 180 181 181 /* calculate the size of the skb needed */ 182 - if ((loginfo->copy_range == 0) || 183 - (loginfo->copy_range > skb->len)) { 182 + if (loginfo->copy_range == 0 || loginfo->copy_range > skb->len) 184 183 copy_len = skb->len; 185 - } else { 184 + else 186 185 copy_len = loginfo->copy_range; 187 - } 188 186 189 187 size = NLMSG_SPACE(sizeof(*pm) + copy_len); 190 188 ··· 255 257 BUG(); 256 258 257 259 /* check if we are building multi-part messages */ 258 - if (ub->qlen > 1) { 260 + if (ub->qlen > 1) 259 261 ub->lastnlh->nlmsg_flags |= NLM_F_MULTI; 260 - } 261 262 262 263 ub->lastnlh = nlh; 263 264
+4 -4
net/ipv4/netfilter/ipt_iprange.c
··· 35 35 const struct iphdr *iph = ip_hdr(skb); 36 36 37 37 if (info->flags & IPRANGE_SRC) { 38 - if (((ntohl(iph->saddr) < ntohl(info->src.min_ip)) 39 - || (ntohl(iph->saddr) > ntohl(info->src.max_ip))) 38 + if ((ntohl(iph->saddr) < ntohl(info->src.min_ip) 39 + || ntohl(iph->saddr) > ntohl(info->src.max_ip)) 40 40 ^ !!(info->flags & IPRANGE_SRC_INV)) { 41 41 DEBUGP("src IP %u.%u.%u.%u NOT in range %s" 42 42 "%u.%u.%u.%u-%u.%u.%u.%u\n", ··· 48 48 } 49 49 } 50 50 if (info->flags & IPRANGE_DST) { 51 - if (((ntohl(iph->daddr) < ntohl(info->dst.min_ip)) 52 - || (ntohl(iph->daddr) > ntohl(info->dst.max_ip))) 51 + if ((ntohl(iph->daddr) < ntohl(info->dst.min_ip) 52 + || ntohl(iph->daddr) > ntohl(info->dst.max_ip)) 53 53 ^ !!(info->flags & IPRANGE_DST_INV)) { 54 54 DEBUGP("dst IP %u.%u.%u.%u NOT in range %s" 55 55 "%u.%u.%u.%u-%u.%u.%u.%u\n",
+3 -6
net/ipv4/netfilter/ipt_recent.c
··· 163 163 struct recent_entry *e, *next; 164 164 unsigned int i; 165 165 166 - for (i = 0; i < ip_list_hash_size; i++) { 166 + for (i = 0; i < ip_list_hash_size; i++) 167 167 list_for_each_entry_safe(e, next, &t->iphash[i], list) 168 168 recent_entry_remove(t, e); 169 - } 170 169 } 171 170 172 171 static bool ··· 328 329 329 330 spin_lock_bh(&recent_lock); 330 331 331 - for (st->bucket = 0; st->bucket < ip_list_hash_size; st->bucket++) { 332 - list_for_each_entry(e, &t->iphash[st->bucket], list) { 332 + for (st->bucket = 0; st->bucket < ip_list_hash_size; st->bucket++) 333 + list_for_each_entry(e, &t->iphash[st->bucket], list) 333 334 if (p-- == 0) 334 335 return e; 335 - } 336 - } 337 336 return NULL; 338 337 } 339 338
+4 -8
net/ipv4/netfilter/ipt_ttl.c
··· 28 28 29 29 switch (info->mode) { 30 30 case IPT_TTL_EQ: 31 - return (ttl == info->ttl); 32 - break; 31 + return ttl == info->ttl; 33 32 case IPT_TTL_NE: 34 - return (!(ttl == info->ttl)); 35 - break; 33 + return ttl != info->ttl; 36 34 case IPT_TTL_LT: 37 - return (ttl < info->ttl); 38 - break; 35 + return ttl < info->ttl; 39 36 case IPT_TTL_GT: 40 - return (ttl > info->ttl); 41 - break; 37 + return ttl > info->ttl; 42 38 default: 43 39 printk(KERN_WARNING "ipt_ttl: unknown mode %d\n", 44 40 info->mode);
+1 -1
net/ipv6/netfilter/ip6t_HL.c
··· 71 71 info->mode); 72 72 return false; 73 73 } 74 - if ((info->mode != IP6T_HL_SET) && (info->hop_limit == 0)) { 74 + if (info->mode != IP6T_HL_SET && info->hop_limit == 0) { 75 75 printk(KERN_WARNING "ip6t_HL: increment/decrement doesn't " 76 76 "make sense with value 0\n"); 77 77 return false;
+1 -1
net/ipv6/netfilter/ip6t_REJECT.c
··· 69 69 otcplen = oldskb->len - tcphoff; 70 70 71 71 /* IP header checks: fragment, too short. */ 72 - if ((proto != IPPROTO_TCP) || (otcplen < sizeof(struct tcphdr))) { 72 + if (proto != IPPROTO_TCP || otcplen < sizeof(struct tcphdr)) { 73 73 DEBUGP("ip6t_REJECT: proto(%d) != IPPROTO_TCP, or too short. otcplen = %d\n", 74 74 proto, otcplen); 75 75 return;
+6 -6
net/ipv6/netfilter/ip6t_ah.c
··· 78 78 DEBUGP("SPI %u %08X\n", ntohl(ah->spi), ntohl(ah->spi)); 79 79 80 80 DEBUGP("IPv6 AH spi %02X ", 81 - (spi_match(ahinfo->spis[0], ahinfo->spis[1], 82 - ntohl(ah->spi), 83 - !!(ahinfo->invflags & IP6T_AH_INV_SPI)))); 81 + spi_match(ahinfo->spis[0], ahinfo->spis[1], 82 + ntohl(ah->spi), 83 + !!(ahinfo->invflags & IP6T_AH_INV_SPI))); 84 84 DEBUGP("len %02X %04X %02X ", 85 85 ahinfo->hdrlen, hdrlen, 86 86 (!ahinfo->hdrlen || ··· 92 92 93 93 return (ah != NULL) 94 94 && 95 - (spi_match(ahinfo->spis[0], ahinfo->spis[1], 96 - ntohl(ah->spi), 97 - !!(ahinfo->invflags & IP6T_AH_INV_SPI))) 95 + spi_match(ahinfo->spis[0], ahinfo->spis[1], 96 + ntohl(ah->spi), 97 + !!(ahinfo->invflags & IP6T_AH_INV_SPI)) 98 98 && 99 99 (!ahinfo->hdrlen || 100 100 (ahinfo->hdrlen == hdrlen) ^
+3 -3
net/ipv6/netfilter/ip6t_eui64.c
··· 33 33 int i = 0; 34 34 35 35 if (!(skb_mac_header(skb) >= skb->head && 36 - (skb_mac_header(skb) + ETH_HLEN) <= skb->data) && 36 + skb_mac_header(skb) + ETH_HLEN <= skb->data) && 37 37 offset != 0) { 38 38 *hotdrop = true; 39 39 return false; ··· 50 50 eui64[0] |= 0x02; 51 51 52 52 i = 0; 53 - while ((ipv6_hdr(skb)->saddr.s6_addr[8 + i] == eui64[i]) 54 - && (i < 8)) 53 + while (ipv6_hdr(skb)->saddr.s6_addr[8 + i] == eui64[i] 54 + && i < 8) 55 55 i++; 56 56 57 57 if (i == 8)
+9 -9
net/ipv6/netfilter/ip6t_frag.c
··· 77 77 ntohl(fh->identification)); 78 78 79 79 DEBUGP("IPv6 FRAG id %02X ", 80 - (id_match(fraginfo->ids[0], fraginfo->ids[1], 80 + id_match(fraginfo->ids[0], fraginfo->ids[1], 81 81 ntohl(fh->identification), 82 - !!(fraginfo->invflags & IP6T_FRAG_INV_IDS)))); 82 + !!(fraginfo->invflags & IP6T_FRAG_INV_IDS))); 83 83 DEBUGP("res %02X %02X%04X %02X ", 84 - (fraginfo->flags & IP6T_FRAG_RES), fh->reserved, 84 + fraginfo->flags & IP6T_FRAG_RES, fh->reserved, 85 85 ntohs(fh->frag_off) & 0x6, 86 86 !((fraginfo->flags & IP6T_FRAG_RES) 87 87 && (fh->reserved || (ntohs(fh->frag_off) & 0x06)))); 88 88 DEBUGP("first %02X %02X %02X ", 89 - (fraginfo->flags & IP6T_FRAG_FST), 89 + fraginfo->flags & IP6T_FRAG_FST, 90 90 ntohs(fh->frag_off) & ~0x7, 91 91 !((fraginfo->flags & IP6T_FRAG_FST) 92 92 && (ntohs(fh->frag_off) & ~0x7))); 93 93 DEBUGP("mf %02X %02X %02X ", 94 - (fraginfo->flags & IP6T_FRAG_MF), 94 + fraginfo->flags & IP6T_FRAG_MF, 95 95 ntohs(fh->frag_off) & IP6_MF, 96 96 !((fraginfo->flags & IP6T_FRAG_MF) 97 97 && !((ntohs(fh->frag_off) & IP6_MF)))); 98 98 DEBUGP("last %02X %02X %02X\n", 99 - (fraginfo->flags & IP6T_FRAG_NMF), 99 + fraginfo->flags & IP6T_FRAG_NMF, 100 100 ntohs(fh->frag_off) & IP6_MF, 101 101 !((fraginfo->flags & IP6T_FRAG_NMF) 102 102 && (ntohs(fh->frag_off) & IP6_MF))); 103 103 104 104 return (fh != NULL) 105 105 && 106 - (id_match(fraginfo->ids[0], fraginfo->ids[1], 107 - ntohl(fh->identification), 108 - !!(fraginfo->invflags & IP6T_FRAG_INV_IDS))) 106 + id_match(fraginfo->ids[0], fraginfo->ids[1], 107 + ntohl(fh->identification), 108 + !!(fraginfo->invflags & IP6T_FRAG_INV_IDS)) 109 109 && 110 110 !((fraginfo->flags & IP6T_FRAG_RES) 111 111 && (fh->reserved || (ntohs(fh->frag_off) & 0x6)))
+1 -1
net/ipv6/netfilter/ip6t_hbh.c
··· 160 160 DEBUGP("len%04X \n", optlen); 161 161 162 162 if ((ptr > skb->len - optlen || hdrlen < optlen) && 163 - (temp < optinfo->optsnr - 1)) { 163 + temp < optinfo->optsnr - 1) { 164 164 DEBUGP("new pointer is too large! \n"); 165 165 break; 166 166 }
+4 -4
net/ipv6/netfilter/ip6t_hl.c
··· 29 29 30 30 switch (info->mode) { 31 31 case IP6T_HL_EQ: 32 - return (ip6h->hop_limit == info->hop_limit); 32 + return ip6h->hop_limit == info->hop_limit; 33 33 break; 34 34 case IP6T_HL_NE: 35 - return (!(ip6h->hop_limit == info->hop_limit)); 35 + return ip6h->hop_limit != info->hop_limit; 36 36 break; 37 37 case IP6T_HL_LT: 38 - return (ip6h->hop_limit < info->hop_limit); 38 + return ip6h->hop_limit < info->hop_limit; 39 39 break; 40 40 case IP6T_HL_GT: 41 - return (ip6h->hop_limit > info->hop_limit); 41 + return ip6h->hop_limit > info->hop_limit; 42 42 break; 43 43 default: 44 44 printk(KERN_WARNING "ip6t_hl: unknown mode %d\n",
+3 -3
net/ipv6/netfilter/ip6t_ipv6header.c
··· 74 74 BUG_ON(hp == NULL); 75 75 76 76 /* Calculate the header length */ 77 - if (nexthdr == NEXTHDR_FRAGMENT) { 77 + if (nexthdr == NEXTHDR_FRAGMENT) 78 78 hdrlen = 8; 79 - } else if (nexthdr == NEXTHDR_AUTH) 79 + else if (nexthdr == NEXTHDR_AUTH) 80 80 hdrlen = (hp->hdrlen + 2) << 2; 81 81 else 82 82 hdrlen = ipv6_optlen(hp); ··· 110 110 break; 111 111 } 112 112 113 - if ((nexthdr != NEXTHDR_NONE) && (nexthdr != NEXTHDR_ESP)) 113 + if (nexthdr != NEXTHDR_NONE && nexthdr != NEXTHDR_ESP) 114 114 temp |= MASK_PROTO; 115 115 116 116 if (info->modeflag)
+2 -4
net/ipv6/netfilter/ip6t_owner.c
··· 38 38 if (!skb->sk || !skb->sk->sk_socket || !skb->sk->sk_socket->file) 39 39 return false; 40 40 41 - if (info->match & IP6T_OWNER_UID) { 41 + if (info->match & IP6T_OWNER_UID) 42 42 if ((skb->sk->sk_socket->file->f_uid != info->uid) ^ 43 43 !!(info->invert & IP6T_OWNER_UID)) 44 44 return false; 45 - } 46 45 47 - if (info->match & IP6T_OWNER_GID) { 46 + if (info->match & IP6T_OWNER_GID) 48 47 if ((skb->sk->sk_socket->file->f_gid != info->gid) ^ 49 48 !!(info->invert & IP6T_OWNER_GID)) 50 49 return false; 51 - } 52 50 53 51 return true; 54 52 }
+8 -8
net/ipv6/netfilter/ip6t_rt.c
··· 87 87 DEBUGP("SGS_LEFT %u %02X\n", rh->segments_left, rh->segments_left); 88 88 89 89 DEBUGP("IPv6 RT segsleft %02X ", 90 - (segsleft_match(rtinfo->segsleft[0], rtinfo->segsleft[1], 91 - rh->segments_left, 92 - !!(rtinfo->invflags & IP6T_RT_INV_SGS)))); 90 + segsleft_match(rtinfo->segsleft[0], rtinfo->segsleft[1], 91 + rh->segments_left, 92 + !!(rtinfo->invflags & IP6T_RT_INV_SGS))); 93 93 DEBUGP("type %02X %02X %02X ", 94 94 rtinfo->rt_type, rh->type, 95 95 (!(rtinfo->flags & IP6T_RT_TYP) || ··· 97 97 !!(rtinfo->invflags & IP6T_RT_INV_TYP)))); 98 98 DEBUGP("len %02X %04X %02X ", 99 99 rtinfo->hdrlen, hdrlen, 100 - (!(rtinfo->flags & IP6T_RT_LEN) || 100 + !(rtinfo->flags & IP6T_RT_LEN) || 101 101 ((rtinfo->hdrlen == hdrlen) ^ 102 - !!(rtinfo->invflags & IP6T_RT_INV_LEN)))); 102 + !!(rtinfo->invflags & IP6T_RT_INV_LEN))); 103 103 DEBUGP("res %02X %02X %02X ", 104 - (rtinfo->flags & IP6T_RT_RES), 104 + rtinfo->flags & IP6T_RT_RES, 105 105 ((const struct rt0_hdr *)rh)->reserved, 106 106 !((rtinfo->flags & IP6T_RT_RES) && 107 107 (((const struct rt0_hdr *)rh)->reserved))); ··· 188 188 break; 189 189 } 190 190 DEBUGP("temp=%d #%d\n", temp, rtinfo->addrnr); 191 - if ((temp == rtinfo->addrnr) && 192 - (temp == (unsigned int)((hdrlen - 8) / 16))) 191 + if (temp == rtinfo->addrnr && 192 + temp == (unsigned int)((hdrlen - 8) / 16)) 193 193 return ret; 194 194 else 195 195 return false;
+1 -1
net/netfilter/xt_DSCP.c
··· 74 74 { 75 75 const u_int8_t dscp = ((struct xt_DSCP_info *)targinfo)->dscp; 76 76 77 - if ((dscp > XT_DSCP_MAX)) { 77 + if (dscp > XT_DSCP_MAX) { 78 78 printk(KERN_WARNING "DSCP: dscp %x out of range\n", dscp); 79 79 return false; 80 80 }
+2 -2
net/netfilter/xt_TCPMSS.c
··· 93 93 return 0; 94 94 95 95 opt[i+2] = (newmss & 0xff00) >> 8; 96 - opt[i+3] = (newmss & 0x00ff); 96 + opt[i+3] = newmss & 0x00ff; 97 97 98 98 nf_proto_csum_replace2(&tcph->check, *pskb, 99 99 htons(oldmss), htons(newmss), 0); ··· 126 126 opt[0] = TCPOPT_MSS; 127 127 opt[1] = TCPOLEN_MSS; 128 128 opt[2] = (newmss & 0xff00) >> 8; 129 - opt[3] = (newmss & 0x00ff); 129 + opt[3] = newmss & 0x00ff; 130 130 131 131 nf_proto_csum_replace4(&tcph->check, *pskb, 0, *((__be32 *)opt), 0); 132 132
+2 -2
net/netfilter/xt_connbytes.c
··· 90 90 } 91 91 92 92 if (sinfo->count.to) 93 - return (what <= sinfo->count.to && what >= sinfo->count.from); 93 + return what <= sinfo->count.to && what >= sinfo->count.from; 94 94 else 95 - return (what >= sinfo->count.from); 95 + return what >= sinfo->count.from; 96 96 } 97 97 98 98 static bool check(const char *tablename,
+1 -1
net/netfilter/xt_connmark.c
··· 48 48 if (!ct) 49 49 return false; 50 50 51 - return (((ct->mark) & info->mask) == info->mark) ^ info->invert; 51 + return ((ct->mark & info->mask) == info->mark) ^ info->invert; 52 52 } 53 53 54 54 static bool
+5 -5
net/netfilter/xt_dccp.c
··· 81 81 static inline bool 82 82 match_types(const struct dccp_hdr *dh, u_int16_t typemask) 83 83 { 84 - return (typemask & (1 << dh->dccph_type)); 84 + return typemask & (1 << dh->dccph_type); 85 85 } 86 86 87 87 static inline bool ··· 113 113 return false; 114 114 } 115 115 116 - return DCCHECK(((ntohs(dh->dccph_sport) >= info->spts[0]) 117 - && (ntohs(dh->dccph_sport) <= info->spts[1])), 116 + return DCCHECK(ntohs(dh->dccph_sport) >= info->spts[0] 117 + && ntohs(dh->dccph_sport) <= info->spts[1], 118 118 XT_DCCP_SRC_PORTS, info->flags, info->invflags) 119 - && DCCHECK(((ntohs(dh->dccph_dport) >= info->dpts[0]) 120 - && (ntohs(dh->dccph_dport) <= info->dpts[1])), 119 + && DCCHECK(ntohs(dh->dccph_dport) >= info->dpts[0] 120 + && ntohs(dh->dccph_dport) <= info->dpts[1], 121 121 XT_DCCP_DEST_PORTS, info->flags, info->invflags) 122 122 && DCCHECK(match_types(dh, info->typemask), 123 123 XT_DCCP_TYPE, info->flags, info->invflags)
+1 -1
net/netfilter/xt_hashlimit.c
··· 239 239 static bool select_gc(const struct xt_hashlimit_htable *ht, 240 240 const struct dsthash_ent *he) 241 241 { 242 - return (jiffies >= he->expires); 242 + return jiffies >= he->expires; 243 243 } 244 244 245 245 static void htable_selective_cleanup(struct xt_hashlimit_htable *ht,
+2 -2
net/netfilter/xt_length.c
··· 47 47 bool *hotdrop) 48 48 { 49 49 const struct xt_length_info *info = matchinfo; 50 - const u_int16_t pktlen = (ntohs(ipv6_hdr(skb)->payload_len) + 51 - sizeof(struct ipv6hdr)); 50 + const u_int16_t pktlen = ntohs(ipv6_hdr(skb)->payload_len) + 51 + sizeof(struct ipv6hdr); 52 52 53 53 return (pktlen >= info->min && pktlen <= info->max) ^ info->invert; 54 54 }
+5 -5
net/netfilter/xt_mac.c
··· 37 37 const struct xt_mac_info *info = matchinfo; 38 38 39 39 /* Is mac pointer valid? */ 40 - return (skb_mac_header(skb) >= skb->head && 41 - (skb_mac_header(skb) + ETH_HLEN) <= skb->data 42 - /* If so, compare... */ 43 - && ((!compare_ether_addr(eth_hdr(skb)->h_source, info->srcaddr)) 44 - ^ info->invert)); 40 + return skb_mac_header(skb) >= skb->head && 41 + skb_mac_header(skb) + ETH_HLEN <= skb->data 42 + /* If so, compare... */ 43 + && ((!compare_ether_addr(eth_hdr(skb)->h_source, info->srcaddr)) 44 + ^ info->invert); 45 45 } 46 46 47 47 static struct xt_match xt_mac_match[] = {
+2 -2
net/netfilter/xt_pkttype.c
··· 34 34 const struct xt_pkttype_info *info = matchinfo; 35 35 36 36 if (skb->pkt_type == PACKET_LOOPBACK) 37 - type = (MULTICAST(ip_hdr(skb)->daddr) 37 + type = MULTICAST(ip_hdr(skb)->daddr) 38 38 ? PACKET_MULTICAST 39 - : PACKET_BROADCAST); 39 + : PACKET_BROADCAST; 40 40 else 41 41 type = skb->pkt_type; 42 42
+9 -14
net/netfilter/xt_sctp.c
··· 31 31 { 32 32 int i; 33 33 34 - for (i = 0; i < flag_count; i++) { 35 - if (flag_info[i].chunktype == chunktype) { 34 + for (i = 0; i < flag_count; i++) 35 + if (flag_info[i].chunktype == chunktype) 36 36 return (chunkflags & flag_info[i].flag_mask) == flag_info[i].flag; 37 - } 38 - } 39 37 40 38 return true; 41 39 } ··· 54 56 int i = 0; 55 57 #endif 56 58 57 - if (chunk_match_type == SCTP_CHUNK_MATCH_ALL) { 59 + if (chunk_match_type == SCTP_CHUNK_MATCH_ALL) 58 60 SCTP_CHUNKMAP_COPY(chunkmapcopy, chunkmap); 59 - } 60 61 61 62 do { 62 63 sch = skb_header_pointer(skb, offset, sizeof(_sch), &_sch); ··· 83 86 84 87 case SCTP_CHUNK_MATCH_ALL: 85 88 if (match_flags(flag_info, flag_count, 86 - sch->type, sch->flags)) { 89 + sch->type, sch->flags)) 87 90 SCTP_CHUNKMAP_CLEAR(chunkmapcopy, sch->type); 88 - } 89 91 break; 90 92 91 93 case SCTP_CHUNK_MATCH_ONLY: 92 94 if (!match_flags(flag_info, flag_count, 93 - sch->type, sch->flags)) { 95 + sch->type, sch->flags)) 94 96 return false; 95 - } 96 97 break; 97 98 } 98 99 } else { ··· 140 145 } 141 146 duprintf("spt: %d\tdpt: %d\n", ntohs(sh->source), ntohs(sh->dest)); 142 147 143 - return SCCHECK(((ntohs(sh->source) >= info->spts[0]) 144 - && (ntohs(sh->source) <= info->spts[1])), 148 + return SCCHECK(ntohs(sh->source) >= info->spts[0] 149 + && ntohs(sh->source) <= info->spts[1], 145 150 XT_SCTP_SRC_PORTS, info->flags, info->invflags) 146 - && SCCHECK(((ntohs(sh->dest) >= info->dpts[0]) 147 - && (ntohs(sh->dest) <= info->dpts[1])), 151 + && SCCHECK(ntohs(sh->dest) >= info->dpts[0] 152 + && ntohs(sh->dest) <= info->dpts[1], 148 153 XT_SCTP_DEST_PORTS, info->flags, info->invflags) 149 154 && SCCHECK(match_packet(skb, protoff + sizeof (sctp_sctphdr_t), 150 155 info->chunkmap, info->chunk_match_type,
+1 -1
net/netfilter/xt_tcpudp.c
··· 95 95 return false; 96 96 } 97 97 98 - #define FWINVTCP(bool,invflg) ((bool) ^ !!(tcpinfo->invflags & invflg)) 98 + #define FWINVTCP(bool, invflg) ((bool) ^ !!(tcpinfo->invflags & (invflg))) 99 99 100 100 th = skb_header_pointer(skb, protoff, sizeof(_tcph), &_tcph); 101 101 if (th == NULL) {