Hangbin Liu c0a47e44c0 geneve: should not call rt6_lookup() when ipv6 was disabled
When we add a new GENEVE device with IPv6 remote, checking only for
IS_ENABLED(CONFIG_IPV6) is not enough as we may disable IPv6 in the
kernel command line (ipv6.disable=1), and calling rt6_lookup() would
cause a NULL pointer dereference.

v2:
- don't mix declarations and code (reported by Stefano Brivio, Eric Dumazet)
- there's no need to use in6_dev_get() as we only need to check that
  idev exists (reported by David Ahern). This is under RTNL, so we can
  simply use __in6_dev_get() instead (Stefano, Eric).

Reported-by: Jianlin Shi <jishi@redhat.com>
Fixes: c40e89fd358e9 ("geneve: configure MTU based on a lower device")
Cc: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-02-07 10:48:42 -08:00
..
2019-01-26 15:03:43 -08:00
2019-01-19 07:17:19 +12:00
2019-01-20 09:12:50 +12:00
2018-12-31 17:32:35 -08:00
2018-12-29 08:20:44 -07:00
2019-01-25 13:03:34 -10:00
2018-12-27 10:43:24 -08:00
2019-01-05 11:28:39 -08:00
2019-01-09 19:20:31 -05:00
2019-01-11 00:15:04 +01:00
2019-01-15 06:24:36 +12:00
2019-01-18 17:17:20 +12:00
2019-01-22 07:27:17 +13:00
2019-01-18 23:32:29 +01:00
2019-01-05 11:30:37 -08:00
2018-12-28 16:52:18 -08:00
2019-01-15 06:24:36 +12:00
2019-01-25 13:03:34 -10:00
2019-01-25 13:07:03 -10:00
2019-01-26 12:42:41 -08:00
2019-01-19 07:26:16 +12:00
2019-01-05 11:23:17 -08:00
2019-01-25 12:57:09 -10:00
2018-12-29 13:03:29 -08:00
2018-12-24 12:06:56 +01:00
2019-01-01 13:24:31 -08:00
2019-01-26 15:03:43 -08:00
2019-01-22 20:54:00 -05:00
2018-12-31 13:06:30 -08:00
2018-12-28 20:54:57 -08:00
2019-01-18 12:58:20 +01:00
2019-01-28 22:53:09 -08:00
2019-01-25 12:58:40 -10:00
2018-12-29 13:40:29 -08:00