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

match.eth_type() is NULL #2

Open
adk9 opened this issue Apr 2, 2015 · 1 comment
Open

match.eth_type() is NULL #2

adk9 opened this issue Apr 2, 2015 · 1 comment

Comments

@adk9
Copy link

adk9 commented Apr 2, 2015

I extended the msg_controller to print out the eth-type for a packet-in event, as follows:

diff --git a/examples/controller/msg/MsgApps.hh b/examples/controller/msg/MsgApps.hh
index 904b6bf..f3eb81d 100644
--- a/examples/controller/msg/MsgApps.hh
+++ b/examples/controller/msg/MsgApps.hh
@@ -57,6 +57,11 @@ public:
                     return;
                 }
                 in_port = ofpi->match().in_port()->value();
+                if (ofpi->match().eth_type() == NULL) {
+                    return;
+                }
+                uint32_t type = ofpi->match().eth_type()->value();
+                printf("Received packet of type %u.\n", type);
             }

             // Learn the source

I see that it either prints the eth-type as 0 or segfaults:

$ ./msg_controller l2l2 application (MultiLearningSwitch) started
Server running (0.0.0.0:6633)
Connection id=0 started
Connection id=0 established
Received packet of type 0.
Segmentation fault (core dumped)

Is this because of an issue in eth_type handling in the match object?

@ederlf
Copy link
Member

ederlf commented Apr 3, 2015

Can you please give more details?
I'm running the code with your changes and it is working as expected.

Also, please try to get valgrind and gdb output to check exactly where the code is breaking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants