Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7c4e36bc authored by Jan Engelhardt's avatar Jan Engelhardt Committed by David S. Miller
Browse files

[NETFILTER]: Remove redundant parentheses/braces



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

Signed-off-by: default avatarJan Engelhardt <jengelh@gmx.de>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 170b197c
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -122,10 +122,9 @@ __clusterip_config_find(__be32 clusterip)
	list_for_each(pos, &clusterip_configs) {
		struct clusterip_config *c = list_entry(pos,
					struct clusterip_config, list);
		if (c->clusterip == clusterip) {
		if (c->clusterip == clusterip)
			return c;
	}
	}

	return NULL;
}
@@ -155,10 +154,9 @@ clusterip_config_init_nodelist(struct clusterip_config *c,
{
	int n;

	for (n = 0; n < i->num_local_nodes; n++) {
	for (n = 0; n < i->num_local_nodes; n++)
		set_bit(i->local_nodes[n] - 1, &c->local_nodes);
}
}

static struct clusterip_config *
clusterip_config_init(struct ipt_clusterip_tgt_info *i, __be32 ip,
@@ -255,10 +253,9 @@ clusterip_hashfn(const struct sk_buff *skb,
		dport = ports[1];
		break;
	default:
		if (net_ratelimit()) {
		if (net_ratelimit())
			printk(KERN_NOTICE "CLUSTERIP: unknown protocol `%u'\n",
				iph->protocol);
		}
		sport = dport = 0;
	}

@@ -286,7 +283,7 @@ clusterip_hashfn(const struct sk_buff *skb,
	}

	/* node numbers are 1..n, not 0..n */
	return ((hashval % config->num_total_nodes)+1);
	return (hashval % config->num_total_nodes) + 1;
}

static inline int
+2 −2
Original line number Diff line number Diff line
@@ -58,8 +58,8 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo)

	if ((!(einfo->operation & IPT_ECN_OP_SET_ECE) ||
	     tcph->ece == einfo->proto.tcp.ece) &&
	    ((!(einfo->operation & IPT_ECN_OP_SET_CWR) ||
	     tcph->cwr == einfo->proto.tcp.cwr)))
	    (!(einfo->operation & IPT_ECN_OP_SET_CWR) ||
	     tcph->cwr == einfo->proto.tcp.cwr))
		return true;

	if (!skb_make_writable(pskb, ip_hdrlen(*pskb) + sizeof(*tcph)))
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ static bool ipt_ttl_checkentry(const char *tablename,
			info->mode);
		return false;
	}
	if ((info->mode != IPT_TTL_SET) && (info->ttl == 0))
	if (info->mode != IPT_TTL_SET && info->ttl == 0)
		return false;
	return true;
}
+3 −6
Original line number Diff line number Diff line
@@ -179,12 +179,10 @@ static void ipt_ulog_packet(unsigned int hooknum,
	unsigned int groupnum = ffs(loginfo->nl_group) - 1;

	/* calculate the size of the skb needed */
	if ((loginfo->copy_range == 0) ||
	    (loginfo->copy_range > skb->len)) {
	if (loginfo->copy_range == 0 || loginfo->copy_range > skb->len)
		copy_len = skb->len;
	} else {
	else
		copy_len = loginfo->copy_range;
	}

	size = NLMSG_SPACE(sizeof(*pm) + copy_len);

@@ -257,9 +255,8 @@ static void ipt_ulog_packet(unsigned int hooknum,
		BUG();

	/* check if we are building multi-part messages */
	if (ub->qlen > 1) {
	if (ub->qlen > 1)
		ub->lastnlh->nlmsg_flags |= NLM_F_MULTI;
	}

	ub->lastnlh = nlh;

+4 −4
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@ match(const struct sk_buff *skb,
	const struct iphdr *iph = ip_hdr(skb);

	if (info->flags & IPRANGE_SRC) {
		if (((ntohl(iph->saddr) < ntohl(info->src.min_ip))
			  || (ntohl(iph->saddr) > ntohl(info->src.max_ip)))
		if ((ntohl(iph->saddr) < ntohl(info->src.min_ip)
			  || ntohl(iph->saddr) > ntohl(info->src.max_ip))
			 ^ !!(info->flags & IPRANGE_SRC_INV)) {
			DEBUGP("src IP %u.%u.%u.%u NOT in range %s"
			       "%u.%u.%u.%u-%u.%u.%u.%u\n",
@@ -48,8 +48,8 @@ match(const struct sk_buff *skb,
		}
	}
	if (info->flags & IPRANGE_DST) {
		if (((ntohl(iph->daddr) < ntohl(info->dst.min_ip))
			  || (ntohl(iph->daddr) > ntohl(info->dst.max_ip)))
		if ((ntohl(iph->daddr) < ntohl(info->dst.min_ip)
			  || ntohl(iph->daddr) > ntohl(info->dst.max_ip))
			 ^ !!(info->flags & IPRANGE_DST_INV)) {
			DEBUGP("dst IP %u.%u.%u.%u NOT in range %s"
			       "%u.%u.%u.%u-%u.%u.%u.%u\n",
Loading