Re: [PATCH] Fix marshallers for SpiceMsgPortInit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > 
> > Protocol states that name is an array of bytes but the marshallers are
> > considering it a pointer to an array of bytes. A client that does not
> > use demarshallers from spice-common will find an incorrect
> > implementation of spice-server SpiceMsgPortInit.
> > 
> > Reported-by: Oliver Gutierrez <ogutierrez@xxxxxxxxxx>
> > Signed-off-by: Pavel Grunt <pgrunt@xxxxxxxxxx>
> > Signed-off-by: Victor Toso <victortoso@xxxxxxxxxx>
> > ---
> >  spice.proto | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/spice.proto b/spice.proto
> > index 0bfc515..08d7152 100644
> > --- a/spice.proto
> > +++ b/spice.proto
> > @@ -1412,7 +1412,7 @@ channel PortChannel : SpicevmcChannel {
> >   server:
> >      message {
> >  	uint32 name_size;
> > -	uint8 *name[name_size] @zero_terminated @marshall @nonnull;
> > +	uint8 name[name_size] @zero_terminated @marshall @nonnull;
> >  	uint8 opened;
> >      } init = 201;
> >      message {
> 
> We had some discussion on IRC.
> 
> Basically this message is changing the protocol format which obviously
> breaks compatibility.
> The "uint8 *name[name_size]" in the protocol means that there is a 4 byte
> offset that points to a "uint8 name[name_size]", the message could be
> something like
> - name_size (4 bytes)
> - offset of name (4 bytes)
> - opened (1 bytes)
> - name (name_size bytes)
> 
> Yes, it's complicated and using just a normal array would avoid the 4
> bytes.
> 

I would add:

We REALLY need documentation for the protocol to avoid future
unwanted sub optimal protocol.

Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]