Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
002593c6
Commit
002593c6
authored
13 years ago
by
Srinivasan Ramasubramanian
Browse files
Options
Downloads
Patches
Plain Diff
pushPacket function updated to drop packets if the inport and outport are the same.
parent
b06c72c1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/routing/ForwardingBase.java
+22
-1
22 additions, 1 deletion
...java/net/floodlightcontroller/routing/ForwardingBase.java
with
22 additions
and
1 deletion
src/main/java/net/floodlightcontroller/routing/ForwardingBase.java
+
22
−
1
View file @
002593c6
...
@@ -255,12 +255,33 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag
...
@@ -255,12 +255,33 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag
return
match
.
clone
();
return
match
.
clone
();
}
}
/**
* This function will push a packet-out to a switch. The assumption here is that
* the packet-in was also generated from the same switch. Thus, if the input
* port of the packet-in and the outport are the same, the function will not
* push the packet-out.
* @param sw switch that generated the packet-in, and from which packet-out is sent
* @param match OFmatch
* @param pi packet-in
* @param outport output port
* @param cntx context of the packet
*/
public
void
pushPacket
(
IOFSwitch
sw
,
OFMatch
match
,
OFPacketIn
pi
,
short
outport
,
FloodlightContext
cntx
)
{
public
void
pushPacket
(
IOFSwitch
sw
,
OFMatch
match
,
OFPacketIn
pi
,
short
outport
,
FloodlightContext
cntx
)
{
if
(
pi
==
null
)
{
if
(
pi
==
null
)
{
return
;
return
;
}
}
// The assumption here is (sw) is the switch that generated the packet-in.
// If the input port is the same as output port, then the packet-out should
// be ignored.
if
(
pi
.
getInPort
()
==
outport
)
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"Attemping to do packet-out to the same interface as packet-in. Dropping packet. SrcSwitch={}, match = {}, pi={}"
,
new
Object
[]{
sw
,
match
,
pi
});
return
;
}
}
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"PacketOut srcSwitch={} match={} pi={}"
,
new
Object
[]
{
sw
,
match
,
pi
});
log
.
debug
(
"PacketOut srcSwitch={} match={} pi={}"
,
new
Object
[]
{
sw
,
match
,
pi
});
}
}
...
@@ -278,7 +299,7 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag
...
@@ -278,7 +299,7 @@ public abstract class ForwardingBase implements IOFMessageListener, IDeviceManag
// set buffer_id, in_port
// set buffer_id, in_port
po
.
setBufferId
(
pi
.
getBufferId
());
po
.
setBufferId
(
pi
.
getBufferId
());
po
.
setInPort
(
pi
.
getInPort
());
po
.
setInPort
(
pi
.
getInPort
());
// set data - only if buffer_id == -1
// set data - only if buffer_id == -1
if
(
pi
.
getBufferId
()
==
OFPacketOut
.
BUFFER_ID_NONE
)
{
if
(
pi
.
getBufferId
()
==
OFPacketOut
.
BUFFER_ID_NONE
)
{
byte
[]
packetData
=
pi
.
getPacketData
();
byte
[]
packetData
=
pi
.
getPacketData
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment