Quantcast

Bug in OpenBSD 5.4 route6d

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug in OpenBSD 5.4 route6d

Asa Yeamans
I was trying to setup ipv6 RIP routing this weekend when I noticed that while routes were being broadcast by my OpenBSD 5.4 routers running route6d, none were accepting any routes from peers. I ran the daemon in debug mode (-d) and noticed that every inbound route-advertisement packet was met with an error message: "IPv6 packet information cannot be retrieved".

Looking into the source pointed to the riprecv function where it is indicating that it was unable to receive any ancilliary data from the kernel as the result of a recvmsg call. Reading the code I found that it is attempting to extract two ancilliary data records (ipv6 pkt info and ipv6 hoplimit) from the message, but is only allocating the space for one (the ipv6 pkt info).

I was able to correct this and get the routing daemon to accept routes by modifying the declaration of cmsgbuf from:
union {
        struct cmsghdr hdr;
        u_char buf[CMSG_SPACE(sizeof(struct in6_pktinfo))];
} cmsgbuf;

To:
union {
        struct cmsghdr hdr;
        u_char buf[CMSG_SPACE(sizeof(struct in6_pktinfo)) + CMSG_SPACE(sizeof(int))];
} cmsgbuf;

So that the hop limit required size is included as well. Unfortunately I am unable to submit a formal diff or patch at this time, but I still wanted to let everyone know about this so that it can be fixed in 5.5.


Asa Yeamans

Loading...