summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipmr.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-04 21:47:09 -0800
committerDavid S. Miller <davem@davemloft.net>2011-03-04 21:55:31 -0800
commit5e2b61f78411be25f0b84f97d5b5d312f184dfd1 (patch)
tree6a5faa5fb7a2242bebacba4cdb5722b988d3e909 /net/ipv4/ipmr.c
parent1018b5c01636c7c6bda31a719bda34fc631db29a (diff)
ipv4: Remove flowi from struct rtable.
The only necessary parts are the src/dst addresses, the interface indexes, the TOS, and the mark. The rest is unnecessary bloat, which amounts to nearly 50 bytes on 64-bit. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipmr.c')
-rw-r--r--net/ipv4/ipmr.c52
1 files changed, 41 insertions, 11 deletions
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 26ca2f2d37c..9d5f6340af1 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1813,12 +1813,22 @@ int ip_mr_input(struct sk_buff *skb)
if (IPCB(skb)->flags & IPSKB_FORWARDED)
goto dont_forward;
- err = ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt);
- if (err < 0) {
- kfree_skb(skb);
- return err;
+ {
+ struct rtable *rt = skb_rtable(skb);
+ struct flowi fl = {
+ .fl4_dst = rt->rt_key_dst,
+ .fl4_src = rt->rt_key_src,
+ .fl4_tos = rt->rt_tos,
+ .oif = rt->rt_oif,
+ .iif = rt->rt_iif,
+ .mark = rt->rt_mark,
+ };
+ err = ipmr_fib_lookup(net, &fl, &mrt);
+ if (err < 0) {
+ kfree_skb(skb);
+ return err;
+ }
}
-
if (!local) {
if (IPCB(skb)->opt.router_alert) {
if (ip_call_ra_chain(skb))
@@ -1946,9 +1956,19 @@ int pim_rcv_v1(struct sk_buff *skb)
pim = igmp_hdr(skb);
- if (ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt) < 0)
- goto drop;
-
+ {
+ struct rtable *rt = skb_rtable(skb);
+ struct flowi fl = {
+ .fl4_dst = rt->rt_key_dst,
+ .fl4_src = rt->rt_key_src,
+ .fl4_tos = rt->rt_tos,
+ .oif = rt->rt_oif,
+ .iif = rt->rt_iif,
+ .mark = rt->rt_mark,
+ };
+ if (ipmr_fib_lookup(net, &fl, &mrt) < 0)
+ goto drop;
+ }
if (!mrt->mroute_do_pim ||
pim->group != PIM_V1_VERSION || pim->code != PIM_V1_REGISTER)
goto drop;
@@ -1978,9 +1998,19 @@ static int pim_rcv(struct sk_buff *skb)
csum_fold(skb_checksum(skb, 0, skb->len, 0))))
goto drop;
- if (ipmr_fib_lookup(net, &skb_rtable(skb)->fl, &mrt) < 0)
- goto drop;
-
+ {
+ struct rtable *rt = skb_rtable(skb);
+ struct flowi fl = {
+ .fl4_dst = rt->rt_key_dst,
+ .fl4_src = rt->rt_key_src,
+ .fl4_tos = rt->rt_tos,
+ .oif = rt->rt_oif,
+ .iif = rt->rt_iif,
+ .mark = rt->rt_mark,
+ };
+ if (ipmr_fib_lookup(net, &fl, &mrt) < 0)
+ goto drop;
+ }
if (__pim_rcv(mrt, skb, sizeof(*pim))) {
drop:
kfree_skb(skb);