Browse Source

Fix wrong layout of PFChan_Core_SwitchErr which was a legacy from before RouteHeader

Caleb James DeLisle 6 years ago
parent
commit
ec3c312694
2 changed files with 2 additions and 3 deletions
  1. 1 1
      net/ControlHandler.c
  2. 1 2
      wire/PFChan.h

+ 1 - 1
net/ControlHandler.c

@@ -48,8 +48,8 @@ static Iface_DEFUN handleError(struct Message* msg,
         return NULL;
     }
     msg->length = handleError_MIN_SIZE;
+    Message_push(msg, &rh->sh, SwitchHeader_SIZE, NULL);
     Message_push32(msg, 0xffffffff, NULL);
-    Message_push(msg, &rh->sh, sizeof(struct SwitchHeader), NULL);
     Message_push32(msg, PFChan_Core_SWITCH_ERR, NULL);
     return Iface_next(&ch->eventIf, msg);
 }

+ 1 - 2
wire/PFChan.h

@@ -341,14 +341,13 @@ Assert_compileTime(sizeof(struct PFChan_Core_Connect) == PFChan_Core_Connect_SIZ
 struct PFChan_Core_SwitchErr
 {
     struct SwitchHeader sh;
-    uint32_t ffffffff;
     struct Control_Header ctrlHeader;
     struct Control_Error ctrlErr;
     struct SwitchHeader shAtErrorHop;
 };
 #pragma GCC poison PFChan_Core_SwitchErr_SIZE
 #define PFChan_Core_SwitchErr_MIN_SIZE \
-    (SwitchHeader_SIZE + 4 + Control_Header_SIZE + Control_Error_MIN_SIZE + SwitchHeader_SIZE)
+    (SwitchHeader_SIZE + Control_Header_SIZE + Control_Error_MIN_SIZE + SwitchHeader_SIZE)
 Assert_compileTime(sizeof(struct PFChan_Core_SwitchErr) == PFChan_Core_SwitchErr_MIN_SIZE);
 
 struct PFChan_FromCore