travelping / flower

FlowER - a Erlang OpenFlow development platform
http://travelping.github.com/flower
MIT License
61 stars 14 forks source link

buffer_id default value in #ofp_flow_mod record #4

Closed etnt closed 11 years ago

etnt commented 11 years ago

Hi,

I'm wondering about the 'buffer_id' default value of the #ofp_flow_mod{} record:

flower_packet.hrl:420 buffer_id = -1,

If you compare that with the test done in flower_datapath.erl:142

.... if BufferId == 16#FFFFFFFF, Packet /= none -> ...

It seems like the default value flower_packet.hrl actually should be defined as:

..... -define(OFP_NO_BUFFER, 16#FFFFFFFF). % Not refering to any buffered packet ....

flower_packet.hrl:420 buffer_id = ?OFP_NO_BUFFER,

Or am I mistaken?

Cheers, Tobbe

RoadRunnr commented 11 years ago

Hi Tobbe,

----- Original Message -----

Hi,

I'm wondering about the 'buffer_id' default value of the #ofp_flow_mod{} record:

flower_packet.hrl:420 buffer_id = -1,

If you compare that with the test done in flower_datapath.erl:142

.... if BufferId == 16#FFFFFFFF, Packet /= none -> ...

It seems like the default value flower_packet.hrl actually should be defined as:

..... -define(OFP_NO_BUFFER, 16#FFFFFFFF). % Not refering to any buffered packet ....

flower_packet.hrl:420 buffer_id = ?OFP_NO_BUFFER,

Or am I mistaken?

You are right, looks like a copy&paste from the C header without thinking about Erlang integers.

I'll change that, thanks!

Andreas

Cheers, Tobbe


Reply to this email directly or view it on GitHub: https://github.com/travelping/flower/issues/4

Dipl. Inform. Andreas Schultz

etnt commented 11 years ago

Great, thanx!

etnt commented 11 years ago

btw, I guess the same goes for the buffer_id in #ofp_packet_out{}