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

Commit 089af26c authored by Harald Welte's avatar Harald Welte Committed by David S. Miller
Browse files

[NETFILTER]: Rename skb_ip_make_writable() to skb_make_writable()



There is nothing IPv4-specific in it.  In fact, it was already used by
IPv6, too...  Upcoming nfnetlink_queue code will use it for any kind
of packet.

Signed-off-by: default avatarHarald Welte <laforge@netfilter.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 373ac735
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -193,6 +193,11 @@ extern void nf_ct_attach(struct sk_buff *, struct sk_buff *);
/* FIXME: Before cache is ever used, this must be implemented for real. */
extern void nf_invalidate_cache(int pf);

/* Call this before modifying an existing packet: ensures it is
   modifiable and linear to the point you care about (writable_len).
   Returns true or false. */
extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len);

#else /* !CONFIG_NETFILTER */
#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
+0 −5
Original line number Diff line number Diff line
@@ -80,11 +80,6 @@ enum nf_ip_hook_priorities {
#ifdef __KERNEL__
extern int ip_route_me_harder(struct sk_buff **pskb);

/* Call this before modifying an existing IP packet: ensures it is
   modifiable and linear to the point you care about (writable_len).
   Returns true or false. */
extern int skb_ip_make_writable(struct sk_buff **pskb,
				unsigned int writable_len);
#endif /*__KERNEL__*/

#endif /*__LINUX_IP_NETFILTER_H*/
+3 −3
Original line number Diff line number Diff line
@@ -512,8 +512,9 @@ int ip_route_me_harder(struct sk_buff **pskb)
	return 0;
}
EXPORT_SYMBOL(ip_route_me_harder);
#endif /*CONFIG_INET*/

int skb_ip_make_writable(struct sk_buff **pskb, unsigned int writable_len)
int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len)
{
	struct sk_buff *nskb;

@@ -540,8 +541,7 @@ int skb_ip_make_writable(struct sk_buff **pskb, unsigned int writable_len)
	*pskb = nskb;
	return 1;
}
EXPORT_SYMBOL(skb_ip_make_writable);
#endif /*CONFIG_INET*/
EXPORT_SYMBOL(skb_make_writable);

/* Internal logging interface, which relies on the real 
   LOG target modules */
+2 −2
Original line number Diff line number Diff line
@@ -359,7 +359,7 @@ manip_pkt(u_int16_t proto,
	struct iphdr *iph;
	struct ip_nat_protocol *p;

	if (!skb_ip_make_writable(pskb, iphdroff + sizeof(*iph)))
	if (!skb_make_writable(pskb, iphdroff + sizeof(*iph)))
		return 0;

	iph = (void *)(*pskb)->data + iphdroff;
@@ -431,7 +431,7 @@ int icmp_reply_translation(struct sk_buff **pskb,
	struct ip_conntrack_tuple inner, target;
	int hdrlen = (*pskb)->nh.iph->ihl * 4;

	if (!skb_ip_make_writable(pskb, hdrlen + sizeof(*inside)))
	if (!skb_make_writable(pskb, hdrlen + sizeof(*inside)))
		return 0;

	inside = (void *)(*pskb)->data + (*pskb)->nh.iph->ihl*4;
+4 −4
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ ip_nat_mangle_tcp_packet(struct sk_buff **pskb,
	struct tcphdr *tcph;
	int datalen;

	if (!skb_ip_make_writable(pskb, (*pskb)->len))
	if (!skb_make_writable(pskb, (*pskb)->len))
		return 0;

	if (rep_len > match_len
@@ -228,7 +228,7 @@ ip_nat_mangle_udp_packet(struct sk_buff **pskb,
	                       match_offset + match_len)
		return 0;

	if (!skb_ip_make_writable(pskb, (*pskb)->len))
	if (!skb_make_writable(pskb, (*pskb)->len))
		return 0;

	if (rep_len > match_len
@@ -315,7 +315,7 @@ ip_nat_sack_adjust(struct sk_buff **pskb,
	optoff = (*pskb)->nh.iph->ihl*4 + sizeof(struct tcphdr);
	optend = (*pskb)->nh.iph->ihl*4 + tcph->doff*4;

	if (!skb_ip_make_writable(pskb, optend))
	if (!skb_make_writable(pskb, optend))
		return 0;

	dir = CTINFO2DIR(ctinfo);
@@ -363,7 +363,7 @@ ip_nat_seq_adjust(struct sk_buff **pskb,
	this_way = &ct->nat.info.seq[dir];
	other_way = &ct->nat.info.seq[!dir];

	if (!skb_ip_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph)))
	if (!skb_make_writable(pskb, (*pskb)->nh.iph->ihl*4+sizeof(*tcph)))
		return 0;

	tcph = (void *)(*pskb)->data + (*pskb)->nh.iph->ihl*4;
Loading