* [1/2] [IPSEC] Remove unnecessary inet_ecn.h inclusions
@ 2004-08-02 9:31 Herbert Xu
2004-08-02 9:35 ` [2/2] [IPSEC] Move xfrm[46]_tunnel_check_size into xfrm[46]_output.c Herbert Xu
2004-08-03 0:09 ` [1/2] [IPSEC] Remove unnecessary inet_ecn.h inclusions David S. Miller
0 siblings, 2 replies; 4+ messages in thread
From: Herbert Xu @ 2004-08-02 9:31 UTC (permalink / raw)
To: David S. Miller, netdev
[-- Attachment #1: Type: text/plain, Size: 500 bytes --]
Hi Dave:
This is a couple of clean-ups stemming from the xfrm_output change.
I should've removed the inet_ecn.h inclusions in that change as the
ECN code has been moved to xfrm[46]_output.c. This patch does exactly
that.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: p1 --]
[-- Type: text/plain, Size: 2273 bytes --]
===== net/ipv4/ah4.c 1.38 vs edited =====
--- 1.38/net/ipv4/ah4.c 2004-07-30 21:16:40 +10:00
+++ edited/net/ipv4/ah4.c 2004-08-02 17:44:36 +10:00
@@ -1,6 +1,5 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/ah.h>
===== net/ipv4/esp4.c 1.53 vs edited =====
--- 1.53/net/ipv4/esp4.c 2004-07-12 20:00:21 +10:00
+++ edited/net/ipv4/esp4.c 2004-08-02 17:44:49 +10:00
@@ -1,6 +1,5 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/esp.h>
===== net/ipv4/ipcomp.c 1.28 vs edited =====
--- 1.28/net/ipv4/ipcomp.c 2004-07-12 20:00:21 +10:00
+++ edited/net/ipv4/ipcomp.c 2004-08-02 17:44:55 +10:00
@@ -18,7 +18,6 @@
#include <asm/scatterlist.h>
#include <linux/crypto.h>
#include <linux/pfkeyv2.h>
-#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/icmp.h>
===== net/ipv4/xfrm4_tunnel.c 1.13 vs edited =====
--- 1.13/net/ipv4/xfrm4_tunnel.c 2004-07-12 20:00:21 +10:00
+++ edited/net/ipv4/xfrm4_tunnel.c 2004-08-02 17:44:30 +10:00
@@ -7,7 +7,6 @@
#include <net/xfrm.h>
#include <net/ip.h>
#include <net/icmp.h>
-#include <net/inet_ecn.h>
int xfrm4_tunnel_check_size(struct sk_buff *skb)
{
===== net/ipv6/ah6.c 1.38 vs edited =====
--- 1.38/net/ipv6/ah6.c 2004-08-02 07:15:03 +10:00
+++ edited/net/ipv6/ah6.c 2004-08-02 17:45:20 +10:00
@@ -26,7 +26,6 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/ah.h>
#include <linux/crypto.h>
===== net/ipv6/esp6.c 1.34 vs edited =====
--- 1.34/net/ipv6/esp6.c 2004-08-02 07:15:03 +10:00
+++ edited/net/ipv6/esp6.c 2004-08-02 17:45:23 +10:00
@@ -26,7 +26,6 @@
#include <linux/config.h>
#include <linux/module.h>
-#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/esp.h>
===== net/ipv6/ipcomp6.c 1.19 vs edited =====
--- 1.19/net/ipv6/ipcomp6.c 2004-08-02 07:15:03 +10:00
+++ edited/net/ipv6/ipcomp6.c 2004-08-02 17:45:25 +10:00
@@ -32,7 +32,6 @@
*/
#include <linux/config.h>
#include <linux/module.h>
-#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/xfrm.h>
#include <net/ipcomp.h>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [2/2] [IPSEC] Move xfrm[46]_tunnel_check_size into xfrm[46]_output.c
2004-08-02 9:31 [1/2] [IPSEC] Remove unnecessary inet_ecn.h inclusions Herbert Xu
@ 2004-08-02 9:35 ` Herbert Xu
2004-08-03 0:11 ` David S. Miller
2004-08-03 0:09 ` [1/2] [IPSEC] Remove unnecessary inet_ecn.h inclusions David S. Miller
1 sibling, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2004-08-02 9:35 UTC (permalink / raw)
To: David S. Miller, netdev
[-- Attachment #1: Type: text/plain, Size: 555 bytes --]
This patch moves xfrm[46]_tunnel_check_size() into xfrm[46]_output.c
where it can be made static since it's only used there.
While moving the icmp.h inclusions over I also discovered that the
tunnel files are missing an inclusion of net/protocol.h. So I've
added them as well.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[-- Attachment #2: p2 --]
[-- Type: text/plain, Size: 5058 bytes --]
===== include/net/xfrm.h 1.62 vs edited =====
--- 1.62/include/net/xfrm.h 2004-08-02 07:15:02 +10:00
+++ edited/include/net/xfrm.h 2004-08-02 18:02:32 +10:00
@@ -821,12 +821,10 @@
extern int xfrm4_output(struct sk_buff **pskb);
extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
-extern int xfrm4_tunnel_check_size(struct sk_buff *skb);
extern int xfrm6_rcv(struct sk_buff **pskb, unsigned int *nhoffp);
extern int xfrm6_output(struct sk_buff **pskb);
extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler);
extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler);
-extern int xfrm6_tunnel_check_size(struct sk_buff *skb);
extern u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr);
extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr);
extern u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr);
===== net/ipv4/xfrm4_output.c 1.1 vs edited =====
--- 1.1/net/ipv4/xfrm4_output.c 2004-07-11 04:53:15 +10:00
+++ edited/net/ipv4/xfrm4_output.c 2004-08-02 17:58:15 +10:00
@@ -13,6 +13,7 @@
#include <net/inet_ecn.h>
#include <net/ip.h>
#include <net/xfrm.h>
+#include <net/icmp.h>
/* Add encapsulation header.
*
@@ -65,6 +66,30 @@
top_iph->protocol = IPPROTO_IPIP;
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
+}
+
+static int xfrm4_tunnel_check_size(struct sk_buff *skb)
+{
+ int mtu, ret = 0;
+ struct dst_entry *dst;
+ struct iphdr *iph = skb->nh.iph;
+
+ if (IPCB(skb)->flags & IPSKB_XFRM_TUNNEL_SIZE)
+ goto out;
+
+ IPCB(skb)->flags |= IPSKB_XFRM_TUNNEL_SIZE;
+
+ if (!(iph->frag_off & htons(IP_DF)))
+ goto out;
+
+ dst = skb->dst;
+ mtu = dst_pmtu(dst) - dst->header_len - dst->trailer_len;
+ if (skb->len > mtu) {
+ icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
+ ret = -EMSGSIZE;
+ }
+out:
+ return ret;
}
int xfrm4_output(struct sk_buff **pskb)
===== net/ipv4/xfrm4_tunnel.c 1.14 vs edited =====
--- 1.14/net/ipv4/xfrm4_tunnel.c 2004-08-02 17:53:26 +10:00
+++ edited/net/ipv4/xfrm4_tunnel.c 2004-08-02 18:06:32 +10:00
@@ -6,31 +6,7 @@
#include <linux/skbuff.h>
#include <net/xfrm.h>
#include <net/ip.h>
-#include <net/icmp.h>
-
-int xfrm4_tunnel_check_size(struct sk_buff *skb)
-{
- int mtu, ret = 0;
- struct dst_entry *dst;
- struct iphdr *iph = skb->nh.iph;
-
- if (IPCB(skb)->flags & IPSKB_XFRM_TUNNEL_SIZE)
- goto out;
-
- IPCB(skb)->flags |= IPSKB_XFRM_TUNNEL_SIZE;
-
- if (!(iph->frag_off & htons(IP_DF)))
- goto out;
-
- dst = skb->dst;
- mtu = dst_pmtu(dst) - dst->header_len - dst->trailer_len;
- if (skb->len > mtu) {
- icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
- ret = -EMSGSIZE;
- }
-out:
- return ret;
-}
+#include <net/protocol.h>
static int ipip_output(struct sk_buff **pskb)
{
===== net/ipv6/xfrm6_output.c 1.1 vs edited =====
--- 1.1/net/ipv6/xfrm6_output.c 2004-07-30 12:17:21 +10:00
+++ edited/net/ipv6/xfrm6_output.c 2004-08-02 18:01:03 +10:00
@@ -11,6 +11,7 @@
#include <linux/skbuff.h>
#include <linux/spinlock.h>
+#include <linux/icmpv6.h>
#include <net/inet_ecn.h>
#include <net/ipv6.h>
#include <net/xfrm.h>
@@ -66,6 +67,23 @@
top_iph->hop_limit = iph->hop_limit;
ipv6_addr_copy(&top_iph->saddr, (struct in6_addr *)&x->props.saddr);
ipv6_addr_copy(&top_iph->daddr, (struct in6_addr *)&x->id.daddr);
+}
+
+static int xfrm6_tunnel_check_size(struct sk_buff *skb)
+{
+ int mtu, ret = 0;
+ struct dst_entry *dst = skb->dst;
+
+ mtu = dst_pmtu(dst) - sizeof(struct ipv6hdr);
+ if (mtu < IPV6_MIN_MTU)
+ mtu = IPV6_MIN_MTU;
+
+ if (skb->len > mtu) {
+ icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
+ ret = -EMSGSIZE;
+ }
+
+ return ret;
}
int xfrm6_output(struct sk_buff **pskb)
===== net/ipv6/xfrm6_tunnel.c 1.4 vs edited =====
--- 1.4/net/ipv6/xfrm6_tunnel.c 2004-08-02 07:15:03 +10:00
+++ edited/net/ipv6/xfrm6_tunnel.c 2004-08-02 18:07:06 +10:00
@@ -27,8 +27,8 @@
#include <linux/list.h>
#include <net/ip.h>
#include <net/xfrm.h>
-#include <net/icmp.h>
#include <net/ipv6.h>
+#include <net/protocol.h>
#include <linux/ipv6.h>
#include <linux/icmpv6.h>
@@ -342,25 +342,6 @@
}
EXPORT_SYMBOL(xfrm6_tunnel_free_spi);
-
-int xfrm6_tunnel_check_size(struct sk_buff *skb)
-{
- int mtu, ret = 0;
- struct dst_entry *dst = skb->dst;
-
- mtu = dst_pmtu(dst) - sizeof(struct ipv6hdr);
- if (mtu < IPV6_MIN_MTU)
- mtu = IPV6_MIN_MTU;
-
- if (skb->len > mtu) {
- icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
- ret = -EMSGSIZE;
- }
-
- return ret;
-}
-
-EXPORT_SYMBOL(xfrm6_tunnel_check_size);
static int xfrm6_tunnel_output(struct sk_buff **pskb)
{
===== net/xfrm/xfrm_export.c 1.2 vs edited =====
--- 1.2/net/xfrm/xfrm_export.c 2004-06-18 16:20:58 +10:00
+++ edited/net/xfrm/xfrm_export.c 2004-08-02 17:58:32 +10:00
@@ -35,7 +35,6 @@
EXPORT_SYMBOL(xfrm4_rcv);
EXPORT_SYMBOL(xfrm4_tunnel_register);
EXPORT_SYMBOL(xfrm4_tunnel_deregister);
-EXPORT_SYMBOL(xfrm4_tunnel_check_size);
EXPORT_SYMBOL(xfrm_register_type);
EXPORT_SYMBOL(xfrm_unregister_type);
EXPORT_SYMBOL(xfrm_get_type);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [1/2] [IPSEC] Remove unnecessary inet_ecn.h inclusions
2004-08-02 9:31 [1/2] [IPSEC] Remove unnecessary inet_ecn.h inclusions Herbert Xu
2004-08-02 9:35 ` [2/2] [IPSEC] Move xfrm[46]_tunnel_check_size into xfrm[46]_output.c Herbert Xu
@ 2004-08-03 0:09 ` David S. Miller
1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-08-03 0:09 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Mon, 2 Aug 2004 19:31:53 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> I should've removed the inet_ecn.h inclusions in that change as the
> ECN code has been moved to xfrm[46]_output.c. This patch does exactly
> that.
Ok, applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [2/2] [IPSEC] Move xfrm[46]_tunnel_check_size into xfrm[46]_output.c
2004-08-02 9:35 ` [2/2] [IPSEC] Move xfrm[46]_tunnel_check_size into xfrm[46]_output.c Herbert Xu
@ 2004-08-03 0:11 ` David S. Miller
0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2004-08-03 0:11 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
On Mon, 2 Aug 2004 19:35:00 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> This patch moves xfrm[46]_tunnel_check_size() into xfrm[46]_output.c
> where it can be made static since it's only used there.
>
> While moving the icmp.h inclusions over I also discovered that the
> tunnel files are missing an inclusion of net/protocol.h. So I've
> added them as well.
The net/xfrm.h hunk failed, but I fixed that up by hand.
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-08-03 0:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-02 9:31 [1/2] [IPSEC] Remove unnecessary inet_ecn.h inclusions Herbert Xu
2004-08-02 9:35 ` [2/2] [IPSEC] Move xfrm[46]_tunnel_check_size into xfrm[46]_output.c Herbert Xu
2004-08-03 0:11 ` David S. Miller
2004-08-03 0:09 ` [1/2] [IPSEC] Remove unnecessary inet_ecn.h inclusions David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).