From fd53cad208950c2a5500139efa7cbb3be41eddce Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Thu, 30 Apr 2015 00:06:24 +0200 Subject: [PATCH] PPP, sifnpmode() is only useful if on demand is supported, build out if not We don't support PPP on demand, don't build sifnpmode() which is only useful for on demand if on demand is not supported. --- src/include/netif/ppp/ppp_impl.h | 2 ++ src/netif/ppp/ipcp.c | 4 ++++ src/netif/ppp/ipv6cp.c | 4 ++++ src/netif/ppp/ppp.c | 2 ++ 4 files changed, 12 insertions(+) diff --git a/src/include/netif/ppp/ppp_impl.h b/src/include/netif/ppp/ppp_impl.h index 4cb6e79b..7d959dba 100644 --- a/src/include/netif/ppp/ppp_impl.h +++ b/src/include/netif/ppp/ppp_impl.h @@ -462,7 +462,9 @@ int sif6up(ppp_pcb *pcb); int sif6down (ppp_pcb *pcb); #endif /* PPP_IPV6_SUPPORT */ +#if DEMAND_SUPPORT int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode); +#endif /* DEMAND_SUPPORt */ void netif_set_mtu(ppp_pcb *pcb, int mtu); int netif_get_mtu(ppp_pcb *pcb); diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index 1ae343ea..b694c756 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -2050,7 +2050,9 @@ static void ipcp_up(fsm *f) { return; } #endif +#if DEMAND_SUPPORT sifnpmode(pcb, PPP_IP, NPMODE_PASS); +#endif /* DEMAND_SUPPORT */ #if 0 /* UNUSED */ /* assign a default route through the interface if required */ @@ -2147,7 +2149,9 @@ static void ipcp_down(fsm *f) { } else #endif /* DEMAND_SUPPORT */ { +#if DEMAND_SUPPORT sifnpmode(pcb, PPP_IP, NPMODE_DROP); +#endif /* DEMAND_SUPPORT */ sifdown(pcb); ipcp_clear_addrs(pcb, go->ouraddr, ho->hisaddr, 0); diff --git a/src/netif/ppp/ipv6cp.c b/src/netif/ppp/ipv6cp.c index 38805228..ca0b1b57 100644 --- a/src/netif/ppp/ipv6cp.c +++ b/src/netif/ppp/ipv6cp.c @@ -1240,7 +1240,9 @@ static void ipv6cp_up(fsm *f) { ipv6cp_close(f->pcb, "Interface configuration failed"); return; } +#if DEMAND_SUPPORT sifnpmode(f->pcb, PPP_IPV6, NPMODE_PASS); +#endif /* DEMAND_SUPPORT */ ppp_notice("local LL address %s", llv6_ntoa(go->ourid)); ppp_notice("remote LL address %s", llv6_ntoa(ho->hisid)); @@ -1295,7 +1297,9 @@ static void ipv6cp_down(fsm *f) { } else #endif /* DEMAND_SUPPORT */ { +#if DEMAND_SUPPORT sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP); +#endif /* DEMAND_SUPPORT */ ipv6cp_clear_addrs(f->pcb, go->ourid, ho->hisid); diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 5272a76f..9bcaa3a2 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -1265,6 +1265,7 @@ int sif6down(ppp_pcb *pcb) { } #endif /* PPP_IPV6_SUPPORT */ +#if DEMAND_SUPPORT /* * sifnpmode - Set the mode for handling packets for a given NP. */ @@ -1274,6 +1275,7 @@ int sifnpmode(ppp_pcb *pcb, int proto, enum NPmode mode) { LWIP_UNUSED_ARG(mode); return 0; } +#endif /* DEMAND_SUPPORT */ /* * netif_set_mtu - set the MTU on the PPP network interface.