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

Commit be0ea7d5 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

[NETFILTER]: Convert old checksum helper names



Kill the defines again, convert to the new checksum helper names and
remove the dependency of NET_ACT_NAT on NETFILTER.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a99a00cf
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -298,11 +298,6 @@ extern void nf_invalidate_cache(int pf);
   Returns true or false. */
extern int skb_make_writable(struct sk_buff *skb, unsigned int writable_len);

#define nf_csum_replace4	csum_replace4
#define nf_csum_replace2	csum_replace2
#define nf_proto_csum_replace4	inet_proto_csum_replace4
#define nf_proto_csum_replace2	inet_proto_csum_replace2

struct nf_afinfo {
	unsigned short	family;
	__sum16		(*checksum)(struct sk_buff *skb, unsigned int hook,
+3 −3
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ set_ect_ip(struct sk_buff *skb, const struct ipt_ECN_info *einfo)
		oldtos = iph->tos;
		iph->tos &= ~IPT_ECN_IP_MASK;
		iph->tos |= (einfo->ip_ect & IPT_ECN_IP_MASK);
		nf_csum_replace2(&iph->check, htons(oldtos), htons(iph->tos));
		csum_replace2(&iph->check, htons(oldtos), htons(iph->tos));
	}
	return true;
}
@@ -71,7 +71,7 @@ set_ect_tcp(struct sk_buff *skb, const struct ipt_ECN_info *einfo)
	if (einfo->operation & IPT_ECN_OP_SET_CWR)
		tcph->cwr = einfo->proto.tcp.cwr;

	nf_proto_csum_replace2(&tcph->check, skb,
	inet_proto_csum_replace2(&tcph->check, skb,
				 oldval, ((__be16 *)tcph)[6], 0);
	return true;
}
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ target(struct sk_buff *skb,
		iph = ip_hdr(skb);
		oldtos = iph->tos;
		iph->tos = (iph->tos & IPTOS_PREC_MASK) | tosinfo->tos;
		nf_csum_replace2(&iph->check, htons(oldtos), htons(iph->tos));
		csum_replace2(&iph->check, htons(oldtos), htons(iph->tos));
	}
	return XT_CONTINUE;
}
+2 −2
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ ipt_ttl_target(struct sk_buff *skb,
	}

	if (new_ttl != iph->ttl) {
		nf_csum_replace2(&iph->check, htons(iph->ttl << 8),
		csum_replace2(&iph->check, htons(iph->ttl << 8),
					   htons(new_ttl << 8));
		iph->ttl = new_ttl;
	}
+2 −2
Original line number Diff line number Diff line
@@ -372,10 +372,10 @@ manip_pkt(u_int16_t proto,
	iph = (void *)skb->data + iphdroff;

	if (maniptype == IP_NAT_MANIP_SRC) {
		nf_csum_replace4(&iph->check, iph->saddr, target->src.u3.ip);
		csum_replace4(&iph->check, iph->saddr, target->src.u3.ip);
		iph->saddr = target->src.u3.ip;
	} else {
		nf_csum_replace4(&iph->check, iph->daddr, target->dst.u3.ip);
		csum_replace4(&iph->check, iph->daddr, target->dst.u3.ip);
		iph->daddr = target->dst.u3.ip;
	}
	return 1;
Loading