aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_frontend.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-12 02:02:42 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-12 18:08:49 -0500
commit9ade22861f922344788321e374c542c92bc049b6 (patch)
treec0bc23180b3f51104745d263a106c62b4bec11a4 /net/ipv4/fib_frontend.c
parent9d6ec938019c6b16cb9ec96598ebe8f20de435fe (diff)
ipv4: Use flowi4 in FIB layer.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r--net/ipv4/fib_frontend.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 48125d559f1..a373a259253 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -140,7 +140,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
140 const struct net_device *dev, 140 const struct net_device *dev,
141 __be32 addr) 141 __be32 addr)
142{ 142{
143 struct flowi fl = { .fl4_dst = addr }; 143 struct flowi4 fl4 = { .daddr = addr };
144 struct fib_result res; 144 struct fib_result res;
145 unsigned ret = RTN_BROADCAST; 145 unsigned ret = RTN_BROADCAST;
146 struct fib_table *local_table; 146 struct fib_table *local_table;
@@ -158,7 +158,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
158 if (local_table) { 158 if (local_table) {
159 ret = RTN_UNICAST; 159 ret = RTN_UNICAST;
160 rcu_read_lock(); 160 rcu_read_lock();
161 if (!fib_table_lookup(local_table, &fl.u.ip4, &res, FIB_LOOKUP_NOREF)) { 161 if (!fib_table_lookup(local_table, &fl4, &res, FIB_LOOKUP_NOREF)) {
162 if (!dev || dev == res.fi->fib_dev) 162 if (!dev || dev == res.fi->fib_dev)
163 ret = res.type; 163 ret = res.type;
164 } 164 }
@@ -193,20 +193,20 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
193 u32 *itag, u32 mark) 193 u32 *itag, u32 mark)
194{ 194{
195 struct in_device *in_dev; 195 struct in_device *in_dev;
196 struct flowi fl; 196 struct flowi4 fl4;
197 struct fib_result res; 197 struct fib_result res;
198 int no_addr, rpf, accept_local; 198 int no_addr, rpf, accept_local;
199 bool dev_match; 199 bool dev_match;
200 int ret; 200 int ret;
201 struct net *net; 201 struct net *net;
202 202
203 fl.flowi_oif = 0; 203 fl4.flowi4_oif = 0;
204 fl.flowi_iif = oif; 204 fl4.flowi4_iif = oif;
205 fl.flowi_mark = mark; 205 fl4.flowi4_mark = mark;
206 fl.fl4_dst = src; 206 fl4.daddr = src;
207 fl.fl4_src = dst; 207 fl4.saddr = dst;
208 fl.fl4_tos = tos; 208 fl4.flowi4_tos = tos;
209 fl.fl4_scope = RT_SCOPE_UNIVERSE; 209 fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
210 210
211 no_addr = rpf = accept_local = 0; 211 no_addr = rpf = accept_local = 0;
212 in_dev = __in_dev_get_rcu(dev); 212 in_dev = __in_dev_get_rcu(dev);
@@ -215,14 +215,14 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
215 rpf = IN_DEV_RPFILTER(in_dev); 215 rpf = IN_DEV_RPFILTER(in_dev);
216 accept_local = IN_DEV_ACCEPT_LOCAL(in_dev); 216 accept_local = IN_DEV_ACCEPT_LOCAL(in_dev);
217 if (mark && !IN_DEV_SRC_VMARK(in_dev)) 217 if (mark && !IN_DEV_SRC_VMARK(in_dev))
218 fl.flowi_mark = 0; 218 fl4.flowi4_mark = 0;
219 } 219 }
220 220
221 if (in_dev == NULL) 221 if (in_dev == NULL)
222 goto e_inval; 222 goto e_inval;
223 223
224 net = dev_net(dev); 224 net = dev_net(dev);
225 if (fib_lookup(net, &fl.u.ip4, &res)) 225 if (fib_lookup(net, &fl4, &res))
226 goto last_resort; 226 goto last_resort;
227 if (res.type != RTN_UNICAST) { 227 if (res.type != RTN_UNICAST) {
228 if (res.type != RTN_LOCAL || !accept_local) 228 if (res.type != RTN_LOCAL || !accept_local)
@@ -253,10 +253,10 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
253 goto last_resort; 253 goto last_resort;
254 if (rpf == 1) 254 if (rpf == 1)
255 goto e_rpf; 255 goto e_rpf;
256 fl.flowi_oif = dev->ifindex; 256 fl4.flowi4_oif = dev->ifindex;
257 257
258 ret = 0; 258 ret = 0;
259 if (fib_lookup(net, &fl.u.ip4, &res) == 0) { 259 if (fib_lookup(net, &fl4, &res) == 0) {
260 if (res.type == RTN_UNICAST) { 260 if (res.type == RTN_UNICAST) {
261 *spec_dst = FIB_RES_PREFSRC(res); 261 *spec_dst = FIB_RES_PREFSRC(res);
262 ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST; 262 ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
@@ -796,11 +796,11 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb)
796{ 796{
797 797
798 struct fib_result res; 798 struct fib_result res;
799 struct flowi fl = { 799 struct flowi4 fl4 = {
800 .flowi_mark = frn->fl_mark, 800 .flowi4_mark = frn->fl_mark,
801 .fl4_dst = frn->fl_addr, 801 .daddr = frn->fl_addr,
802 .fl4_tos = frn->fl_tos, 802 .flowi4_tos = frn->fl_tos,
803 .fl4_scope = frn->fl_scope, 803 .flowi4_scope = frn->fl_scope,
804 }; 804 };
805 805
806#ifdef CONFIG_IP_MULTIPLE_TABLES 806#ifdef CONFIG_IP_MULTIPLE_TABLES
@@ -813,7 +813,7 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb)
813 813
814 frn->tb_id = tb->tb_id; 814 frn->tb_id = tb->tb_id;
815 rcu_read_lock(); 815 rcu_read_lock();
816 frn->err = fib_table_lookup(tb, &fl.u.ip4, &res, FIB_LOOKUP_NOREF); 816 frn->err = fib_table_lookup(tb, &fl4, &res, FIB_LOOKUP_NOREF);
817 817
818 if (!frn->err) { 818 if (!frn->err) {
819 frn->prefixlen = res.prefixlen; 819 frn->prefixlen = res.prefixlen;