Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with send_packet_out #46

Closed
yapkke opened this issue Jul 29, 2011 · 2 comments
Closed

Bug with send_packet_out #46

yapkke opened this issue Jul 29, 2011 · 2 comments
Assignees
Labels

Comments

@yapkke
Copy link

yapkke commented Jul 29, 2011

As the following code (spec/repeater_hub.rb), one form of send_packet_out works, but the other one using packet_in does not. FYI.

require File.join(File.dirname(__FILE__), "spec_helper")                                                       

class RepeaterHub < Trema::Controller                                                                          
  def packet_in datapath_id, message                                                                           
    send_flow_mod_add(datapath_id,                                                                             
                      :match => ExactMatch.from(message),                                                      
                      :actions => ActionOutput.new(OFPP_FLOOD))                                                
##THIS DOES NOT WORK...                                                                                        
#    send_packet_out(datapath_id,                                                                              
#                    :packet_in => message,                                                                    
#                    :actions => Trema::ActionOutput.new(OFPP_FLOOD))                                          

##But this works!                                                                                              
    send_packet_out(datapath_id,                                                                               
                    :data => message.buffered? ? nil : message.data,                                           
                    :in_port => message.in_port,                                                               
                    :buffer_id => message.buffer_id,                                                           
                    :actions => Trema::ActionOutput.new(OFPP_FLOOD)                                            
                    )                                                                                          
  end                                                                                                          
end                                                                                                            

describe RepeaterHub do                                                                                        
  it "should flood incoming packets to every other port" do                                                    

    network {                                                                                                  
      vswitch("switch") { dpid "0xabc" }                                                                       

      vhost ("host1") { promisc "on" }                                                                         
      vhost ("host2") { promisc "on" }                                                                         
      vhost ("host3") { promisc "on" }                                                                         

      link "switch", "host1"                                                                                   
      link "switch", "host2"                                                                                   
      link "switch", "host3"                                                                                   
    }.run(RepeaterHub) {                                                                                       
      vhost("host1").send_packet "host2"                                                                       

      vhost("host2").stats(:rx).should have(1).packets                                                         
      vhost("host3").stats(:rx).should have(1).packets                                                         
    }                                                                                                          
  end                                                                                                          
end
@ghost ghost assigned yasuhito Aug 1, 2011
@kazuyas
Copy link
Member

kazuyas commented Aug 10, 2011

We will try to reproduce that then apply sugyo-san's patch later.

@yasuhito
Copy link
Member

Seems already fixed.

rakshasa pushed a commit to axsh/trema that referenced this issue Jun 26, 2013
Fixed ambiguous use of namespace in the C code and namespace collision issue with Timer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants