|
@@ -140,7 +140,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
|
|
const struct net_device *dev,
|
|
const struct net_device *dev,
|
|
__be32 addr)
|
|
__be32 addr)
|
|
{
|
|
{
|
|
- struct flowi fl = { .fl4_dst = addr };
|
|
|
|
|
|
+ struct flowi4 fl4 = { .daddr = addr };
|
|
struct fib_result res;
|
|
struct fib_result res;
|
|
unsigned ret = RTN_BROADCAST;
|
|
unsigned ret = RTN_BROADCAST;
|
|
struct fib_table *local_table;
|
|
struct fib_table *local_table;
|
|
@@ -158,7 +158,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net,
|
|
if (local_table) {
|
|
if (local_table) {
|
|
ret = RTN_UNICAST;
|
|
ret = RTN_UNICAST;
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
- if (!fib_table_lookup(local_table, &fl.u.ip4, &res, FIB_LOOKUP_NOREF)) {
|
|
|
|
|
|
+ if (!fib_table_lookup(local_table, &fl4, &res, FIB_LOOKUP_NOREF)) {
|
|
if (!dev || dev == res.fi->fib_dev)
|
|
if (!dev || dev == res.fi->fib_dev)
|
|
ret = res.type;
|
|
ret = res.type;
|
|
}
|
|
}
|
|
@@ -193,20 +193,20 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
|
|
u32 *itag, u32 mark)
|
|
u32 *itag, u32 mark)
|
|
{
|
|
{
|
|
struct in_device *in_dev;
|
|
struct in_device *in_dev;
|
|
- struct flowi fl;
|
|
|
|
|
|
+ struct flowi4 fl4;
|
|
struct fib_result res;
|
|
struct fib_result res;
|
|
int no_addr, rpf, accept_local;
|
|
int no_addr, rpf, accept_local;
|
|
bool dev_match;
|
|
bool dev_match;
|
|
int ret;
|
|
int ret;
|
|
struct net *net;
|
|
struct net *net;
|
|
|
|
|
|
- fl.flowi_oif = 0;
|
|
|
|
- fl.flowi_iif = oif;
|
|
|
|
- fl.flowi_mark = mark;
|
|
|
|
- fl.fl4_dst = src;
|
|
|
|
- fl.fl4_src = dst;
|
|
|
|
- fl.fl4_tos = tos;
|
|
|
|
- fl.fl4_scope = RT_SCOPE_UNIVERSE;
|
|
|
|
|
|
+ fl4.flowi4_oif = 0;
|
|
|
|
+ fl4.flowi4_iif = oif;
|
|
|
|
+ fl4.flowi4_mark = mark;
|
|
|
|
+ fl4.daddr = src;
|
|
|
|
+ fl4.saddr = dst;
|
|
|
|
+ fl4.flowi4_tos = tos;
|
|
|
|
+ fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
|
|
|
|
|
|
no_addr = rpf = accept_local = 0;
|
|
no_addr = rpf = accept_local = 0;
|
|
in_dev = __in_dev_get_rcu(dev);
|
|
in_dev = __in_dev_get_rcu(dev);
|
|
@@ -215,14 +215,14 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
|
|
rpf = IN_DEV_RPFILTER(in_dev);
|
|
rpf = IN_DEV_RPFILTER(in_dev);
|
|
accept_local = IN_DEV_ACCEPT_LOCAL(in_dev);
|
|
accept_local = IN_DEV_ACCEPT_LOCAL(in_dev);
|
|
if (mark && !IN_DEV_SRC_VMARK(in_dev))
|
|
if (mark && !IN_DEV_SRC_VMARK(in_dev))
|
|
- fl.flowi_mark = 0;
|
|
|
|
|
|
+ fl4.flowi4_mark = 0;
|
|
}
|
|
}
|
|
|
|
|
|
if (in_dev == NULL)
|
|
if (in_dev == NULL)
|
|
goto e_inval;
|
|
goto e_inval;
|
|
|
|
|
|
net = dev_net(dev);
|
|
net = dev_net(dev);
|
|
- if (fib_lookup(net, &fl.u.ip4, &res))
|
|
|
|
|
|
+ if (fib_lookup(net, &fl4, &res))
|
|
goto last_resort;
|
|
goto last_resort;
|
|
if (res.type != RTN_UNICAST) {
|
|
if (res.type != RTN_UNICAST) {
|
|
if (res.type != RTN_LOCAL || !accept_local)
|
|
if (res.type != RTN_LOCAL || !accept_local)
|
|
@@ -253,10 +253,10 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
|
|
goto last_resort;
|
|
goto last_resort;
|
|
if (rpf == 1)
|
|
if (rpf == 1)
|
|
goto e_rpf;
|
|
goto e_rpf;
|
|
- fl.flowi_oif = dev->ifindex;
|
|
|
|
|
|
+ fl4.flowi4_oif = dev->ifindex;
|
|
|
|
|
|
ret = 0;
|
|
ret = 0;
|
|
- if (fib_lookup(net, &fl.u.ip4, &res) == 0) {
|
|
|
|
|
|
+ if (fib_lookup(net, &fl4, &res) == 0) {
|
|
if (res.type == RTN_UNICAST) {
|
|
if (res.type == RTN_UNICAST) {
|
|
*spec_dst = FIB_RES_PREFSRC(res);
|
|
*spec_dst = FIB_RES_PREFSRC(res);
|
|
ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
|
|
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)
|
|
{
|
|
{
|
|
|
|
|
|
struct fib_result res;
|
|
struct fib_result res;
|
|
- struct flowi fl = {
|
|
|
|
- .flowi_mark = frn->fl_mark,
|
|
|
|
- .fl4_dst = frn->fl_addr,
|
|
|
|
- .fl4_tos = frn->fl_tos,
|
|
|
|
- .fl4_scope = frn->fl_scope,
|
|
|
|
|
|
+ struct flowi4 fl4 = {
|
|
|
|
+ .flowi4_mark = frn->fl_mark,
|
|
|
|
+ .daddr = frn->fl_addr,
|
|
|
|
+ .flowi4_tos = frn->fl_tos,
|
|
|
|
+ .flowi4_scope = frn->fl_scope,
|
|
};
|
|
};
|
|
|
|
|
|
#ifdef CONFIG_IP_MULTIPLE_TABLES
|
|
#ifdef CONFIG_IP_MULTIPLE_TABLES
|
|
@@ -813,7 +813,7 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb)
|
|
|
|
|
|
frn->tb_id = tb->tb_id;
|
|
frn->tb_id = tb->tb_id;
|
|
rcu_read_lock();
|
|
rcu_read_lock();
|
|
- frn->err = fib_table_lookup(tb, &fl.u.ip4, &res, FIB_LOOKUP_NOREF);
|
|
|
|
|
|
+ frn->err = fib_table_lookup(tb, &fl4, &res, FIB_LOOKUP_NOREF);
|
|
|
|
|
|
if (!frn->err) {
|
|
if (!frn->err) {
|
|
frn->prefixlen = res.prefixlen;
|
|
frn->prefixlen = res.prefixlen;
|