Network routing: Refuse to perform routing table lookups for the Broadcast IP address. From Brennan Ashton
This commit is contained in:
parent
d2a323ca19
commit
43d036f587
|
@ -49,6 +49,7 @@
|
|||
#include <nuttx/net/netdev.h>
|
||||
#include <nuttx/net/arp.h>
|
||||
|
||||
#include "route/route.h"
|
||||
#include "arp/arp.h"
|
||||
|
||||
#ifdef CONFIG_NET_ARP
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
#include <nuttx/net/ip.h>
|
||||
|
||||
#include "devif/devif.h"
|
||||
#include "route/route.h"
|
||||
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
|
||||
|
@ -131,6 +132,13 @@ int net_router(net_ipaddr_t target, FAR net_ipaddr_t *router)
|
|||
struct route_match_s match;
|
||||
int ret;
|
||||
|
||||
/* Do not route the special broadcast IP address */
|
||||
|
||||
if (net_ipaddr_cmp(target, g_alloneaddr))
|
||||
{
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
/* Set up the comparison structure */
|
||||
|
||||
memset(&match, 0, sizeof(struct route_match_s));
|
||||
|
|
Loading…
Reference in New Issue