mac80211: Assign next hop address to pending mesh frames
[safe/jmp/linux-2.6] / net / mac80211 / mesh_pathtbl.c
1 /*
2  * Copyright (c) 2008 open80211s Ltd.
3  * Author:     Luis Carlos Cobo <luisca@cozybit.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  */
9
10 #include <linux/etherdevice.h>
11 #include <linux/list.h>
12 #include <linux/random.h>
13 #include <linux/spinlock.h>
14 #include <linux/string.h>
15 #include <net/mac80211.h>
16 #include "ieee80211_i.h"
17 #include "mesh.h"
18
19 /* There will be initially 2^INIT_PATHS_SIZE_ORDER buckets */
20 #define INIT_PATHS_SIZE_ORDER   2
21
22 /* Keep the mean chain length below this constant */
23 #define MEAN_CHAIN_LEN          2
24
25 #define MPATH_EXPIRED(mpath) ((mpath->flags & MESH_PATH_ACTIVE) && \
26                                 time_after(jiffies, mpath->exp_time) && \
27                                 !(mpath->flags & MESH_PATH_FIXED))
28
29 struct mpath_node {
30         struct hlist_node list;
31         struct rcu_head rcu;
32         /* This indirection allows two different tables to point to the same
33          * mesh_path structure, useful when resizing
34          */
35         struct mesh_path *mpath;
36 };
37
38 static struct mesh_table *mesh_paths;
39 static struct mesh_table *mpp_paths; /* Store paths for MPP&MAP */
40
41 /* This lock will have the grow table function as writer and add / delete nodes
42  * as readers. When reading the table (i.e. doing lookups) we are well protected
43  * by RCU
44  */
45 static DEFINE_RWLOCK(pathtbl_resize_lock);
46
47 /**
48  *
49  * mesh_path_assign_nexthop - update mesh path next hop
50  *
51  * @mpath: mesh path to update
52  * @sta: next hop to assign
53  *
54  * Locking: mpath->state_lock must be held when calling this function
55  */
56 void mesh_path_assign_nexthop(struct mesh_path *mpath, struct sta_info *sta)
57 {
58         struct sk_buff *skb;
59         struct ieee80211_hdr *hdr;
60         struct sk_buff_head tmpq;
61         unsigned long flags;
62
63         rcu_assign_pointer(mpath->next_hop, sta);
64
65         __skb_queue_head_init(&tmpq);
66
67         spin_lock_irqsave(&mpath->frame_queue.lock, flags);
68
69         while ((skb = __skb_dequeue(&mpath->frame_queue)) != NULL) {
70                 hdr = (struct ieee80211_hdr *) skb->data;
71                 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN);
72                 __skb_queue_tail(&tmpq, skb);
73         }
74
75         skb_queue_splice(&tmpq, &mpath->frame_queue);
76         spin_unlock_irqrestore(&mpath->frame_queue.lock, flags);
77 }
78
79
80 /**
81  * mesh_path_lookup - look up a path in the mesh path table
82  * @dst: hardware address (ETH_ALEN length) of destination
83  * @sdata: local subif
84  *
85  * Returns: pointer to the mesh path structure, or NULL if not found
86  *
87  * Locking: must be called within a read rcu section.
88  */
89 struct mesh_path *mesh_path_lookup(u8 *dst, struct ieee80211_sub_if_data *sdata)
90 {
91         struct mesh_path *mpath;
92         struct hlist_node *n;
93         struct hlist_head *bucket;
94         struct mesh_table *tbl;
95         struct mpath_node *node;
96
97         tbl = rcu_dereference(mesh_paths);
98
99         bucket = &tbl->hash_buckets[mesh_table_hash(dst, sdata, tbl)];
100         hlist_for_each_entry_rcu(node, n, bucket, list) {
101                 mpath = node->mpath;
102                 if (mpath->sdata == sdata &&
103                                 memcmp(dst, mpath->dst, ETH_ALEN) == 0) {
104                         if (MPATH_EXPIRED(mpath)) {
105                                 spin_lock_bh(&mpath->state_lock);
106                                 if (MPATH_EXPIRED(mpath))
107                                         mpath->flags &= ~MESH_PATH_ACTIVE;
108                                 spin_unlock_bh(&mpath->state_lock);
109                         }
110                         return mpath;
111                 }
112         }
113         return NULL;
114 }
115
116 struct mesh_path *mpp_path_lookup(u8 *dst, struct ieee80211_sub_if_data *sdata)
117 {
118         struct mesh_path *mpath;
119         struct hlist_node *n;
120         struct hlist_head *bucket;
121         struct mesh_table *tbl;
122         struct mpath_node *node;
123
124         tbl = rcu_dereference(mpp_paths);
125
126         bucket = &tbl->hash_buckets[mesh_table_hash(dst, sdata, tbl)];
127         hlist_for_each_entry_rcu(node, n, bucket, list) {
128                 mpath = node->mpath;
129                 if (mpath->sdata == sdata &&
130                     memcmp(dst, mpath->dst, ETH_ALEN) == 0) {
131                         if (MPATH_EXPIRED(mpath)) {
132                                 spin_lock_bh(&mpath->state_lock);
133                                 if (MPATH_EXPIRED(mpath))
134                                         mpath->flags &= ~MESH_PATH_ACTIVE;
135                                 spin_unlock_bh(&mpath->state_lock);
136                         }
137                         return mpath;
138                 }
139         }
140         return NULL;
141 }
142
143
144 /**
145  * mesh_path_lookup_by_idx - look up a path in the mesh path table by its index
146  * @idx: index
147  * @sdata: local subif, or NULL for all entries
148  *
149  * Returns: pointer to the mesh path structure, or NULL if not found.
150  *
151  * Locking: must be called within a read rcu section.
152  */
153 struct mesh_path *mesh_path_lookup_by_idx(int idx, struct ieee80211_sub_if_data *sdata)
154 {
155         struct mpath_node *node;
156         struct hlist_node *p;
157         int i;
158         int j = 0;
159
160         for_each_mesh_entry(mesh_paths, p, node, i) {
161                 if (sdata && node->mpath->sdata != sdata)
162                         continue;
163                 if (j++ == idx) {
164                         if (MPATH_EXPIRED(node->mpath)) {
165                                 spin_lock_bh(&node->mpath->state_lock);
166                                 if (MPATH_EXPIRED(node->mpath))
167                                         node->mpath->flags &= ~MESH_PATH_ACTIVE;
168                                 spin_unlock_bh(&node->mpath->state_lock);
169                         }
170                         return node->mpath;
171                 }
172         }
173
174         return NULL;
175 }
176
177 /**
178  * mesh_path_add - allocate and add a new path to the mesh path table
179  * @addr: destination address of the path (ETH_ALEN length)
180  * @sdata: local subif
181  *
182  * Returns: 0 on sucess
183  *
184  * State: the initial state of the new path is set to 0
185  */
186 int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
187 {
188         struct mesh_path *mpath, *new_mpath;
189         struct mpath_node *node, *new_node;
190         struct hlist_head *bucket;
191         struct hlist_node *n;
192         int grow = 0;
193         int err = 0;
194         u32 hash_idx;
195
196         might_sleep();
197
198         if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
199                 /* never add ourselves as neighbours */
200                 return -ENOTSUPP;
201
202         if (is_multicast_ether_addr(dst))
203                 return -ENOTSUPP;
204
205         if (atomic_add_unless(&sdata->u.mesh.mpaths, 1, MESH_MAX_MPATHS) == 0)
206                 return -ENOSPC;
207
208         err = -ENOMEM;
209         new_mpath = kzalloc(sizeof(struct mesh_path), GFP_KERNEL);
210         if (!new_mpath)
211                 goto err_path_alloc;
212
213         new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL);
214         if (!new_node)
215                 goto err_node_alloc;
216
217         read_lock(&pathtbl_resize_lock);
218         memcpy(new_mpath->dst, dst, ETH_ALEN);
219         new_mpath->sdata = sdata;
220         new_mpath->flags = 0;
221         skb_queue_head_init(&new_mpath->frame_queue);
222         new_node->mpath = new_mpath;
223         new_mpath->timer.data = (unsigned long) new_mpath;
224         new_mpath->timer.function = mesh_path_timer;
225         new_mpath->exp_time = jiffies;
226         spin_lock_init(&new_mpath->state_lock);
227         init_timer(&new_mpath->timer);
228
229         hash_idx = mesh_table_hash(dst, sdata, mesh_paths);
230         bucket = &mesh_paths->hash_buckets[hash_idx];
231
232         spin_lock(&mesh_paths->hashwlock[hash_idx]);
233
234         err = -EEXIST;
235         hlist_for_each_entry(node, n, bucket, list) {
236                 mpath = node->mpath;
237                 if (mpath->sdata == sdata && memcmp(dst, mpath->dst, ETH_ALEN) == 0)
238                         goto err_exists;
239         }
240
241         hlist_add_head_rcu(&new_node->list, bucket);
242         if (atomic_inc_return(&mesh_paths->entries) >=
243                 mesh_paths->mean_chain_len * (mesh_paths->hash_mask + 1))
244                 grow = 1;
245
246         spin_unlock(&mesh_paths->hashwlock[hash_idx]);
247         read_unlock(&pathtbl_resize_lock);
248         if (grow) {
249                 struct mesh_table *oldtbl, *newtbl;
250
251                 write_lock(&pathtbl_resize_lock);
252                 oldtbl = mesh_paths;
253                 newtbl = mesh_table_grow(mesh_paths);
254                 if (!newtbl) {
255                         write_unlock(&pathtbl_resize_lock);
256                         return 0;
257                 }
258                 rcu_assign_pointer(mesh_paths, newtbl);
259                 write_unlock(&pathtbl_resize_lock);
260
261                 synchronize_rcu();
262                 mesh_table_free(oldtbl, false);
263         }
264         return 0;
265
266 err_exists:
267         spin_unlock(&mesh_paths->hashwlock[hash_idx]);
268         read_unlock(&pathtbl_resize_lock);
269         kfree(new_node);
270 err_node_alloc:
271         kfree(new_mpath);
272 err_path_alloc:
273         atomic_dec(&sdata->u.mesh.mpaths);
274         return err;
275 }
276
277
278 int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
279 {
280         struct mesh_path *mpath, *new_mpath;
281         struct mpath_node *node, *new_node;
282         struct hlist_head *bucket;
283         struct hlist_node *n;
284         int grow = 0;
285         int err = 0;
286         u32 hash_idx;
287
288         might_sleep();
289
290         if (memcmp(dst, sdata->dev->dev_addr, ETH_ALEN) == 0)
291                 /* never add ourselves as neighbours */
292                 return -ENOTSUPP;
293
294         if (is_multicast_ether_addr(dst))
295                 return -ENOTSUPP;
296
297         err = -ENOMEM;
298         new_mpath = kzalloc(sizeof(struct mesh_path), GFP_KERNEL);
299         if (!new_mpath)
300                 goto err_path_alloc;
301
302         new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL);
303         if (!new_node)
304                 goto err_node_alloc;
305
306         read_lock(&pathtbl_resize_lock);
307         memcpy(new_mpath->dst, dst, ETH_ALEN);
308         memcpy(new_mpath->mpp, mpp, ETH_ALEN);
309         new_mpath->sdata = sdata;
310         new_mpath->flags = 0;
311         skb_queue_head_init(&new_mpath->frame_queue);
312         new_node->mpath = new_mpath;
313         new_mpath->exp_time = jiffies;
314         spin_lock_init(&new_mpath->state_lock);
315
316         hash_idx = mesh_table_hash(dst, sdata, mpp_paths);
317         bucket = &mpp_paths->hash_buckets[hash_idx];
318
319         spin_lock(&mpp_paths->hashwlock[hash_idx]);
320
321         err = -EEXIST;
322         hlist_for_each_entry(node, n, bucket, list) {
323                 mpath = node->mpath;
324                 if (mpath->sdata == sdata && memcmp(dst, mpath->dst, ETH_ALEN) == 0)
325                         goto err_exists;
326         }
327
328         hlist_add_head_rcu(&new_node->list, bucket);
329         if (atomic_inc_return(&mpp_paths->entries) >=
330                 mpp_paths->mean_chain_len * (mpp_paths->hash_mask + 1))
331                 grow = 1;
332
333         spin_unlock(&mpp_paths->hashwlock[hash_idx]);
334         read_unlock(&pathtbl_resize_lock);
335         if (grow) {
336                 struct mesh_table *oldtbl, *newtbl;
337
338                 write_lock(&pathtbl_resize_lock);
339                 oldtbl = mpp_paths;
340                 newtbl = mesh_table_grow(mpp_paths);
341                 if (!newtbl) {
342                         write_unlock(&pathtbl_resize_lock);
343                         return 0;
344                 }
345                 rcu_assign_pointer(mpp_paths, newtbl);
346                 write_unlock(&pathtbl_resize_lock);
347
348                 synchronize_rcu();
349                 mesh_table_free(oldtbl, false);
350         }
351         return 0;
352
353 err_exists:
354         spin_unlock(&mpp_paths->hashwlock[hash_idx]);
355         read_unlock(&pathtbl_resize_lock);
356         kfree(new_node);
357 err_node_alloc:
358         kfree(new_mpath);
359 err_path_alloc:
360         return err;
361 }
362
363
364 /**
365  * mesh_plink_broken - deactivates paths and sends perr when a link breaks
366  *
367  * @sta: broken peer link
368  *
369  * This function must be called from the rate control algorithm if enough
370  * delivery errors suggest that a peer link is no longer usable.
371  */
372 void mesh_plink_broken(struct sta_info *sta)
373 {
374         struct mesh_path *mpath;
375         struct mpath_node *node;
376         struct hlist_node *p;
377         struct ieee80211_sub_if_data *sdata = sta->sdata;
378         int i;
379
380         rcu_read_lock();
381         for_each_mesh_entry(mesh_paths, p, node, i) {
382                 mpath = node->mpath;
383                 spin_lock_bh(&mpath->state_lock);
384                 if (mpath->next_hop == sta &&
385                     mpath->flags & MESH_PATH_ACTIVE &&
386                     !(mpath->flags & MESH_PATH_FIXED)) {
387                         mpath->flags &= ~MESH_PATH_ACTIVE;
388                         ++mpath->dsn;
389                         spin_unlock_bh(&mpath->state_lock);
390                         mesh_path_error_tx(mpath->dst,
391                                         cpu_to_le32(mpath->dsn),
392                                         sdata->dev->broadcast, sdata);
393                 } else
394                 spin_unlock_bh(&mpath->state_lock);
395         }
396         rcu_read_unlock();
397 }
398
399 /**
400  * mesh_path_flush_by_nexthop - Deletes mesh paths if their next hop matches
401  *
402  * @sta - mesh peer to match
403  *
404  * RCU notes: this function is called when a mesh plink transitions from
405  * PLINK_ESTAB to any other state, since PLINK_ESTAB state is the only one that
406  * allows path creation. This will happen before the sta can be freed (because
407  * sta_info_destroy() calls this) so any reader in a rcu read block will be
408  * protected against the plink disappearing.
409  */
410 void mesh_path_flush_by_nexthop(struct sta_info *sta)
411 {
412         struct mesh_path *mpath;
413         struct mpath_node *node;
414         struct hlist_node *p;
415         int i;
416
417         for_each_mesh_entry(mesh_paths, p, node, i) {
418                 mpath = node->mpath;
419                 if (mpath->next_hop == sta)
420                         mesh_path_del(mpath->dst, mpath->sdata);
421         }
422 }
423
424 void mesh_path_flush(struct ieee80211_sub_if_data *sdata)
425 {
426         struct mesh_path *mpath;
427         struct mpath_node *node;
428         struct hlist_node *p;
429         int i;
430
431         for_each_mesh_entry(mesh_paths, p, node, i) {
432                 mpath = node->mpath;
433                 if (mpath->sdata == sdata)
434                         mesh_path_del(mpath->dst, mpath->sdata);
435         }
436 }
437
438 static void mesh_path_node_reclaim(struct rcu_head *rp)
439 {
440         struct mpath_node *node = container_of(rp, struct mpath_node, rcu);
441         struct ieee80211_sub_if_data *sdata = node->mpath->sdata;
442
443         del_timer_sync(&node->mpath->timer);
444         atomic_dec(&sdata->u.mesh.mpaths);
445         kfree(node->mpath);
446         kfree(node);
447 }
448
449 /**
450  * mesh_path_del - delete a mesh path from the table
451  *
452  * @addr: dst address (ETH_ALEN length)
453  * @sdata: local subif
454  *
455  * Returns: 0 if succesful
456  */
457 int mesh_path_del(u8 *addr, struct ieee80211_sub_if_data *sdata)
458 {
459         struct mesh_path *mpath;
460         struct mpath_node *node;
461         struct hlist_head *bucket;
462         struct hlist_node *n;
463         int hash_idx;
464         int err = 0;
465
466         read_lock(&pathtbl_resize_lock);
467         hash_idx = mesh_table_hash(addr, sdata, mesh_paths);
468         bucket = &mesh_paths->hash_buckets[hash_idx];
469
470         spin_lock(&mesh_paths->hashwlock[hash_idx]);
471         hlist_for_each_entry(node, n, bucket, list) {
472                 mpath = node->mpath;
473                 if (mpath->sdata == sdata &&
474                                 memcmp(addr, mpath->dst, ETH_ALEN) == 0) {
475                         spin_lock_bh(&mpath->state_lock);
476                         mpath->flags |= MESH_PATH_RESOLVING;
477                         hlist_del_rcu(&node->list);
478                         call_rcu(&node->rcu, mesh_path_node_reclaim);
479                         atomic_dec(&mesh_paths->entries);
480                         spin_unlock_bh(&mpath->state_lock);
481                         goto enddel;
482                 }
483         }
484
485         err = -ENXIO;
486 enddel:
487         spin_unlock(&mesh_paths->hashwlock[hash_idx]);
488         read_unlock(&pathtbl_resize_lock);
489         return err;
490 }
491
492 /**
493  * mesh_path_tx_pending - sends pending frames in a mesh path queue
494  *
495  * @mpath: mesh path to activate
496  *
497  * Locking: the state_lock of the mpath structure must NOT be held when calling
498  * this function.
499  */
500 void mesh_path_tx_pending(struct mesh_path *mpath)
501 {
502         struct sk_buff *skb;
503
504         while ((skb = skb_dequeue(&mpath->frame_queue)) &&
505                         (mpath->flags & MESH_PATH_ACTIVE))
506                 dev_queue_xmit(skb);
507 }
508
509 /**
510  * mesh_path_discard_frame - discard a frame whose path could not be resolved
511  *
512  * @skb: frame to discard
513  * @sdata: network subif the frame was to be sent through
514  *
515  * If the frame was being forwarded from another MP, a PERR frame will be sent
516  * to the precursor.  The precursor's address (i.e. the previous hop) was saved
517  * in addr1 of the frame-to-be-forwarded, and would only be overwritten once
518  * the destination is successfully resolved.
519  *
520  * Locking: the function must me called within a rcu_read_lock region
521  */
522 void mesh_path_discard_frame(struct sk_buff *skb,
523                              struct ieee80211_sub_if_data *sdata)
524 {
525         struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
526         struct mesh_path *mpath;
527         u32 dsn = 0;
528
529         if (memcmp(hdr->addr4, sdata->dev->dev_addr, ETH_ALEN) != 0) {
530                 u8 *ra, *da;
531
532                 da = hdr->addr3;
533                 ra = hdr->addr1;
534                 mpath = mesh_path_lookup(da, sdata);
535                 if (mpath)
536                         dsn = ++mpath->dsn;
537                 mesh_path_error_tx(skb->data, cpu_to_le32(dsn), ra, sdata);
538         }
539
540         kfree_skb(skb);
541         sdata->u.mesh.mshstats.dropped_frames_no_route++;
542 }
543
544 /**
545  * mesh_path_flush_pending - free the pending queue of a mesh path
546  *
547  * @mpath: mesh path whose queue has to be freed
548  *
549  * Locking: the function must me called withing a rcu_read_lock region
550  */
551 void mesh_path_flush_pending(struct mesh_path *mpath)
552 {
553         struct sk_buff *skb;
554
555         while ((skb = skb_dequeue(&mpath->frame_queue)) &&
556                         (mpath->flags & MESH_PATH_ACTIVE))
557                 mesh_path_discard_frame(skb, mpath->sdata);
558 }
559
560 /**
561  * mesh_path_fix_nexthop - force a specific next hop for a mesh path
562  *
563  * @mpath: the mesh path to modify
564  * @next_hop: the next hop to force
565  *
566  * Locking: this function must be called holding mpath->state_lock
567  */
568 void mesh_path_fix_nexthop(struct mesh_path *mpath, struct sta_info *next_hop)
569 {
570         spin_lock_bh(&mpath->state_lock);
571         mesh_path_assign_nexthop(mpath, next_hop);
572         mpath->dsn = 0xffff;
573         mpath->metric = 0;
574         mpath->hop_count = 0;
575         mpath->exp_time = 0;
576         mpath->flags |= MESH_PATH_FIXED;
577         mesh_path_activate(mpath);
578         spin_unlock_bh(&mpath->state_lock);
579         mesh_path_tx_pending(mpath);
580 }
581
582 static void mesh_path_node_free(struct hlist_node *p, bool free_leafs)
583 {
584         struct mesh_path *mpath;
585         struct mpath_node *node = hlist_entry(p, struct mpath_node, list);
586         mpath = node->mpath;
587         hlist_del_rcu(p);
588         if (free_leafs)
589                 kfree(mpath);
590         kfree(node);
591 }
592
593 static int mesh_path_node_copy(struct hlist_node *p, struct mesh_table *newtbl)
594 {
595         struct mesh_path *mpath;
596         struct mpath_node *node, *new_node;
597         u32 hash_idx;
598
599         new_node = kmalloc(sizeof(struct mpath_node), GFP_ATOMIC);
600         if (new_node == NULL)
601                 return -ENOMEM;
602
603         node = hlist_entry(p, struct mpath_node, list);
604         mpath = node->mpath;
605         new_node->mpath = mpath;
606         hash_idx = mesh_table_hash(mpath->dst, mpath->sdata, newtbl);
607         hlist_add_head(&new_node->list,
608                         &newtbl->hash_buckets[hash_idx]);
609         return 0;
610 }
611
612 int mesh_pathtbl_init(void)
613 {
614         mesh_paths = mesh_table_alloc(INIT_PATHS_SIZE_ORDER);
615         if (!mesh_paths)
616                 return -ENOMEM;
617         mesh_paths->free_node = &mesh_path_node_free;
618         mesh_paths->copy_node = &mesh_path_node_copy;
619         mesh_paths->mean_chain_len = MEAN_CHAIN_LEN;
620
621         mpp_paths = mesh_table_alloc(INIT_PATHS_SIZE_ORDER);
622         if (!mpp_paths) {
623                 mesh_table_free(mesh_paths, true);
624                 return -ENOMEM;
625         }
626         mpp_paths->free_node = &mesh_path_node_free;
627         mpp_paths->copy_node = &mesh_path_node_copy;
628         mpp_paths->mean_chain_len = MEAN_CHAIN_LEN;
629
630         return 0;
631 }
632
633 void mesh_path_expire(struct ieee80211_sub_if_data *sdata)
634 {
635         struct mesh_path *mpath;
636         struct mpath_node *node;
637         struct hlist_node *p;
638         int i;
639
640         read_lock(&pathtbl_resize_lock);
641         for_each_mesh_entry(mesh_paths, p, node, i) {
642                 if (node->mpath->sdata != sdata)
643                         continue;
644                 mpath = node->mpath;
645                 spin_lock_bh(&mpath->state_lock);
646                 if ((!(mpath->flags & MESH_PATH_RESOLVING)) &&
647                     (!(mpath->flags & MESH_PATH_FIXED)) &&
648                         time_after(jiffies,
649                          mpath->exp_time + MESH_PATH_EXPIRE)) {
650                         spin_unlock_bh(&mpath->state_lock);
651                         mesh_path_del(mpath->dst, mpath->sdata);
652                 } else
653                         spin_unlock_bh(&mpath->state_lock);
654         }
655         read_unlock(&pathtbl_resize_lock);
656 }
657
658 void mesh_pathtbl_unregister(void)
659 {
660         mesh_table_free(mesh_paths, true);
661         mesh_table_free(mpp_paths, true);
662 }