dn_neigh.c 16 KB

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