<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Evolution Systems &#187; Neighbour</title>
	<atom:link href="http://evolution-systems.co.uk/tag/neighbour/feed/" rel="self" type="application/rss+xml" />
	<link>http://evolution-systems.co.uk</link>
	<description>Web Development, Software Development and Linux Consultancy services</description>
	<lastBuildDate>Fri, 08 Aug 2025 09:18:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Linux Kernel Module And ndisc_get_neigh()</title>
		<link>http://evolution-systems.co.uk/2009/06/16/linux-kernel-module-and-ndisc_get_neigh-2/</link>
		<comments>http://evolution-systems.co.uk/2009/06/16/linux-kernel-module-and-ndisc_get_neigh-2/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 12:25:34 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[KernelNdisc]]></category>
		<category><![CDATA[Neighbour]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/wordpress/?p=482</guid>
		<description><![CDATA[I am currently looking at a way to get the MAC address of the next hop of a packet within a kernel module. I had previously made the silly assumption that this should be relatively simple. Of course that turns out not to be the case. After browsing the kernel source I came across the [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I am currently looking at a way to get the MAC address of the next hop of a packet within a kernel module. I had previously made the silly assumption that this should be relatively simple. Of course that turns out not to be the case.</p>
<p>After browsing the kernel source I came across the following function in net/ndisc.h:</p>
<p><code>static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr)</code><br />
This seemed perfect for what I wanted so I used it and got the following link error:</p>
<p><code>WARNING: "nd_tbl" [/path/to/source/np++.ko] undefined!</code><br />
After a little digging I discovered that the list of neighbours (nd_tbl) stored by the kernel is not exported and therefore modules have no way to access it.</p>
<p>Since then I have tried a number of different approches (doing a rt6_lookup() and trying to obtain the MAC through that etc) but none of them have proved successful. The only glimmer of hope was that the sk_buff pointer I was being passed by the netfilter hook displayed the correct MAC address every now and again by using the skb->dst=>neighbour->ha variable. However most of the time it displays 33:33:00:00:00:01 for some reason.</p>
<p>I am going to continue digging around and see why it is not always being displayed properly through the sk_buff (I&#8217;m guessing this doesn&#8217;t always get properly set for some reason but considering it is 33:33:00:00:00:01 every time this is not a coincidence). If this method yields no results soon howver I think I will be left with the last resort option of having to supply a kernel patch with the NP++ code. This is a real pain as all the kernel patch will do is exprot the nd_tbl struct but it may have to be done.</p>
<p>If anyone knows of a workaround for this without patching the kernel I would love to hear it&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2009/06/16/linux-kernel-module-and-ndisc_get_neigh-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
