@@ -319,35 +319,39 @@ static BaseType_t xUltrascaleNetworkInterfaceInitialise( NetworkInterface_t * px
319319 /* Initialize the mac and set the MAC address at position 1. */
320320 XEmacPs_SetMacAddress ( pxEMAC_PS , ( void * ) pxEndPoint -> xMACAddress .ucBytes , 1 );
321321
322- #if ( ipconfigUSE_LLMNR == 1 )
322+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_LLMNR ) )
323323 {
324- #if ( ipconfigUSE_IPv6 == 0 )
324+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv4 ) )
325325 {
326326 XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xLLMNR_MacAddress .ucBytes );
327327 }
328- #else
328+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_IPv4 ) */
329+
330+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) )
329331 {
330332 XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xLLMNR_MacAddressIPv6 .ucBytes );
331333 }
332- #endif /* if ( ipconfigUSE_IPv6 == 0 ) */
334+ #endif /* ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) ) */
333335 }
334- #endif /* ipconfigUSE_LLMNR == 1 */
336+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_LLMNR ) ) */
335337
336- #if ( ipconfigUSE_MDNS == 1 )
338+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_MDNS ) )
337339 {
338- #if ( ipconfigUSE_IPv6 == 0 )
340+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv4 ) )
339341 {
340342 XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xMDNS_MacAddress .ucBytes );
341343 }
342- #else
344+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_IPv4 ) */
345+
346+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) )
343347 {
344- XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xMDNS_MACAddressIPv6 .ucBytes );
348+ XEmacPs_SetHash ( pxEMAC_PS , ( void * ) xMDNS_MacAddressIPv6 .ucBytes );
345349 }
346- #endif /* if ( ipconfigUSE_IPv6 == 0 ) */
350+ #endif /* ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) ) */
347351 }
348- #endif /* ( ipconfigUSE_MDNS == 1 ) */
352+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_MDNS) ) */
349353
350- #if ( ipconfigUSE_IPv6 != 0 )
354+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) )
351355 {
352356 /* set the solicited-node multicast address */
353357 for ( NetworkEndPoint_t * pxEndPointIter = FreeRTOS_FirstEndPoint ( pxInterface );
@@ -364,7 +368,7 @@ static BaseType_t xUltrascaleNetworkInterfaceInitialise( NetworkInterface_t * px
364368 }
365369 }
366370 }
367- #endif /* if ( ipconfigUSE_IPv6 == 0 ) */
371+ #endif /* ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) ) */
368372
369373 /* allow reception of multicast addresses programmed into hash (LLMNR or mDNS) */
370374 XEmacPs_SetOptions ( pxEMAC_PS , XEMACPS_MULTICAST_OPTION );
@@ -504,7 +508,7 @@ static BaseType_t xUltrascaleNetworkInterfaceOutput( NetworkInterface_t * pxInte
504508 * the protocol checksum to have a value of zero. */
505509 pxPacket = ( ProtocolPacket_t * ) ( pxBuffer -> pucEthernetBuffer );
506510
507- #if ( ipconfigUSE_IPv6 != 0 )
511+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv6 ) )
508512 ICMPPacket_IPv6_t * pxICMPPacket = ( ICMPPacket_IPv6_t * ) pxBuffer -> pucEthernetBuffer ;
509513
510514 if ( ( pxPacket -> xICMPPacket .xEthernetHeader .usFrameType == ipIPv6_FRAME_TYPE ) &&
@@ -515,16 +519,20 @@ static BaseType_t xUltrascaleNetworkInterfaceOutput( NetworkInterface_t * pxInte
515519 * so for ICMP and other protocols it must be done manually. */
516520 usGenerateProtocolChecksum ( pxBuffer -> pucEthernetBuffer , pxBuffer -> xDataLength , pdTRUE );
517521 }
518- #endif /* ipconfigUSE_IPv6 */
522+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_IPv6 ) ) */
519523
520- if ( ( pxPacket -> xICMPPacket .xEthernetHeader .usFrameType == ipIPv4_FRAME_TYPE ) &&
521- ( pxPacket -> xICMPPacket .xIPHeader .ucProtocol == ipPROTOCOL_ICMP ) )
524+ #if ( ipconfigIS_ENABLED ( ipconfigUSE_IPv4 ) )
522525 {
523- /* The EMAC will calculate the checksum of the IP-header.
524- * It can only calculate protocol checksums of UDP and TCP,
525- * so for ICMP and other protocols it must be done manually. */
526- usGenerateProtocolChecksum ( pxBuffer -> pucEthernetBuffer , pxBuffer -> xDataLength , pdTRUE );
526+ if ( ( pxPacket -> xICMPPacket .xEthernetHeader .usFrameType == ipIPv4_FRAME_TYPE ) &&
527+ ( pxPacket -> xICMPPacket .xIPHeader .ucProtocol == ipPROTOCOL_ICMP ) )
528+ {
529+ /* The EMAC will calculate the checksum of the IP-header.
530+ * It can only calculate protocol checksums of UDP and TCP,
531+ * so for ICMP and other protocols it must be done manually. */
532+ usGenerateProtocolChecksum ( pxBuffer -> pucEthernetBuffer , pxBuffer -> xDataLength , pdTRUE );
533+ }
527534 }
535+ #endif /* ( ipconfigIS_ENABLED( ipconfigUSE_IPv4 ) */
528536 }
529537 #endif /* ipconfigDRIVER_INCLUDED_TX_IP_CHECKSUM */
530538
0 commit comments