def _get_ethernet(pkt):
 ether = pkt
 while ((ether is not None) and (not isinstance(ether, Ether))):
  ether = ether.underlayer
 return ether

def _get_ethernet ( pkt ) : ether = pkt while ( ( ether is not None ) and ( not isinstance ( ether , Ether ) ) ) : ether = ether . underlayer return ether
find the ethernet packet of underlayer or none .