On 2015/11/20 11:36, Stuart Henderson wrote:
> Currently pppoe(4) is the only user of sppp(4) and it uses PP_NOFRAMING.
> Do we expect sppp(4) to be used for anything other than pppoe(4) in the
> future? If not, we can simplify things by removing the code to support
> framing.
> 
> Diff also removes some useless ifdefs while there.

Oh some other bits spidered their way in - these chunks shouldn't be there.

> @@ -997,14 +932,15 @@ sppp_cp_send(struct sppp *sp, u_short pr
>                       sppp_print_bytes ((u_char*) (lh+1), len);
>               addlog(">\n");
>       }
> +
> +     len = m->m_pkthdr.len + sp->pp_framebytes;
>       if (mq_enqueue(&sp->pp_cpq, m) != 0) {
> -             ++ifp->if_oerrors;
> -             m = NULL;
> +             ifp->if_oerrors++;
> +             return;
>       }
> -     if (!(ifp->if_flags & IFF_OACTIVE))
> -             (*ifp->if_start) (ifp);
> -     if (m != NULL)
> -             ifp->if_obytes += m->m_pkthdr.len + sp->pp_framebytes;
> +
> +     ifp->if_obytes += len;
> +     if_start(ifp);
>  }

> @@ -4101,14 +4025,15 @@ sppp_auth_send(const struct cp *cp, stru
>                       sppp_print_bytes((u_char*) (lh+1), len);
>               addlog(">\n");
>       }
> +
> +     len = m->m_pkthdr.len + sp->pp_framebytes;
>       if (mq_enqueue(&sp->pp_cpq, m) != 0) {
> -             ++ifp->if_oerrors;
> -             m = NULL;
> +             ifp->if_oerrors++;
> +             return;
>       }
> -     if (! (ifp->if_flags & IFF_OACTIVE))
> -             (*ifp->if_start) (ifp);
> -     if (m != NULL)
> -             ifp->if_obytes += m->m_pkthdr.len + sp->pp_framebytes;
> +
> +     ifp->if_obytes += len;
> +     if_start(ifp);
>  }

I'll send another diff after dlg's bits go in unless someone wants me
to clean it beforehand :)

Reply via email to