On Tue, Jun 25, 2013 at 11:08:18PM +0000, Shaun Crampton wrote:
> Yamahata-San,
> 
> What happened to your/my patch to handle ethernet padding generically
> "[Ryu-devel] [PATCH] lib/packet: teach packet library to      truncate padding
> octet"? 

> Wouldn't that fix this case as long as we added payload_length to
> the LLDP packet?

Unfortunately no because lldp header doesn't include payload length.

thanks

> 
> Shaun Crampton
> Software Development Manager
> Metaswitch Networks <http://www.metaswitch.com/>
>  
> P   +1 (415) 513-1500
> E   [email protected]
> 
> 
> 
> 
> On 23/06/2013 19:06, "Isaku Yamahata" <[email protected]> wrote:
> 
> >There may be padding at the end of payload.
> >So the assumption that there is no payload after LLDP_TLV_END
> >is not correct.
> >
> >Reported-by: Q Lady <[email protected]>
> >Signed-off-by: Isaku Yamahata <[email protected]>
> >---
> > ryu/lib/packet/lldp.py |    5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> >diff --git a/ryu/lib/packet/lldp.py b/ryu/lib/packet/lldp.py
> >index f343359..c0f16a4 100644
> >--- a/ryu/lib/packet/lldp.py
> >+++ b/ryu/lib/packet/lldp.py
> >@@ -137,9 +137,10 @@ class lldp(packet_base.PacketBase):
> >             tlv = cls._tlv_parsers[tlv_type](buf)
> >             tlvs.append(tlv)
> >             offset = LLDP_TLV_SIZE + tlv.len
> >+            if tlv.tlv_type == LLDP_TLV_END:
> >+                break
> >             buf = buf[offset:]
> >-            assert (len(buf) > 0 and tlv.tlv_type != LLDP_TLV_END) or \
> >-                   (len(buf) == 0 and tlv.tlv_type == LLDP_TLV_END)
> >+            assert len(buf) > 0
> > 
> >         lldp_pkt = cls(tlvs)
> > 
> >-- 
> >1.7.10.4
> >
> >
> >--------------------------------------------------------------------------
> >----
> >This SF.net email is sponsored by Windows:
> >
> >Build for Windows Store.
> >
> >http://p.sf.net/sfu/windows-dev2dev
> >_______________________________________________
> >Ryu-devel mailing list
> >[email protected]
> >https://lists.sourceforge.net/lists/listinfo/ryu-devel
> 

-- 
yamahata

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to