dn_neigh.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /*
  2. * DECnet An implementation of the DECnet protocol suite for the LINUX
  3. * operating system. DECnet is implemented using the BSD Socket
  4. * interface as the means of communication with the user level.
  5. *
  6. * DECnet Neighbour Functions (Adjacency Database and
  7. * On-Ethernet Cache)
  8. *
  9. * Author: Steve Whitehouse <SteveW@ACM.org>
  10. *
  11. *
  12. * Changes:
  13. * Steve Whitehouse : Fixed router listing routine
  14. * Steve Whitehouse : Added error_report functions
  15. * Steve Whitehouse : Added default router detection
  16. * Steve Whitehouse : Hop counts in outgoing messages
  17. * Steve Whitehouse : Fixed src/dst in outgoing messages so
  18. * forwarding now stands a good chance of
  19. * working.
  20. * Steve Whitehouse : Fixed neighbour states (for now anyway).
  21. * Steve Whitehouse : Made error_report functions dummies. This
  22. * is not the right place to return skbs.
  23. * Steve Whitehouse : Convert to seq_file
  24. *
  25. */
  26. #include <linux/config.h>
  27. #include <linux/net.h>
  28. #include <linux/module.h>
  29. #include <linux/socket.h>
  30. #include <linux/if_arp.h>
  31. #include <linux/if_ether.h>
  32. #include <linux/init.h>
  33. #include <linux/proc_fs.h>
  34. #include <linux/string.h>
  35. #include <linux/netfilter_decnet.h>
  36. #include <linux/spinlock.h>
  37. #include <linux/seq_file.h>
  38. #include <linux/rcupdate.h>
  39. #include <linux/jhash.h>
  40. #include <asm/atomic.h>
  41. #include <net/neighbour.h>
  42. #include <net/dst.h>
  43. #include <net/flow.h>
  44. #include <net/dn.h>
  45. #include <net/dn_dev.h>
  46. #include <net/dn_neigh.h>
  47. #include <net/dn_route.h>
  48. static u32 dn_neigh_hash(const void *pkey, const struct net_device *dev);
  49. static int dn_neigh_construct(struct neighbour *);
  50. static void dn_long_error_report(struct neighbour *, struct sk_buff *);
  51. static void dn_short_error_report(struct neighbour *, struct sk_buff *);
  52. static int dn_long_output(struct sk_buff *);
  53. static int dn_short_output(struct sk_buff *);
  54. static int dn_phase3_output(struct sk_buff *);
  55. /*
  56. * For talking to broadcast devices: Ethernet & PPP
  57. */
  58. static struct neigh_ops dn_long_ops = {
  59. .family = AF_DECnet,
  60. .error_report = dn_long_error_report,
  61. .output = dn_long_output,
  62. .connected_output = dn_long_output,
  63. .hh_output = dev_queue_xmit,
  64. .queue_xmit = dev_queue_xmit,
  65. };
  66. /*
  67. * For talking to pointopoint and multidrop devices: DDCMP and X.25
  68. */
  69. static struct neigh_ops dn_short_ops = {
  70. .family = AF_DECnet,
  71. .error_report = dn_short_error_report,
  72. .output = dn_short_output,
  73. .connected_output = dn_short_output,
  74. .hh_output = dev_queue_xmit,
  75. .queue_xmit = dev_queue_xmit,
  76. };
  77. /*
  78. * For talking to DECnet phase III nodes
  79. */
  80. static struct neigh_ops dn_phase3_ops = {
  81. .family = AF_DECnet,
  82. .error_report = dn_short_error_report, /* Can use short version here */
  83. .output = dn_phase3_output,
  84. .connected_output = dn_phase3_output,
  85. .hh_output = dev_queue_xmit,
  86. .queue_xmit = dev_queue_xmit
  87. };
  88. struct neigh_table dn_neigh_table = {
  89. .family = PF_DECnet,
  90. .entry_size = sizeof(struct dn_neigh),
  91. .key_len = sizeof(dn_address),
  92. .hash = dn_neigh_hash,
  93. .constructor = dn_neigh_construct,
  94. .id = "dn_neigh_cache",
  95. .parms ={
  96. .tbl = &dn_neigh_table,
  97. .base_reachable_time = 30 * HZ,
  98. .retrans_time = 1 * HZ,
  99. .gc_staletime = 60 * HZ,
  100. .reachable_time = 30 * HZ,
  101. .delay_probe_time = 5 * HZ,
  102. .queue_len = 3,
  103. .ucast_probes = 0,
  104. .app_probes = 0,
  105. .mcast_probes = 0,
  106. .anycast_delay = 0,
  107. .proxy_delay = 0,
  108. .proxy_qlen = 0,
  109. .locktime = 1 * HZ,
  110. },
  111. .gc_interval = 30 * HZ,
  112. .gc_thresh1 = 128,
  113. .gc_thresh2 = 512,
  114. .gc_thresh3 = 1024,
  115. };
  116. static u32 dn_neigh_hash(const void *pkey, const struct net_device *dev)
  117. {
  118. return jhash_2words(*(dn_address *)pkey, 0, dn_neigh_table.hash_rnd);
  119. }
  120. static int dn_neigh_construct(struct neighbour *neigh)
  121. {
  122. struct net_device *dev = neigh->dev;
  123. struct dn_neigh *dn = (struct dn_neigh *)neigh;
  124. struct dn_dev *dn_db;
  125. struct neigh_parms *parms;
  126. rcu_read_lock();
  127. dn_db = rcu_dereference(dev->dn_ptr);
  128. if (dn_db == NULL) {
  129. rcu_read_unlock();
  130. return -EINVAL;
  131. }
  132. parms = dn_db->neigh_parms;
  133. if (!parms) {
  134. rcu_read_unlock();
  135. return -EINVAL;
  136. }
  137. __neigh_parms_put(neigh->parms);
  138. neigh->parms = neigh_parms_clone(parms);
  139. if (dn_db->use_long)
  140. neigh->ops = &dn_long_ops;
  141. else
  142. neigh->ops = &dn_short_ops;
  143. rcu_read_unlock();
  144. if (dn->flags & DN_NDFLAG_P3)
  145. neigh->ops = &dn_phase3_ops;
  146. neigh->nud_state = NUD_NOARP;
  147. neigh->output = neigh->ops->connected_output;
  148. if ((dev->type == ARPHRD_IPGRE) || (dev->flags & IFF_POINTOPOINT))
  149. memcpy(neigh->ha, dev->broadcast, dev->addr_len);
  150. else if ((dev->type == ARPHRD_ETHER) || (dev->type == ARPHRD_LOOPBACK))
  151. dn_dn2eth(neigh->ha, dn->addr);
  152. else {
  153. if (net_ratelimit())
  154. printk(KERN_DEBUG "Trying to create neigh for hw %d\n", dev->type);
  155. return -EINVAL;
  156. }
  157. /*
  158. * Make an estimate of the remote block size by assuming that its
  159. * two less then the device mtu, which it true for ethernet (and
  160. * other things which support long format headers) since there is
  161. * an extra length field (of 16 bits) which isn't part of the
  162. * ethernet headers and which the DECnet specs won't admit is part
  163. * of the DECnet routing headers either.
  164. *
  165. * If we over estimate here its no big deal, the NSP negotiations
  166. * will prevent us from sending packets which are too large for the
  167. * remote node to handle. In any case this figure is normally updated
  168. * by a hello message in most cases.
  169. */
  170. dn->blksize = dev->mtu - 2;
  171. return 0;
  172. }
  173. static void dn_long_error_report(struct neighbour *neigh, struct sk_buff *skb)
  174. {
  175. printk(KERN_DEBUG "dn_long_error_report: called\n");
  176. kfree_skb(skb);
  177. }
  178. static void dn_short_error_report(struct neighbour *neigh, struct sk_buff *skb)
  179. {
  180. printk(KERN_DEBUG "dn_short_error_report: called\n");
  181. kfree_skb(skb);
  182. }
  183. static int dn_neigh_output_packet(struct sk_buff *skb)
  184. {
  185. struct dst_entry *dst = skb->dst;
  186. struct dn_route *rt = (struct dn_route *)dst;
  187. struct neighbour *neigh = dst->neighbour;
  188. struct net_device *dev = neigh->dev;
  189. char mac_addr[ETH_ALEN];
  190. dn_dn2eth(mac_addr, rt->rt_local_src);
  191. if (!dev->hard_header || dev->hard_header(skb, dev, ntohs(skb->protocol), neigh->ha, mac_addr, skb->len) >= 0)
  192. return neigh->ops->queue_xmit(skb);
  193. if (net_ratelimit())
  194. printk(KERN_DEBUG "dn_neigh_output_packet: oops, can't send packet\n");
  195. kfree_skb(skb);
  196. return -EINVAL;
  197. }
  198. static int dn_long_output(struct sk_buff *skb)
  199. {
  200. struct dst_entry *dst = skb->dst;
  201. struct neighbour *neigh = dst->neighbour;
  202. struct net_device *dev = neigh->dev;
  203. int headroom = dev->hard_header_len + sizeof(struct dn_long_packet) + 3;
  204. unsigned char *data;
  205. struct dn_long_packet *lp;
  206. struct dn_skb_cb *cb = DN_SKB_CB(skb);
  207. if (skb_headroom(skb) < headroom) {
  208. struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
  209. if (skb2 == NULL) {
  210. if (net_ratelimit())
  211. printk(KERN_CRIT "dn_long_output: no memory\n");
  212. kfree_skb(skb);
  213. return -ENOBUFS;
  214. }
  215. kfree_skb(skb);
  216. skb = skb2;
  217. if (net_ratelimit())
  218. printk(KERN_INFO "dn_long_output: Increasing headroom\n");
  219. }
  220. data = skb_push(skb, sizeof(struct dn_long_packet) + 3);
  221. lp = (struct dn_long_packet *)(data+3);
  222. *((unsigned short *)data) = dn_htons(skb->len - 2);
  223. *(data + 2) = 1 | DN_RT_F_PF; /* Padding */
  224. lp->msgflg = DN_RT_PKT_LONG|(cb->rt_flags&(DN_RT_F_IE|DN_RT_F_RQR|DN_RT_F_RTS));
  225. lp->d_area = lp->d_subarea = 0;
  226. dn_dn2eth(lp->d_id, dn_ntohs(cb->dst));
  227. lp->s_area = lp->s_subarea = 0;
  228. dn_dn2eth(lp->s_id, dn_ntohs(cb->src));
  229. lp->nl2 = 0;
  230. lp->visit_ct = cb->hops & 0x3f;
  231. lp->s_class = 0;
  232. lp->pt = 0;
  233. skb->nh.raw = skb->data;
  234. return NF_HOOK(PF_DECnet, NF_DN_POST_ROUTING, skb, NULL, neigh->dev, dn_neigh_output_packet);
  235. }
  236. static int dn_short_output(struct sk_buff *skb)
  237. {
  238. struct dst_entry *dst = skb->dst;
  239. struct neighbour *neigh = dst->neighbour;
  240. struct net_device *dev = neigh->dev;
  241. int headroom = dev->hard_header_len + sizeof(struct dn_short_packet) + 2;
  242. struct dn_short_packet *sp;
  243. unsigned char *data;
  244. struct dn_skb_cb *cb = DN_SKB_CB(skb);
  245. if (skb_headroom(skb) < headroom) {
  246. struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
  247. if (skb2 == NULL) {
  248. if (net_ratelimit())
  249. printk(KERN_CRIT "dn_short_output: no memory\n");
  250. kfree_skb(skb);
  251. return -ENOBUFS;
  252. }
  253. kfree_skb(skb);
  254. skb = skb2;
  255. if (net_ratelimit())
  256. printk(KERN_INFO "dn_short_output: Increasing headroom\n");
  257. }
  258. data = skb_push(skb, sizeof(struct dn_short_packet) + 2);
  259. *((unsigned short *)data) = dn_htons(skb->len - 2);
  260. sp = (struct dn_short_packet *)(data+2);
  261. sp->msgflg = DN_RT_PKT_SHORT|(cb->rt_flags&(DN_RT_F_RQR|DN_RT_F_RTS));
  262. sp->dstnode = cb->dst;
  263. sp->srcnode = cb->src;
  264. sp->forward = cb->hops & 0x3f;
  265. skb->nh.raw = skb->data;
  266. return NF_HOOK(PF_DECnet, NF_DN_POST_ROUTING, skb, NULL, neigh->dev, dn_neigh_output_packet);
  267. }
  268. /*
  269. * Phase 3 output is the same is short output, execpt that
  270. * it clears the area bits before transmission.
  271. */
  272. static int dn_phase3_output(struct sk_buff *skb)
  273. {
  274. struct dst_entry *dst = skb->dst;
  275. struct neighbour *neigh = dst->neighbour;
  276. struct net_device *dev = neigh->dev;
  277. int headroom = dev->hard_header_len + sizeof(struct dn_short_packet) + 2;
  278. struct dn_short_packet *sp;
  279. unsigned char *data;
  280. struct dn_skb_cb *cb = DN_SKB_CB(skb);
  281. if (skb_headroom(skb) < headroom) {
  282. struct sk_buff *skb2 = skb_realloc_headroom(skb, headroom);
  283. if (skb2 == NULL) {
  284. if (net_ratelimit())
  285. printk(KERN_CRIT "dn_phase3_output: no memory\n");
  286. kfree_skb(skb);
  287. return -ENOBUFS;
  288. }
  289. kfree_skb(skb);
  290. skb = skb2;
  291. if (net_ratelimit())
  292. printk(KERN_INFO "dn_phase3_output: Increasing headroom\n");
  293. }
  294. data = skb_push(skb, sizeof(struct dn_short_packet) + 2);
  295. *((unsigned short *)data) = dn_htons(skb->len - 2);
  296. sp = (struct dn_short_packet *)(data + 2);
  297. sp->msgflg = DN_RT_PKT_SHORT|(cb->rt_flags&(DN_RT_F_RQR|DN_RT_F_RTS));
  298. sp->dstnode = cb->dst & dn_htons(0x03ff);
  299. sp->srcnode = cb->src & dn_htons(0x03ff);
  300. sp->forward = cb->hops & 0x3f;
  301. skb->nh.raw = skb->data;
  302. return NF_HOOK(PF_DECnet, NF_DN_POST_ROUTING, skb, NULL, neigh->dev, dn_neigh_output_packet);
  303. }
  304. /*
  305. * Unfortunately, the neighbour code uses the device in its hash
  306. * function, so we don't get any advantage from it. This function
  307. * basically does a neigh_lookup(), but without comparing the device
  308. * field. This is required for the On-Ethernet cache
  309. */
  310. /*
  311. * Pointopoint link receives a hello message
  312. */
  313. void dn_neigh_pointopoint_hello(struct sk_buff *skb)
  314. {
  315. kfree_skb(skb);
  316. }
  317. /*
  318. * Ethernet router hello message received
  319. */
  320. int dn_neigh_router_hello(struct sk_buff *skb)
  321. {
  322. struct rtnode_hello_message *msg = (struct rtnode_hello_message *)skb->data;
  323. struct neighbour *neigh;
  324. struct dn_neigh *dn;
  325. struct dn_dev *dn_db;
  326. dn_address src;
  327. src = dn_htons(dn_eth2dn(msg->id));
  328. neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1);
  329. dn = (struct dn_neigh *)neigh;
  330. if (neigh) {
  331. write_lock(&neigh->lock);
  332. neigh->used = jiffies;
  333. dn_db = (struct dn_dev *)neigh->dev->dn_ptr;
  334. if (!(neigh->nud_state & NUD_PERMANENT)) {
  335. neigh->updated = jiffies;
  336. if (neigh->dev->type == ARPHRD_ETHER)
  337. memcpy(neigh->ha, &eth_hdr(skb)->h_source, ETH_ALEN);
  338. dn->blksize = dn_ntohs(msg->blksize);
  339. dn->priority = msg->priority;
  340. dn->flags &= ~DN_NDFLAG_P3;
  341. switch(msg->iinfo & DN_RT_INFO_TYPE) {
  342. case DN_RT_INFO_L1RT:
  343. dn->flags &=~DN_NDFLAG_R2;
  344. dn->flags |= DN_NDFLAG_R1;
  345. break;
  346. case DN_RT_INFO_L2RT:
  347. dn->flags |= DN_NDFLAG_R2;
  348. }
  349. }
  350. if (!dn_db->router) {
  351. dn_db->router = neigh_clone(neigh);
  352. } else {
  353. if (msg->priority > ((struct dn_neigh *)dn_db->router)->priority)
  354. neigh_release(xchg(&dn_db->router, neigh_clone(neigh)));
  355. }
  356. write_unlock(&neigh->lock);
  357. neigh_release(neigh);
  358. }
  359. kfree_skb(skb);
  360. return 0;
  361. }
  362. /*
  363. * Endnode hello message received
  364. */
  365. int dn_neigh_endnode_hello(struct sk_buff *skb)
  366. {
  367. struct endnode_hello_message *msg = (struct endnode_hello_message *)skb->data;
  368. struct neighbour *neigh;
  369. struct dn_neigh *dn;
  370. dn_address src;
  371. src = dn_htons(dn_eth2dn(msg->id));
  372. neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1);
  373. dn = (struct dn_neigh *)neigh;
  374. if (neigh) {
  375. write_lock(&neigh->lock);
  376. neigh->used = jiffies;
  377. if (!(neigh->nud_state & NUD_PERMANENT)) {
  378. neigh->updated = jiffies;
  379. if (neigh->dev->type == ARPHRD_ETHER)
  380. memcpy(neigh->ha, &eth_hdr(skb)->h_source, ETH_ALEN);
  381. dn->flags &= ~(DN_NDFLAG_R1 | DN_NDFLAG_R2);
  382. dn->blksize = dn_ntohs(msg->blksize);
  383. dn->priority = 0;
  384. }
  385. write_unlock(&neigh->lock);
  386. neigh_release(neigh);
  387. }
  388. kfree_skb(skb);
  389. return 0;
  390. }
  391. static char *dn_find_slot(char *base, int max, int priority)
  392. {
  393. int i;
  394. unsigned char *min = NULL;
  395. base += 6; /* skip first id */
  396. for(i = 0; i < max; i++) {
  397. if (!min || (*base < *min))
  398. min = base;
  399. base += 7; /* find next priority */
  400. }
  401. if (!min)
  402. return NULL;
  403. return (*min < priority) ? (min - 6) : NULL;
  404. }
  405. struct elist_cb_state {
  406. struct net_device *dev;
  407. unsigned char *ptr;
  408. unsigned char *rs;
  409. int t, n;
  410. };
  411. static void neigh_elist_cb(struct neighbour *neigh, void *_info)
  412. {
  413. struct elist_cb_state *s = _info;
  414. struct dn_dev *dn_db;
  415. struct dn_neigh *dn;
  416. if (neigh->dev != s->dev)
  417. return;
  418. dn = (struct dn_neigh *) neigh;
  419. if (!(dn->flags & (DN_NDFLAG_R1|DN_NDFLAG_R2)))
  420. return;
  421. dn_db = (struct dn_dev *) s->dev->dn_ptr;
  422. if (dn_db->parms.forwarding == 1 && (dn->flags & DN_NDFLAG_R2))
  423. return;
  424. if (s->t == s->n)
  425. s->rs = dn_find_slot(s->ptr, s->n, dn->priority);
  426. else
  427. s->t++;
  428. if (s->rs == NULL)
  429. return;
  430. dn_dn2eth(s->rs, dn->addr);
  431. s->rs += 6;
  432. *(s->rs) = neigh->nud_state & NUD_CONNECTED ? 0x80 : 0x0;
  433. *(s->rs) |= dn->priority;
  434. s->rs++;
  435. }
  436. int dn_neigh_elist(struct net_device *dev, unsigned char *ptr, int n)
  437. {
  438. struct elist_cb_state state;
  439. state.dev = dev;
  440. state.t = 0;
  441. state.n = n;
  442. state.ptr = ptr;
  443. state.rs = ptr;
  444. neigh_for_each(&dn_neigh_table, neigh_elist_cb, &state);
  445. return state.t;
  446. }
  447. #ifdef CONFIG_PROC_FS
  448. static inline void dn_neigh_format_entry(struct seq_file *seq,
  449. struct neighbour *n)
  450. {
  451. struct dn_neigh *dn = (struct dn_neigh *) n;
  452. char buf[DN_ASCBUF_LEN];
  453. read_lock(&n->lock);
  454. seq_printf(seq, "%-7s %s%s%s %02x %02d %07ld %-8s\n",
  455. dn_addr2asc(dn_ntohs(dn->addr), buf),
  456. (dn->flags&DN_NDFLAG_R1) ? "1" : "-",
  457. (dn->flags&DN_NDFLAG_R2) ? "2" : "-",
  458. (dn->flags&DN_NDFLAG_P3) ? "3" : "-",
  459. dn->n.nud_state,
  460. atomic_read(&dn->n.refcnt),
  461. dn->blksize,
  462. (dn->n.dev) ? dn->n.dev->name : "?");
  463. read_unlock(&n->lock);
  464. }
  465. static int dn_neigh_seq_show(struct seq_file *seq, void *v)
  466. {
  467. if (v == SEQ_START_TOKEN) {
  468. seq_puts(seq, "Addr Flags State Use Blksize Dev\n");
  469. } else {
  470. dn_neigh_format_entry(seq, v);
  471. }
  472. return 0;
  473. }
  474. static void *dn_neigh_seq_start(struct seq_file *seq, loff_t *pos)
  475. {
  476. return neigh_seq_start(seq, pos, &dn_neigh_table,
  477. NEIGH_SEQ_NEIGH_ONLY);
  478. }
  479. static struct seq_operations dn_neigh_seq_ops = {
  480. .start = dn_neigh_seq_start,
  481. .next = neigh_seq_next,
  482. .stop = neigh_seq_stop,
  483. .show = dn_neigh_seq_show,
  484. };
  485. static int dn_neigh_seq_open(struct inode *inode, struct file *file)
  486. {
  487. struct seq_file *seq;
  488. int rc = -ENOMEM;
  489. struct neigh_seq_state *s = kmalloc(sizeof(*s), GFP_KERNEL);
  490. if (!s)
  491. goto out;
  492. memset(s, 0, sizeof(*s));
  493. rc = seq_open(file, &dn_neigh_seq_ops);
  494. if (rc)
  495. goto out_kfree;
  496. seq = file->private_data;
  497. seq->private = s;
  498. memset(s, 0, sizeof(*s));
  499. out:
  500. return rc;
  501. out_kfree:
  502. kfree(s);
  503. goto out;
  504. }
  505. static struct file_operations dn_neigh_seq_fops = {
  506. .owner = THIS_MODULE,
  507. .open = dn_neigh_seq_open,
  508. .read = seq_read,
  509. .llseek = seq_lseek,
  510. .release = seq_release_private,
  511. };
  512. #endif
  513. void __init dn_neigh_init(void)
  514. {
  515. neigh_table_init(&dn_neigh_table);
  516. proc_net_fops_create("decnet_neigh", S_IRUGO, &dn_neigh_seq_fops);
  517. }
  518. void __exit dn_neigh_cleanup(void)
  519. {
  520. proc_net_remove("decnet_neigh");
  521. neigh_table_clear(&dn_neigh_table);
  522. }