Skip to content
Commit 5add2f72 authored by David Wei's avatar David Wei Committed by David S. Miller
Browse files

netdevsim: fix backwards compatibility in nsim_get_iflink()



The default ndo_get_iflink() implementation returns the current ifindex
of the netdev. But the overridden nsim_get_iflink() returns 0 if the
current nsim is not linked, breaking backwards compatibility for
userspace that depend on this behaviour.

Fix the problem by returning the current ifindex if not linked to a
peer.

Fixes: 8debcf58 ("netdevsim: add ndo_get_iflink() implementation")
Reported-by: default avatarYu Watanabe <watanabe.yu@gmail.com>
Suggested-by: default avatarYu Watanabe <watanabe.yu@gmail.com>
Signed-off-by: default avatarDavid Wei <dw@davidwei.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0579f272
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment