net: Check subnet against the actual ip address in use for nfs
authorJoe Hershberger <joe.hershberger@ni.com>
Wed, 4 Jul 2018 00:22:55 +0000 (19:22 -0500)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 26 Jul 2018 19:08:19 +0000 (14:08 -0500)
The check for sending to the gateway was not using the correct variable
for comparison, so it was reporting that packets are sent to the gateway
when they were not.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
net/nfs.c

index 9a16765ba1574fea6f732652aa9d51ad9cf604c1..7e8af28e9f564b7d6712fc3eedb156da0bd33a4d 100644 (file)
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -896,7 +896,7 @@ void nfs_start(void)
                struct in_addr server_net;
 
                our_net.s_addr = net_ip.s_addr & net_netmask.s_addr;
-               server_net.s_addr = net_server_ip.s_addr & net_netmask.s_addr;
+               server_net.s_addr = nfs_server_ip.s_addr & net_netmask.s_addr;
                if (our_net.s_addr != server_net.s_addr)
                        debug("; sending through gateway %pI4",
                              &net_gateway);