On Tue, Apr 9, 2019 at 7:13 PM David Ahern <dsah...@gmail.com> wrote:
>
> On 4/9/19 5:08 PM, Govindarajulu Varadarajan wrote:
> > On Fri, Apr 5, 2019 at 4:32 PM David Ahern <dsah...@kernel.org> wrote:
> >>
> >> From: David Ahern <dsah...@gmail.com>
> >>
> >> fib_check_nh is currently huge covering multiple uses cases - device only,
> >> device + gateway, and device + gateway with ONLINK. The next patch adds
> >> validation checks for IPv6 which only further complicates it. So, break
> >> fib_check_nh into 2 helpers - one for gateway validation and one for device
> >> only.
> >>
> >> Signed-off-by: David Ahern <dsah...@gmail.com>
> >> Reviewed-by: Ido Schimmel <ido...@mellanox.com>
> >
> > With the latest net-next I am having issue with network traffic.
> > git bisect points to this commit as the first bad commit.
> > (448d7248191706cbbd7761e3bc72c2985c4d38a7 ipv4: Refactor fib_check_nh)
> >
>
> Can you see if this fixes it? whitespace damaged, but fairly simple to
> apply manually:
>
> diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
> index 017273885eee..779d2be2b135 100644
> --- a/net/ipv4/fib_semantics.c
> +++ b/net/ipv4/fib_semantics.c
> @@ -616,8 +616,9 @@ static int fib_get_nhs(struct fib_info *fi, struct
> rtnexthop *rtnh,
>                                 return -EINVAL;
>                         }
>                         if (nla) {
> -                               fib_cfg.fc_gw_family = AF_INET;
>                                 fib_cfg.fc_gw4 = nla_get_in_addr(nla);
> +                               if (fib_cfg.fc_gw4)
> +                                       fib_cfg.fc_gw_family = AF_INET;
>                         } else if (nlav) {
>                                 ret = fib_gw_from_via(&fib_cfg, nlav,
> extack);
>                                 if (ret)
This did not work.

However this worked

@@ -1096,7 +1096,7 @@ static int fib_check_nh(struct fib_config *cfg,
struct fib_nh *nh,
        u32 table = cfg->fc_table;
        int err;

-       if (nh->fib_nh_gw_family == AF_INET)
+       if (nh->fib_nh_gw4)
                err = fib_check_nh_v4_gw(net, nh, table, cfg->fc_scope, extack);
        else if (nh->fib_nh_gw_family == AF_INET6)
                err = fib_check_nh_v6_gw(net, nh, table, extack);

Reply via email to