diff options
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r-- | net/ipv4/fib_frontend.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index c19c1f739fba..1d2cdd43a878 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -158,11 +158,7 @@ static void fib_flush(struct net *net) | |||
158 | struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref) | 158 | struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref) |
159 | { | 159 | { |
160 | struct flowi fl = { | 160 | struct flowi fl = { |
161 | .nl_u = { | 161 | .fl4_dst = addr, |
162 | .ip4_u = { | ||
163 | .daddr = addr | ||
164 | } | ||
165 | }, | ||
166 | }; | 162 | }; |
167 | struct fib_result res = { 0 }; | 163 | struct fib_result res = { 0 }; |
168 | struct net_device *dev = NULL; | 164 | struct net_device *dev = NULL; |
@@ -199,7 +195,7 @@ static inline unsigned __inet_dev_addr_type(struct net *net, | |||
199 | const struct net_device *dev, | 195 | const struct net_device *dev, |
200 | __be32 addr) | 196 | __be32 addr) |
201 | { | 197 | { |
202 | struct flowi fl = { .nl_u = { .ip4_u = { .daddr = addr } } }; | 198 | struct flowi fl = { .fl4_dst = addr }; |
203 | struct fib_result res; | 199 | struct fib_result res; |
204 | unsigned ret = RTN_BROADCAST; | 200 | unsigned ret = RTN_BROADCAST; |
205 | struct fib_table *local_table; | 201 | struct fib_table *local_table; |
@@ -253,13 +249,9 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, | |||
253 | { | 249 | { |
254 | struct in_device *in_dev; | 250 | struct in_device *in_dev; |
255 | struct flowi fl = { | 251 | struct flowi fl = { |
256 | .nl_u = { | 252 | .fl4_dst = src, |
257 | .ip4_u = { | 253 | .fl4_src = dst, |
258 | .daddr = src, | 254 | .fl4_tos = tos, |
259 | .saddr = dst, | ||
260 | .tos = tos | ||
261 | } | ||
262 | }, | ||
263 | .mark = mark, | 255 | .mark = mark, |
264 | .iif = oif | 256 | .iif = oif |
265 | }; | 257 | }; |
@@ -859,13 +851,9 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb) | |||
859 | struct fib_result res; | 851 | struct fib_result res; |
860 | struct flowi fl = { | 852 | struct flowi fl = { |
861 | .mark = frn->fl_mark, | 853 | .mark = frn->fl_mark, |
862 | .nl_u = { | 854 | .fl4_dst = frn->fl_addr, |
863 | .ip4_u = { | 855 | .fl4_tos = frn->fl_tos, |
864 | .daddr = frn->fl_addr, | 856 | .fl4_scope = frn->fl_scope, |
865 | .tos = frn->fl_tos, | ||
866 | .scope = frn->fl_scope | ||
867 | } | ||
868 | } | ||
869 | }; | 857 | }; |
870 | 858 | ||
871 | #ifdef CONFIG_IP_MULTIPLE_TABLES | 859 | #ifdef CONFIG_IP_MULTIPLE_TABLES |
@@ -1005,7 +993,11 @@ static int fib_netdev_event(struct notifier_block *this, unsigned long event, vo | |||
1005 | rt_cache_flush(dev_net(dev), 0); | 993 | rt_cache_flush(dev_net(dev), 0); |
1006 | break; | 994 | break; |
1007 | case NETDEV_UNREGISTER_BATCH: | 995 | case NETDEV_UNREGISTER_BATCH: |
1008 | rt_cache_flush_batch(); | 996 | /* The batch unregister is only called on the first |
997 | * device in the list of devices being unregistered. | ||
998 | * Therefore we should not pass dev_net(dev) in here. | ||
999 | */ | ||
1000 | rt_cache_flush_batch(NULL); | ||
1009 | break; | 1001 | break; |
1010 | } | 1002 | } |
1011 | return NOTIFY_DONE; | 1003 | return NOTIFY_DONE; |