aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-28 16:24:06 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-28 16:24:06 -0400
commitdef8b4faff5ca349beafbbfeb2c51f3602a6ef3a (patch)
treea90fbb0b6ae2a49c507465801f31df77bc5ebf9d /net/ipv4
parentb057efd4d226fcc3a92b0dc6d8ea8e8185ecb260 (diff)
net: reduce structures when XFRM=n
ifdef out * struct sk_buff::sp (pointer) * struct dst_entry::xfrm (pointer) * struct sock::sk_policy (2 pointers) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/icmp.c3
-rw-r--r--net/ipv4/ip_forward.c2
-rw-r--r--net/ipv4/route.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 72b2de76f1cd..e9d6ea0b49ca 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -976,9 +976,10 @@ int icmp_rcv(struct sk_buff *skb)
976 struct net *net = dev_net(rt->u.dst.dev); 976 struct net *net = dev_net(rt->u.dst.dev);
977 977
978 if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { 978 if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
979 struct sec_path *sp = skb_sec_path(skb);
979 int nh; 980 int nh;
980 981
981 if (!(skb->sp && skb->sp->xvec[skb->sp->len - 1]->props.flags & 982 if (!(sp && sp->xvec[sp->len - 1]->props.flags &
982 XFRM_STATE_ICMP)) 983 XFRM_STATE_ICMP))
983 goto drop; 984 goto drop;
984 985
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index 450016b89a18..df3fe50bbf0d 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -106,7 +106,7 @@ int ip_forward(struct sk_buff *skb)
106 * We now generate an ICMP HOST REDIRECT giving the route 106 * We now generate an ICMP HOST REDIRECT giving the route
107 * we calculated. 107 * we calculated.
108 */ 108 */
109 if (rt->rt_flags&RTCF_DOREDIRECT && !opt->srr && !skb->sp) 109 if (rt->rt_flags&RTCF_DOREDIRECT && !opt->srr && !skb_sec_path(skb))
110 ip_rt_send_redirect(skb); 110 ip_rt_send_redirect(skb);
111 111
112 skb->priority = rt_tos2priority(iph->tos); 112 skb->priority = rt_tos2priority(iph->tos);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 21ce7e1b2284..ffb2c5705432 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1399,7 +1399,9 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
1399 rt->u.dst.path = &rt->u.dst; 1399 rt->u.dst.path = &rt->u.dst;
1400 rt->u.dst.neighbour = NULL; 1400 rt->u.dst.neighbour = NULL;
1401 rt->u.dst.hh = NULL; 1401 rt->u.dst.hh = NULL;
1402#ifdef CONFIG_XFRM
1402 rt->u.dst.xfrm = NULL; 1403 rt->u.dst.xfrm = NULL;
1404#endif
1403 rt->rt_genid = rt_genid(net); 1405 rt->rt_genid = rt_genid(net);
1404 rt->rt_flags |= RTCF_REDIRECTED; 1406 rt->rt_flags |= RTCF_REDIRECTED;
1405 1407