lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #42138] pppOverEthernetClose() may meet an error of "i


From: yanyafei
Subject: [lwip-devel] [bug #42138] pppOverEthernetClose() may meet an error of "if statement condition"
Date: Fri, 18 Apr 2014 05:41:15 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36 LBBROWSER

URL:
  <http://savannah.nongnu.org/bugs/?42138>

                 Summary: pppOverEthernetClose() may meet an error of "if
statement condition"
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: yanyafei
            Submitted on: Fri Apr 18 05:41:13 2014
                Category: PPP
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.4.1

    _______________________________________________________

Details:

Hi,I place the doubtful code snippet follwoing:
void
pppOverEthernetClose(int pd)
{
  PPPControl* pc = &pppControl[pd];

  /* *TJL* There's no lcp_deinit */
  lcp_close(pd, NULL);

  pppoe_destroy(&pc->netif);
}

pppoe_destroy(struct netif *ifp)
{
  struct pppoe_softc *sc, *prev = NULL;

  for (sc = pppoe_softc_list; sc != NULL; prev = sc, sc = sc->next) {
    if (sc->sc_ethif == ifp) {
      break;
    }
  }
  if(!(sc && (sc->sc_ethif == ifp))) {
    return ERR_IF;
  }
  ....
  ....
  ....
}

I have some problem about the invocation at "pppoe_destroy(&pc->netif)",you
see this parameter "&pc->netif" which indicates a virtual PPP network device
interface in LwIP, however, in function pppoe_detroy(), a ethernet network
device interface "sc->sc_ethif" compares with a PPP network device interface
at this line of the code " if (sc->sc_ethif == ifp)", so when it beaks the
"for" loop, "sc" will be NULL, and it will return ERR_IF immediately. Finally,
the PPPOE memory never free.





    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?42138>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]