diff --git a/CHANGES b/CHANGES index 0337918484..5cd77bf1a8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,14 @@ +2.0-723 | 2012-07-02 15:02:56 -0700 + + * Extract ICMPv6 NDP options and include in ICMP events. This adds + a new parameter of type "icmp6_nd_options" to the ICMPv6 neighbor + discovery events. Addresses #833. (Jon Siwek) + + * Set input frontend type before starting the thread. This means + that the thread type will be output correctly in the error + message. (Bernhard Amann) + 2.0-719 | 2012-07-02 14:49:03 -0700 * Fix inconsistencies in random number generation. The diff --git a/VERSION b/VERSION index e94720179f..f8387541e2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0-719 +2.0-723 diff --git a/src/input/Manager.cc b/src/input/Manager.cc index 63fa59d0bc..fd8b3ffa3c 100644 --- a/src/input/Manager.cc +++ b/src/input/Manager.cc @@ -255,10 +255,10 @@ ReaderBackend* Manager::CreateBackend(ReaderFrontend* frontend, bro_int_t type) assert(ir->factory); + frontend->SetTypeName(ir->name); ReaderBackend* backend = (*ir->factory)(frontend); assert(backend); - frontend->ty_name = ir->name; return backend; } diff --git a/src/input/ReaderFrontend.h b/src/input/ReaderFrontend.h index c61b194e24..bc2ec1b5c4 100644 --- a/src/input/ReaderFrontend.h +++ b/src/input/ReaderFrontend.h @@ -115,6 +115,11 @@ protected: */ const string& TypeName() const { return ty_name; } + /** + * Sets the name of the backend's type. + */ + void SetTypeName(const string& name) const { ty_name = name; } + private: ReaderBackend* backend; // The backend we have instanatiated. string source; diff --git a/src/logging/Manager.cc b/src/logging/Manager.cc index f0b5cc1748..e916922edc 100644 --- a/src/logging/Manager.cc +++ b/src/logging/Manager.cc @@ -191,10 +191,10 @@ WriterBackend* Manager::CreateBackend(WriterFrontend* frontend, bro_int_t type) assert(ld->factory); + frontend->ty_name = ld->name; WriterBackend* backend = (*ld->factory)(frontend); assert(backend); - frontend->ty_name = ld->name; return backend; } diff --git a/src/threading/BasicThread.cc b/src/threading/BasicThread.cc index e590b13434..e5a4dc5dbe 100644 --- a/src/threading/BasicThread.cc +++ b/src/threading/BasicThread.cc @@ -80,18 +80,22 @@ const char* BasicThread::Fmt(const char* format, ...) void BasicThread::Start() { + if ( started ) return; - if ( pthread_mutex_init(&terminate, 0) != 0 ) - reporter->FatalError("Cannot create terminate mutex for thread %s", name.c_str()); + int err = pthread_mutex_init(&terminate, 0); + if ( err != 0 ) + reporter->FatalError("Cannot create terminate mutex for thread %s:%s", name.c_str(), strerror(err)); // We use this like a binary semaphore and acquire it immediately. - if ( pthread_mutex_lock(&terminate) != 0 ) - reporter->FatalError("Cannot aquire terminate mutex for thread %s", name.c_str()); + err = pthread_mutex_lock(&terminate); + if ( err != 0 ) + reporter->FatalError("Cannot aquire terminate mutex for thread %s:%s", name.c_str(), strerror(err)); - if ( pthread_create(&pthread, 0, BasicThread::launcher, this) != 0 ) - reporter->FatalError("Cannot create thread %s", name.c_str()); + err = pthread_create(&pthread, 0, BasicThread::launcher, this); + if ( err != 0 ) + reporter->FatalError("Cannot create thread %s:%s", name.c_str(), strerror(err)); DBG_LOG(DBG_THREADING, "Started thread %s", name.c_str());