]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commitdiff
[CA-115411] Skip XS_* responses that are not supported in the windows frontend.
authorOwen Smith <owen.smith@citrix.com>
Fri, 27 Sep 2013 08:20:53 +0000 (09:20 +0100)
committerOwen Smith <owen.smith@citrix.com>
Fri, 27 Sep 2013 08:20:53 +0000 (09:20 +0100)
Add a warning displaying the type, but otherwise do nothing with unknown responses.
(v2) Updated whitespace/tabbing and capitalization

Signed-off-by: Owen Smith <owen.smith@citrix.com>
src/xenbus/store.c

index 2e8953edcd270daaf58225dede7b9b92f4882151..bee85894617ea4127b1b168b2e9f5167272c5d88 100644 (file)
@@ -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);