|
Bugzilla – Full Text Bug Listing |
| Summary: | Click doesn't work with raw sockets | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Lalith Suresh <suresh.lalith> |
| Component: | click | Assignee: | Lalith Suresh <suresh.lalith> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ns-bugs, tomh |
| Priority: | P3 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
test script which shows the problem
Fix |
||
|
Description
Lalith Suresh
2012-07-25 15:38:18 UTC
Created attachment 1427 [details]
test script which shows the problem
Created attachment 1428 [details]
Fix
Here's a first patch that fixes the problem. It basically fixes the Icmpv4 and raw socket code to only use Ipv4 type pointers instead of directly getting an Ipv4L3Protocol object. And within Ipv4L3ClickProtocol, we forward Ipv4 packets further up to any raw sockets before handing them to Click.
Someday, I would really like to decouple Click from the L3 code, and have it use FromHost/ToHost elements to interact with the stack over real tun/tap devices. :\
(In reply to comment #2) > Created attachment 1428 [details] > Fix > > Here's a first patch that fixes the problem. It basically fixes the Icmpv4 and > raw socket code to only use Ipv4 type pointers instead of directly getting an > Ipv4L3Protocol object. And within Ipv4L3ClickProtocol, we forward Ipv4 packets > further up to any raw sockets before handing them to Click. > > Someday, I would really like to decouple Click from the L3 code, and have it > use FromHost/ToHost elements to interact with the stack over real tun/tap > devices. :\ Comments on the patch. I'm generally fine with it. Shouldn't it also make this change? --- a/src/internet/model/ipv4-raw-socket-factory-impl.cc Tue Jul 24 17:11:01 2012 -0700 +++ b/src/internet/model/ipv4-raw-socket-factory-impl.cc Thu Jul 26 06:06:31 2012 -0700 @@ -29,6 +29,7 @@ Ipv4RawSocketFactoryImpl::CreateSocket (void) { - Ptr<Ipv4L3Protocol> ipv4 = GetObject<Ipv4L3Protocol> (); + Ptr<Ipv4> ipv4 = GetObject<Ipv4> (); Ptr<Socket> socket = ipv4->CreateRawSocket (); return socket; also delete "ipv4-l3-protocol.h" from includes. The three new Ipv4 public methods need doxygen (In reply to comment #3) > (In reply to comment #2) > > Created attachment 1428 [details] > > Fix > > > > Here's a first patch that fixes the problem. It basically fixes the Icmpv4 and > > raw socket code to only use Ipv4 type pointers instead of directly getting an > > Ipv4L3Protocol object. And within Ipv4L3ClickProtocol, we forward Ipv4 packets > > further up to any raw sockets before handing them to Click. > > > > Someday, I would really like to decouple Click from the L3 code, and have it > > use FromHost/ToHost elements to interact with the stack over real tun/tap > > devices. :\ > > Comments on the patch. I'm generally fine with it. Shouldn't it also make > this change? > > --- a/src/internet/model/ipv4-raw-socket-factory-impl.cc Tue Jul 24 17:11:01 > 2012 -0700 > +++ b/src/internet/model/ipv4-raw-socket-factory-impl.cc Thu Jul 26 06:06:31 > 2012 -0700 > @@ -29,6 +29,7 @@ > Ipv4RawSocketFactoryImpl::CreateSocket (void) > { > - Ptr<Ipv4L3Protocol> ipv4 = GetObject<Ipv4L3Protocol> (); > + Ptr<Ipv4> ipv4 = GetObject<Ipv4> (); > Ptr<Socket> socket = ipv4->CreateRawSocket (); > return socket; > It's already in the patchset. > also delete "ipv4-l3-protocol.h" from includes. > > The three new Ipv4 public methods need doxygen Yes, I'll do the cleaning up, doxygen, style-check and then commit. Changeset 8922 922350836734 |