From fa425ff6a74bda2675b3c246388ed523166606ca Mon Sep 17 00:00:00 2001 From: Owen Smith Date: Fri, 27 Sep 2013 09:20:53 +0100 Subject: [PATCH] [CA-115411] Skip XS_* responses that are not supported in the windows frontend. Add a warning displaying the type, but otherwise do nothing with unknown responses. (v2) Updated whitespace/tabbing and capitalization Signed-off-by: Owen Smith --- src/xenbus/store.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/xenbus/store.c b/src/xenbus/store.c index 2e8953e..bee8589 100644 --- a/src/xenbus/store.c +++ b/src/xenbus/store.c @@ -421,6 +421,29 @@ __StoreReceiveSegment( return (Segment->Offset == Segment->Length) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; } +static FORCEINLINE BOOLEAN +__StoreIgnoreHeaderType( + IN ULONG Type + ) +{ + switch (Type) { + case XS_DEBUG: + case XS_GET_PERMS: + case XS_INTRODUCE: + case XS_RELEASE: + case XS_GET_DOMAIN_PATH: + case XS_MKDIR: + case XS_SET_PERMS: + case XS_IS_DOMAIN_INTRODUCED: + case XS_RESUME: + case XS_SET_TARGET: + case XS_RESTRICT: + return TRUE; + default: + return FALSE; + } +} + static FORCEINLINE BOOLEAN __StoreVerifyHeader( struct xsd_sockmsg *Header @@ -439,7 +462,8 @@ __StoreVerifyHeader( Header->type != XS_WRITE && Header->type != XS_RM && Header->type != XS_WATCH_EVENT && - Header->type != XS_ERROR) { + Header->type != XS_ERROR && + !__StoreIgnoreHeaderType(Header->type)) { Error("UNRECOGNIZED TYPE 0x%08x\n", Header->type); Valid = FALSE; } @@ -736,6 +760,12 @@ __StoreProcessResponse( Response = &Context->Response; + if (__StoreIgnoreHeaderType(Response->Header.type)) { + Warning("IGNORING RESPONSE TYPE %08X\n", Response->Header.type); + __StoreResetResponse(Context); + return; + } + if (Response->Header.type == XS_WATCH_EVENT) { __StoreProcessWatchEvent(Context); __StoreResetResponse(Context); -- 2.39.5