[ovs-dev] [PATCH 1/5] ofproto-dpif: Move send_packet() to ofproto-dpif-xlate module.
Ethan Jackson
ethan at nicira.com
Tue Oct 1 22:47:16 UTC 2013
Technically I don't think it is because the dpif could be destroyed as
soon as the xlate_rwlock is released. In practice this seems pretty
unlikely. If we wanted to do that we'd have to ref count the dpif,
which may not be a bad idea anyway.
Ethan
On Tue, Oct 1, 2013 at 3:45 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Tue, Oct 01, 2013 at 03:41:17PM -0700, Ethan Jackson wrote:
>> > xlate_send_packet() locks xlate_rwlock before it looks up the xport,
>> > but at the end it unlocks xlate_rwlock before it dereferences
>> > xport->xbridge->dpif. Is the latter dereference safe, that is, does
>> > anything guarantee that 'xport' and 'xbridge' aren't destroyed?
>>
>> No that's definitely not safe. Should be changed.
>
> Is it sufficient to do dpif = xport->xbridge->dpif inside the lock and
> then use 'dpif' afterward?
More information about the dev
mailing list