mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Network routing: Refuse to perform routing table lookups for the Broadcast IP address. From Brennan Ashton
This commit is contained in:
@@ -49,6 +49,7 @@
|
|||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
#include <nuttx/net/arp.h>
|
#include <nuttx/net/arp.h>
|
||||||
|
|
||||||
|
#include "route/route.h"
|
||||||
#include "arp/arp.h"
|
#include "arp/arp.h"
|
||||||
|
|
||||||
#ifdef CONFIG_NET_ARP
|
#ifdef CONFIG_NET_ARP
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
|
|
||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
|
|
||||||
|
#include "devif/devif.h"
|
||||||
#include "route/route.h"
|
#include "route/route.h"
|
||||||
|
|
||||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE)
|
#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;
|
struct route_match_s match;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* Do not route the special broadcast IP address */
|
||||||
|
|
||||||
|
if (net_ipaddr_cmp(target, g_alloneaddr))
|
||||||
|
{
|
||||||
|
return -ENOENT;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set up the comparison structure */
|
/* Set up the comparison structure */
|
||||||
|
|
||||||
memset(&match, 0, sizeof(struct route_match_s));
|
memset(&match, 0, sizeof(struct route_match_s));
|
||||||
|
|||||||
Reference in New Issue
Block a user