]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
PPP, MPPE, drop input/output packets if we couldn't find the chosen decompressor...
authorSylvain Rochet <gradator@gradator.net>
Sun, 30 Aug 2015 15:16:20 +0000 (17:16 +0200)
committerSylvain Rochet <gradator@gradator.net>
Sun, 30 Aug 2015 19:09:38 +0000 (21:09 +0200)
Drop input/output packets if we couldn't find a decompressor/compressor,
it can't really happen because we only negotiate what we are able to
compress/decompress, but for the sake of code consistency it makes much
more sense to do so.

src/netif/ppp/ppp.c

index c11bb7b15ca02f26c2f072b72f1f3f946765edcc..b9a75a066614be5980b930a6ba54cc80fdb30e5b 100644 (file)
@@ -530,7 +530,7 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc
       return err;
 #endif /* MPPE_SUPPORT */
     default:
-      break;
+      goto err_rte_drop; /* Cannot really happen, we only negotiate what we are able to do */
     }
   }
 #endif /* CCP_SUPPORT */
@@ -790,7 +790,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
       break;
 #endif /* MPPE_SUPPORT */
     default:
-      break;
+      goto drop; /* Cannot really happen, we only negotiate what we are able to do */
     }
 
     /* Assume no PFC */