Browse Source

ppp: fix compiling with CCP_SUPPORT=1 but MPPE_SUPPORT=0

Even if that might not make much sense, it still shouldn't
result in compiler warnings.

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
Simon Goldschmidt 5 years ago
parent
commit
6e7ea92d56
2 changed files with 10 additions and 0 deletions
  1. 6 0
      src/netif/ppp/ccp.c
  2. 4 0
      src/netif/ppp/ppp.c

+ 6 - 0
src/netif/ppp/ccp.c

@@ -246,6 +246,7 @@ static const fsm_callbacks ccp_callbacks = {
  * Do we want / did we get any compression?
  */
 static int ccp_anycompress(ccp_options *opt) {
+    LWIP_UNUSED_ARG(opt);
     return (0
 #if DEFLATE_SUPPORT
 	|| (opt)->deflate
@@ -743,6 +744,7 @@ static void ccp_resetci(fsm *f) {
 static int ccp_cilen(fsm *f) {
     ppp_pcb *pcb = f->pcb;
     ccp_options *go = &pcb->ccp_gotoptions;
+    LWIP_UNUSED_ARG(go);
 
     return 0
 #if BSDCOMPRESS_SUPPORT
@@ -838,6 +840,8 @@ static int ccp_ackci(fsm *f, u_char *p, int len) {
 #if BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT
     u_char *p0 = p;
 #endif /* BSDCOMPRESS_SUPPORT || PREDICTOR_SUPPORT */
+    LWIP_UNUSED_ARG(p);
+    LWIP_UNUSED_ARG(go);
 
 #if MPPE_SUPPORT
     if (go->mppe) {
@@ -1022,6 +1026,7 @@ static int ccp_rejci(fsm *f, u_char *p, int len) {
     ppp_pcb *pcb = f->pcb;
     ccp_options *go = &pcb->ccp_gotoptions;
     ccp_options try_;		/* options to request next time */
+    LWIP_UNUSED_ARG(p);
 
     try_ = *go;
 
@@ -1117,6 +1122,7 @@ static int ccp_reqci(fsm *f, u_char *p, int *lenp, int dont_nak) {
     u8_t rej_for_ci_mppe = 1;	/* Are we rejecting based on a bad/missing */
 				/* CI_MPPE, or due to other options?       */
 #endif /* MPPE_SUPPORT */
+    LWIP_UNUSED_ARG(ao);
 
     ret = CONFACK;
     retp = p0 = p;

+ 4 - 0
src/netif/ppp/ppp.c

@@ -840,7 +840,9 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
 #endif /* MPPE_SUPPORT */
 
   if (protocol == PPP_COMP) {
+#if MPPE_SUPPORT
     u8_t *pl;
+#endif
 
     switch (pcb->ccp_receive_method) {
 #if MPPE_SUPPORT
@@ -855,6 +857,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
       goto drop; /* Cannot really happen, we only negotiate what we are able to do */
     }
 
+#if MPPE_SUPPORT
     /* Assume no PFC */
     if (pb->len < 2) {
       goto drop;
@@ -869,6 +872,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
       protocol = (pl[0] << 8) | pl[1];
       pbuf_remove_header(pb, 2);
     }
+#endif /* MPPE_SUPPORT */
   }
 #endif /* CCP_SUPPORT */