On Thu, Jan 16, 2020 at 02:35:25PM +0100, Mark Kettenis wrote:
> As for your suggestion.  I think it is a bit of a mess.  I wasn't
> entirely sure about the consequences of such a change for ports.
> However, "Stevens" has this as "char ipopt_list[]" which means that it
> was signed on some platforms and unsigned on others.  Interestingly
> enough it has been int8_t since 1.1 in out tree...

The only non-kernel user in our tree is lib/libc/rpc/svc_tcp.c.
There the value is always casted to u_char.  The defines for this
field in netinet/ip.h are numbers also above 127.  So char looks
like a historic mistake to we.  We should fix it.

Who expects fallout with IP options?  We block them in pf per
default.

bluhm

> > Index: netinet/ip_var.h
> > ===================================================================
> > RCS file: /cvs/src/sys/netinet/ip_var.h,v
> > retrieving revision 1.86
> > diff -u -p -r1.86 ip_var.h
> > --- netinet/ip_var.h        8 Dec 2019 11:08:22 -0000       1.86
> > +++ netinet/ip_var.h        16 Jan 2020 09:48:41 -0000
> > @@ -92,7 +92,7 @@ struct    ipstat {
> >
> >  struct ipoption {
> >     struct  in_addr ipopt_dst;      /* first-hop dst if source routed */
> > -   int8_t  ipopt_list[MAX_IPOPTLEN];       /* options proper */
> > +   uint8_t ipopt_list[MAX_IPOPTLEN];       /* options proper */
> >  };
> >
> >  #ifdef _KERNEL
> >
> >

Reply via email to