Commit f989d03e authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by David S. Miller

net: rtnetlink: address is mandatory for rtnl_fdb_get

We must have an address to lookup otherwise we'll derefence a null
pointer in the ndo_fdb_get callbacks.

CC: Roopa Prabhu <>
CC: David Ahern <>
Fixes: 5b2f94b2 ("net: rtnetlink: support for fdb get")
Signed-off-by: default avatarNikolay Aleksandrov <>
Acked-by: default avatarRoopa Prabhu <>
Signed-off-by: default avatarDavid S. Miller <>
parent f7d18ef6
......@@ -4104,6 +4104,11 @@ static int rtnl_fdb_get(struct sk_buff *in_skb, struct nlmsghdr *nlh,
if (err < 0)
return err;
if (!addr) {
NL_SET_ERR_MSG(extack, "Missing lookup address for fdb get request");
return -EINVAL;
if (brport_idx) {
dev = __dev_get_by_index(net, brport_idx);
if (!dev) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment