From 458d5195033730da8e5e69493c4116d31562be38 Mon Sep 17 00:00:00 2001 From: "Kawai,Hiroaki" Date: Fri, 8 Jul 2016 16:44:26 +0900 Subject: [PATCH] Ethernet frame is 60 bytes length at least --- src/switch/datapath/async_event_notifier.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/switch/datapath/async_event_notifier.c b/src/switch/datapath/async_event_notifier.c index 5176620a..88290b04 100644 --- a/src/switch/datapath/async_event_notifier.c +++ b/src/switch/datapath/async_event_notifier.c @@ -186,6 +186,13 @@ notify_packet_in( const uint8_t reason, const uint8_t table_id, const uint64_t c if ( callbacks.packet_in == NULL ) { return; } + + if ( packet->length < 60 ) { // fill up to ethernet(without FCS) minimum length + size_t length = packet->length; + append_back_buffer( packet, 60 - length ); + memset( packet->data + length, 0, 60 - length ); + } + if ( ERROR_DROP_PACKET == execute_meter( OFPM_CONTROLLER, packet ) ) { return; }