IPv6 routing table implementation

IPv6 routing table implementation

Post by Madhav » Wed, 03 Jul 2002 20:00:09



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

.
.
.
.

Quote:}

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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

IPv6 routing table implementation

Post by Joerg Pommnit » Wed, 03 Jul 2002 21:00:10


 > 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. problem with IPv6 host entry in routing table

Hi,
 I am using FreeBsd4.3 stack. When i am testing the IPv6 interface attachment i
am
getting some problem. When adding the entries for link local and unicast Ipv6
address
into routing table i am getting the netmask as junk.When i had analyzed the flow
i had the
following finding.

1. IPv6 adds its own address as loopback rtentry though the function
 in6_ifinit(from sys/netinet/in6.c)

2.From in6_ifinit the function in6_ifaddloop is getting called.

3. From in6_ifaddloop we are calling the in6_ifloop_rtrequest which in turn
calls rtrequest with mask set to all ones and flags as RTF_UP|RTF_HOST |RTF_LLINFO.

4. Inside the rtrequest function it was checking for RTF_HOST flag and if was
set the netmask was assigned a zero value.

here what ever mask u pass to rtrequest ,it was made zero if RTF_HOST flag was
set
so whats the need to pass a mask of all ones to rtrequest function and set the
flag to RTF_HOST.

secondly i am getting the mask as junk when i type cast the netmask to
sockaddr_in6 structure even
it was made zero. And same thing is getting added into routing table. so when i
display routung table
i am getting junk in netmask. Is this a bug or my misintrepretation?
can u please help me out of these issue as soon as possible.

Thanks and regards,
Mahesh

2. Weird Patch cluster?

3. IPv6 multiple routing tables

4. strange linux install err

5. system problem with not used ipv6 module and routing table , alpha machine kernel 2.2.19

6. Help setting up X

7. Linux kernel routing table implementation

8. apache mod_rewrite + mod_proxy

9. How Do Routing Table Entries Get Added to Routing Table at Bootup?

10. IPv6 and fec0::/64 network route - why did I have to manually add this route?

11. pf: ipv6 route-to (source-based routing)

12. How to set up routing table or gateway tables for ppp?

13. IPv6 implementations for NetBSD