]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
dhcp unit test: fixed 2 consts, use udp checksum 0x0000 in handcrafted packets so...
authorgoldsimon <goldsimon@gmx.de>
Sun, 25 Mar 2012 15:18:58 +0000 (17:18 +0200)
committergoldsimon <goldsimon@gmx.de>
Sun, 25 Mar 2012 15:18:58 +0000 (17:18 +0200)
test/unit/dhcp/test_dhcp.c
test/unit/lwipopts.h

index 1be0bdb9f6fba690a1e05973862b8f1354b3ceb5..b42c3daf533d57e9ba57336ad9481239681e69e1 100644 (file)
@@ -10,12 +10,12 @@ static const u8_t broadcast[6] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
 
 static const u8_t magic_cookie[] = { 0x63, 0x82, 0x53, 0x63 };
 
-static const u8_t dhcp_offer[] = {
+static u8_t dhcp_offer[] = {
     0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, // To unit
     0x00, 0x0F, 0xEE, 0x30, 0xAB, 0x22, // From Remote host
     0x08, 0x00, // Protocol: IP
     0x45, 0x10, 0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, 0x36, 0xcc, 0xc3, 0xaa, 0xbd, 0xab, 0xc3, 0xaa, 0xbd, 0xc8, // IP header
-    0x00, 0x43, 0x00, 0x44, 0x01, 0x34, 0x6a, 0xa9, // UDP header
+    0x00, 0x43, 0x00, 0x44, 0x01, 0x34, 0x00, 0x00, // UDP header
 
     0x02, // Type == Boot reply
     0x01, 0x06, // Hw Ethernet, 6 bytes addrlen
@@ -54,12 +54,12 @@ static const u8_t dhcp_offer[] = {
     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Padding
 };
 
-static const u8_t dhcp_ack[] = {
+static u8_t dhcp_ack[] = {
     0x00, 0x23, 0xc1, 0xde, 0xd0, 0x0d, // To unit
     0x00, 0x0f, 0xEE, 0x30, 0xAB, 0x22, // From remote host
     0x08, 0x00, // Proto IP
     0x45, 0x10, 0x01, 0x48, 0x00, 0x00, 0x00, 0x00, 0x80, 0x11, 0x36, 0xcc, 0xc3, 0xaa, 0xbd, 0xab, 0xc3, 0xaa, 0xbd, 0xc8, // IP header
-    0x00, 0x43, 0x00, 0x44, 0x01, 0x34, 0x67, 0xa8, // UDP header
+    0x00, 0x43, 0x00, 0x44, 0x01, 0x34, 0x00, 0x00, // UDP header
     0x02, // Bootp reply
     0x01, 0x06, // Hw type Eth, len 6
     0x00, // 0 hops
@@ -563,7 +563,7 @@ START_TEST(test_dhcp_relayed)
   0x01, 0x38, 0xfd, 0x53, 0x00, 0x00, 0x40, 0x11,
   0x78, 0x46, 0x4f, 0x8a, 0x32, 0x02, 0x4f, 0x8a,
   0x33, 0x05, 0x00, 0x43, 0x00, 0x44, 0x01, 0x24,
-  0x38, 0x72, 0x02, 0x01, 0x06, 0x00, 0x51, 0x35,
+  0x00, 0x00, 0x02, 0x01, 0x06, 0x00, 0x51, 0x35,
   0xb6, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x4f, 0x8a, 0x33, 0x05, 0x00, 0x00,
   0x00, 0x00, 0x0a, 0xb5, 0x04, 0x01, 0x00, 0x23,
@@ -607,7 +607,7 @@ START_TEST(test_dhcp_relayed)
   0x01, 0x38, 0xfd, 0x55, 0x00, 0x00, 0x40, 0x11,
   0x78, 0x44, 0x4f, 0x8a, 0x32, 0x02, 0x4f, 0x8a,
   0x33, 0x05, 0x00, 0x43, 0x00, 0x44, 0x01, 0x24,
-  0x35, 0x71, 0x02, 0x01, 0x06, 0x00, 0x51, 0x35,
+  0x00, 0x00, 0x02, 0x01, 0x06, 0x00, 0x51, 0x35,
   0xb6, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x4f, 0x8a, 0x33, 0x05, 0x00, 0x00,
   0x00, 0x00, 0x0a, 0xb5, 0x04, 0x01, 0x00, 0x23,
@@ -652,7 +652,7 @@ START_TEST(test_dhcp_relayed)
   0x01, 0x38, 0xfa, 0x18, 0x00, 0x00, 0x40, 0x11,
   0x7b, 0x81, 0x4f, 0x8a, 0x32, 0x02, 0x4f, 0x8a,
   0x33, 0x05, 0x00, 0x43, 0x00, 0x44, 0x01, 0x24,
-  0x02, 0x6b, 0x02, 0x01, 0x06, 0x00, 0x49, 0x8b,
+  0x00, 0x00, 0x02, 0x01, 0x06, 0x00, 0x49, 0x8b,
   0x6e, 0xab, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x8a,
   0x33, 0x05, 0x4f, 0x8a, 0x33, 0x05, 0x00, 0x00,
   0x00, 0x00, 0x0a, 0xb5, 0x04, 0x01, 0x00, 0x23,
index f44ccf858f6292f5af3e5df677dcf3cc3babb5a4..00595154b42f926e818dedcbf7aa997d302531a9 100644 (file)
@@ -39,7 +39,6 @@
 
 /* Enable DHCP to test it, disable UDP checksum to easier inject packets */
 #define LWIP_DHCP                       1
-#define CHECKSUM_CHECK_UDP              0
 
 /* Minimal changes to opt.h required for tcp unit tests: */
 #define MEM_SIZE                        16000