Skip to content

Commit

Permalink
fix router forwarding flag set
Browse files Browse the repository at this point in the history
  • Loading branch information
zwx1995esp committed Nov 15, 2023
1 parent 4a8286a commit 542ba29
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/ipv6/nd6.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,11 @@ nd6_input(struct pbuf *p, struct netif *inp)
}

/* Send back a NA for us. Allocate the reply pbuf. */
#if ESP_LWIP && LWIP_FORCE_ROUTER_FORWARDING
nd6_send_na(inp, &target_address, ND6_FLAG_ROUTER | ND6_FLAG_SOLICITED | ND6_FLAG_OVERRIDE);
#else
nd6_send_na(inp, &target_address, ND6_FLAG_SOLICITED | ND6_FLAG_OVERRIDE);
#endif
}

break; /* ICMP6_TYPE_NS */
Expand Down
8 changes: 8 additions & 0 deletions src/include/lwip/opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2404,6 +2404,14 @@
#define LWIP_IPV6 0
#endif

/**
* when LWIP_FORCE_ROUTER_FORWARDING is enbaled in lwip, the router flag in NA packet will always
* set to 1, otherwise, never set router flag for NA packets.
*/
#if !defined LWIP_FORCE_ROUTER_FORWARDING || defined __DOXYGEN__
#define LWIP_FORCE_ROUTER_FORWARDING 0
#endif

/**
* LWIP_ND6==1: Enable NDP
* when LWIP_IPV6 is enabled in lwIP, NDP timer is enabled by default with a timeout of 1 second.
Expand Down

0 comments on commit 542ba29

Please sign in to comment.