On Fri, 10 Oct 2014 16:48:36 +0800
Wei-Li Tang <[email protected]> wrote:

> Signed-off-by: Wei-Li Tang <[email protected]>
> ---
>  ryu/lib/bfdlib.py |    9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)

Applied, thanks.

> diff --git a/ryu/lib/bfdlib.py b/ryu/lib/bfdlib.py
> index 21bfd6f..465ea9a 100644
> --- a/ryu/lib/bfdlib.py
> +++ b/ryu/lib/bfdlib.py
> @@ -535,9 +535,10 @@ class BFDPacket(object):
>          pkt.add_protocol(eth_pkt)
>  
>          # IPv4 encapsulation
> -        # ToS sets to 192 (Network control/CS6)
> +        # set ToS to 192 (Network control/CS6)
> +        # set TTL to 255 (RFC5881 Section 5.)
>          ipv4_pkt = ipv4.ipv4(proto=inet.IPPROTO_UDP, src=src_ip, dst=dst_ip,
> -                             tos=192, identification=ipv4_id)
> +                             tos=192, identification=ipv4_id, ttl=255)
>          pkt.add_protocol(ipv4_pkt)
>  
>          # UDP encapsulation
> @@ -861,6 +862,10 @@ class BFDLib(app_manager.RyuApp):
>  
>          ip_pkt = pkt.get_protocols(ipv4.ipv4)[0]

IIRC, you could write a bit simpler like:

ip_pkt = pkt.get_protocol(ipv4.ipv4)

> +        # Discard it if TTL != 255 for single hop bfd. (RFC5881 Section 5.)
> +        if ip_pkt.ttl != 255:
> +            return
> +
>          # Parse BFD packet here.
>          bfd_pkt = BFDPacket.bfd_parse(data)
>  
> -- 
> 1.7.9.5
> 
> 
> ------------------------------------------------------------------------------
> Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
> Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
> Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to