+ tcp DHCP failed hook

I have done this, not sure if this would find much support for the mainline tcp.

in FreeRTOS_DHCP.h

typedef enum eDHCP_PHASE
{
    eDHCPPhasePreDiscover,	/* Driver is about to send a DHCP discovery. */
    eDHCPPhasePreRequest,	/* Driver is about to request DHCP an IP address. */
    eDHCPPhaseFailed,//<-- added
#if( ipconfigDHCP_SEND_DISCOVER_AFTER_AUTO_IP != 0 )
    eDHCPPhasePreLLA,		/* Driver is about to try get an LLA address */
#endif /* ipconfigDHCP_SEND_DISCOVER_AFTER_AUTO_IP */
} eDHCPCallbackPhase_t;

in FreeRTOS_DHCP.c

	if( xGivingUp != pdFALSE )
	{
		/* xGivingUp became true either because of a time-out, or because
		xApplicationDHCPHook() returned another value than 'eDHCPContinue',
		meaning that the conversion is canceled from here. */
		#if( ipconfigUSE_DHCP_HOOK != 0 )//<-- Added, line 520 
		eAnswer = xApplicationDHCPHook( eDHCPPhaseFailed, xNetworkAddressing.ulDefaultIPAddress );
		#endif	/* ipconfigUSE_DHCP_HOOK */
		/* Revert to static IP address. */
		taskENTER_CRITICAL();

Yes sure, I think that can be a useful addition.

With a slight modification:

 #if( ipconfigUSE_DHCP_HOOK != 0 )
-    eDHCPCallbackAnswer_t eAnswer;
+    eDHCPCallbackAnswer_t eAnswer = eDHCPContinue;
 #endif	/* ipconfigUSE_DHCP_HOOK */
+    #if( ipconfigUSE_DHCP_HOOK != 0 )
+    {
+        if( eAnswer == eDHCPContinue )
+        {
+            /* Tell the application that DHCP did not succeed. */
+            ( void ) xApplicationDHCPHook( eDHCPPhaseFailed, xNetworkAddressing.ulDefaultIPAddress );
+        }
+        else
+        {
+            /* The application didn't want to continue DHCP processing. */
+        }
+    }
+    #endif	/* ipconfigUSE_DHCP_HOOK */
 
     /* Revert to static IP address. */
     taskENTER_CRITICAL();

Meaning that a eDHCPPhaseFailed will only be thrown in case of a real error: no DHCP servers responded, or socket creation error.
The result of this xApplicationDHCPHook() will be ignored.