diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 4af4f3039d4c..abcc8515ddd2 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -488,6 +488,12 @@ static int netcons_netpoll_setup(struct netconsole_target *nt) return -EDESTADDRREQ; } + if (nt->local_ip.family != AF_UNSPEC && + nt->local_ip.family != nt->remote_ip.family) { + np_err(np, "local and remote IP address families differ, aborting\n"); + return -EINVAL; + } + rtnl_lock(); if (np->dev_name[0]) ndev = __dev_get_by_name(net, np->dev_name);