lkml.org 
[lkml]   [2020]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 016/142] nexthop: Fix attribute checking for groups
    Date
    From: David Ahern <dsahern@gmail.com>

    [ Upstream commit 84be69b869a5a496a6cfde9b3c29509207a1f1fa ]

    For nexthop groups, attributes after NHA_GROUP_TYPE are invalid, but
    nh_check_attr_group starts checking at NHA_GROUP. The group type defaults
    to multipath and the NHA_GROUP_TYPE is currently optional so this has
    slipped through so far. Fix the attribute checking to handle support of
    new group types.

    Fixes: 430a049190de ("nexthop: Add support for nexthop groups")
    Signed-off-by: ASSOGBA Emery <assogba.emery@gmail.com>
    Signed-off-by: David Ahern <dsahern@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    net/ipv4/nexthop.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/net/ipv4/nexthop.c
    +++ b/net/ipv4/nexthop.c
    @@ -435,7 +435,7 @@ static int nh_check_attr_group(struct ne
    if (!valid_group_nh(nh, len, extack))
    return -EINVAL;
    }
    - for (i = NHA_GROUP + 1; i < __NHA_MAX; ++i) {
    + for (i = NHA_GROUP_TYPE + 1; i < __NHA_MAX; ++i) {
    if (!tb[i])
    continue;


    \
     
     \ /
      Last update: 2020-06-01 20:08    [W:4.068 / U:0.308 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site