dpif: Don't rely on caller to keep dpif arg valid, in dpifmon_create().
authorBen Pfaff <blp@nicira.com>
Thu, 5 Mar 2009 19:01:45 +0000 (11:01 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 5 Mar 2009 19:01:45 +0000 (11:01 -0800)
commit8805128e4d6e5e775afaaf9e6fb47905510ef6e4
treeca67b649ec7b99ef28a7686854021e02256c8cc2
parenta76a315bdf5a15432d1e03bd46aee854215eabd4
dpif: Don't rely on caller to keep dpif arg valid, in dpifmon_create().

dpifmon_create() stored away the dpif pointer that it was passed and
continued to use it, but ofproto_create() didn't keep that dpif in a
constant place in memory, so dpifmon_poll() would randomly fail with
errors like "Bad file descriptor".  Having the dpifmon keep its own
fd to a dpif is more reliable.

Additional possible fix to Dan's problem.
lib/dpif.c
lib/dpif.h
secchan/ofproto.c