On Fri, Mar 03, 2017 at 08:59:55AM +0100, Martin Pieuchot wrote:
> I need to refactor this spaghetti code to avoid multiple gotos.  So
> let's move the guts of route_output() to a function that will need
> the NET_LOCK().

s/rtm_ouput/rtm_output/g

> @@ -536,18 +538,13 @@ route_output(struct mbuf *m, ...)
...
>       va_list                  ap;
>       u_int                    tableid;
> -     u_int8_t                 prio;
>       u_char                   vers, type;
> +     u_int8_t                 prio;

needless change

> @@ -690,21 +687,82 @@ route_output(struct mbuf *m, ...)
...
> +
> +     rtfree(rt);
> +     if (rtm == NULL) {
> +             error = ENOBUFS;
> +             goto fail;

I have removed this check in my M_WAITOK diff.  Be carefull when
merging.

> @@ -868,7 +926,7 @@ change:
>                               }
>                               if (rt->rt_llinfo == NULL) {
>                                       error = ENOMEM;
> -                                     goto flush;
> +                                     break;
>                               }

This will also create a merge conflict.

OK bluhm@

Reply via email to