On 11/04/06, Henning Brauer <[EMAIL PROTECTED]> wrote:
>
> I did find a bug. Not certain wethe rthis is what affects you.
> We look at fields from rt_msghdr that the RTM_IFINFO messages do not
> have - they use if_msghdr instead. We do abort on rtm->rtm_errno != 0,
> but if_msghdr has no errno, so we look at something in the data part
> instead. Surprising that this didn't bite us before!
> So we must only do these checks for RTM_ADD/CHANGE/DELETE that actually
> use rt_msghdr.
> ospfd has teh same issue.
>
> Index: kroute.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/bgpd/kroute.c,v
> retrieving revision 1.145
> diff -u -p -r1.145 kroute.c
> --- kroute.c    22 Mar 2006 13:30:35 -0000      1.145
> +++ kroute.c    11 Apr 2006 11:07:27 -0000
> @@ -2123,21 +2123,23 @@ dispatch_rtmsg(void)
>        lim = buf + n;
>        for (next = buf; next < lim; next += rtm->rtm_msglen) {
>                rtm = (struct rt_msghdr *)next;
> -               sa = (struct sockaddr *)(rtm + 1);
> -               get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
> -
> -               if (rtm->rtm_pid == kr_state.pid)       /* cause by us */
> -                       continue;
> -
> -               if (rtm->rtm_errno)                     /* failed
> attempts... */
> -                       continue;
>
>                switch (rtm->rtm_type) {
>                case RTM_ADD:
>                case RTM_CHANGE:
>                case RTM_DELETE:
> +                       sa = (struct sockaddr *)(rtm + 1);
> +                       get_rtaddrs(rtm->rtm_addrs, sa, rti_info);
> +
> +                       if (rtm->rtm_pid == kr_state.pid)       /* cause
> by us */
> +                               continue;
> +
> +                       if (rtm->rtm_errno)                     /* failed
> attempts... */
> +                               continue;
> +
>                        if (rtm->rtm_flags & RTF_LLINFO)        /* arp
> cache */
>                                continue;
> +
>                        if (dispatch_rtmsg_addr(rtm, rti_info) == -1)
>                                return (-1);
>                        break;
>
>
> --
> BS Web Services, http://www.bsws.de/
> OpenBSD-based Webhosting, Mail Services, Managed Servers, ...
> Unix is very simple, but it takes a genius to understand the simplicity.
> (Dennis Ritchie)
>
>

I'll apply it tonight and see what it does in my environment.
Oh how productive one can be when the family is out of the country =)

--
Tony Sarendal - [EMAIL PROTECTED]
IP/Unix
       -= The scorpion replied,
               "I couldn't help it, it's my nature" =-

Reply via email to