2002-07-02 10:50:19

by Madhavi

[permalink] [raw]
Subject: IPv6 routing table implementation


Hi

While going through the routing table implementation for linux-ipv6, I
found this piece of code.

struct fib6_node * fib6_lookup(struct fib6_node *root, struct in6_addr
*daddr, struct in6_addr *saddr)
{
struct lookup_args args[2];
struct rt6_info *rt = NULL;
struct fib6_node *fn;

args[0].offset = (u8*) &rt->rt6i_dst - (u8*) rt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
args[0].addr = daddr;

#ifdef CONFIG_IPV6_SUBTREES
args[1].offset = (u8*) &rt->rt6i_src - (u8*) rt;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
args[1].addr = saddr;
#endif

.
.
.
.
}

I found out that this code is called from inet6_route_input() which will
always be called on the receiving end for IPv6 packets (ip6_rcv_finish()).

The underlined lines will be creating a kernel panic ALWAYS.

I am using 2.4.16 kernel. I have checked version 2.4.18 also and no
change in this part. Aren't these versions supposed to include a working
IPv6 implementation? Am I missing something?

regards
Madhavi.


2002-07-02 11:55:04

by Joerg

[permalink] [raw]
Subject: RE: IPv6 routing table implementation

> The underlined lines will be creating a kernel panic ALWAYS.

What makes you think so? After all, the pointer is never dereferenced.
This is quite a common C trick (similiar to the offsetof macro).

Regards
Joerg

=====
--
Regards
Joerg


__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Yahoo! pr?sentiert als offizieller Sponsor das Fu?ball-Highlight des
Jahres: - http://www.FIFAworldcup.com