Skip to content

Commit c7036d9

Browse files
dsaherndavem330
authored andcommitted
ipv6: Default fib6_type to RTN_UNICAST when not set
A user reported that routes are getting installed with type 0 (RTN_UNSPEC) where before the routes were RTN_UNICAST. One example is from accel-ppp which apparently still uses the ioctl interface and does not set rtmsg_type. Another is the netlink interface where ipv6 does not require rtm_type to be set (v4 does). Prior to the commit in the Fixes tag the ipv6 stack converted type 0 to RTN_UNICAST, so restore that behavior. Fixes: e8478e8 ("net/ipv6: Save route type in rt6_info") Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent bf6de23 commit c7036d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv6/route.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3184,7 +3184,7 @@ static struct fib6_info *ip6_route_info_create(struct fib6_config *cfg,
31843184

31853185
rt->fib6_table = table;
31863186
rt->fib6_metric = cfg->fc_metric;
3187-
rt->fib6_type = cfg->fc_type;
3187+
rt->fib6_type = cfg->fc_type ? : RTN_UNICAST;
31883188
rt->fib6_flags = cfg->fc_flags & ~RTF_GATEWAY;
31893189

31903190
ipv6_addr_prefix(&rt->fib6_dst.addr, &cfg->fc_dst, cfg->fc_dst_len);

0 commit comments

Comments
 (0)