From b3c7e948be07dee00d35415bf7a512ae50cd9a0e Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sun, 8 Mar 2015 00:44:47 +0100 Subject: [PATCH] PPP, removed now useless struct ppp_addrs from ppp_pcb Saved a few bytes of useless copy. --- src/include/netif/ppp/ppp.h | 7 ++----- src/netif/ppp/ppp.c | 3 --- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/include/netif/ppp/ppp.h b/src/include/netif/ppp/ppp.h index 4af716ad..2a1eb72d 100644 --- a/src/include/netif/ppp/ppp.h +++ b/src/include/netif/ppp/ppp.h @@ -289,6 +289,7 @@ typedef struct ppp_settings_s { } ppp_settings; +#if PPP_SERVER struct ppp_addrs { #if PPP_IPV4_SUPPORT ip_addr_t our_ipaddr, his_ipaddr, netmask; @@ -300,6 +301,7 @@ struct ppp_addrs { ip6_addr_t our6_ipaddr, his6_ipaddr; #endif /* PPP_IPV6_SUPPORT */ }; +#endif /* PPP_SERVER */ /* * PPP interface control block. @@ -352,8 +354,6 @@ struct ppp_pcb_s { u32_t last_xmit; /* Time of last transmission. */ - struct ppp_addrs addrs; /* PPP addresses */ - /* auth data */ #if PPP_SERVER char peer_authname[MAXNAMELEN + 1]; /* The name by which the peer authenticated itself to us. */ @@ -537,9 +537,6 @@ err_t ppp_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg); /* Get the PPP netif interface */ #define ppp_netif(ppp) (ppp->netif) -/* Get the PPP addresses */ -#define ppp_addrs(ppp) (&(ppp)->addrs) - /* Set an lwIP-style status-callback for the selected PPP device */ #define ppp_set_netif_statuscallback(ppp, status_cb) \ netif_set_status_callback(ppp->netif, status_cb); diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 92cf4a55..fb04ab79 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -582,9 +582,6 @@ void ppp_clear(ppp_pcb *pcb) { #endif /* PPP_STATS_SUPPORT */ memset(&pcb->phase, 0, sizeof(ppp_pcb) - ( (char*)&((ppp_pcb*)0)->phase - (char*)0 ) ); -#if PPP_IPV4_SUPPORT - ip4_addr_set_u32(&pcb->addrs.netmask, IPADDR_BROADCAST); -#endif /* PPP_IPV4_SUPPORT */ /* * Initialize each protocol.