mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-22 08:06:51 +08:00
tcp: eliminate some redundant route lookups
Now that tcp_connect() always determines the outgoing netif with a route lookup, we can compute the effective MSS without doing the same route lookup again. The outgoing netif is already known from one other location that computes the MSS, so we can eliminate a redundant route lookup there too. Reduce some macro clutter as a side effect.
This commit is contained in:
committed by
sg
parent
29ddfd1d71
commit
3d80e51b2a
@@ -459,16 +459,10 @@ err_t tcp_zero_window_probe(struct tcp_pcb *pcb);
|
||||
void tcp_trigger_input_pcb_close(void);
|
||||
|
||||
#if TCP_CALCULATE_EFF_SEND_MSS
|
||||
u16_t tcp_eff_send_mss_impl(u16_t sendmss, const ip_addr_t *dest
|
||||
#if LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING
|
||||
, const ip_addr_t *src
|
||||
#endif /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */
|
||||
);
|
||||
#if LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING
|
||||
#define tcp_eff_send_mss(sendmss, src, dest) tcp_eff_send_mss_impl(sendmss, dest, src)
|
||||
#else /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */
|
||||
#define tcp_eff_send_mss(sendmss, src, dest) tcp_eff_send_mss_impl(sendmss, dest)
|
||||
#endif /* LWIP_IPV6 || LWIP_IPV4_SRC_ROUTING */
|
||||
u16_t tcp_eff_send_mss_netif(u16_t sendmss, struct netif *outif,
|
||||
const ip_addr_t *dest);
|
||||
#define tcp_eff_send_mss(sendmss, src, dest) \
|
||||
tcp_eff_send_mss_netif(sendmss, ip_route(src, dest), dest)
|
||||
#endif /* TCP_CALCULATE_EFF_SEND_MSS */
|
||||
|
||||
#if LWIP_CALLBACK_API
|
||||
|
||||
Reference in New Issue
Block a user