From 3305a0d09cfc6df443f02a1b5e2d39656cb79189 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 21 Sep 2012 09:26:43 +0900 Subject: [PATCH] flow: Only show IPv4 flow information for IPv4 flows Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- lib/flow.c | 3 ++- tests/ofp-print.at | 2 +- tests/ofproto.at | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/flow.c b/lib/flow.c index a2172a9c4..e517a0376 100644 --- a/lib/flow.c +++ b/lib/flow.c @@ -509,7 +509,8 @@ flow_format(struct ds *ds, const struct flow *flow) ds_put_cstr(ds, "->"); print_ipv6_addr(ds, &flow->ipv6_dst); ds_put_char(ds, ')'); - } else { + } else if (flow->dl_type == htons(ETH_TYPE_IP) || + flow->dl_type == htons(ETH_TYPE_ARP)) { ds_put_format(ds, " proto:%"PRIu8" tos:%#"PRIx8" ttl:%"PRIu8 " ip("IP_FMT"->"IP_FMT")", flow->nw_proto, flow->nw_tos, flow->nw_ttl, diff --git a/tests/ofp-print.at b/tests/ofp-print.at index a8ace847a..42b355b17 100644 --- a/tests/ofp-print.at +++ b/tests/ofp-print.at @@ -351,7 +351,7 @@ AT_CHECK([ovs-ofctl ofp-print "\ 00 00 00 23 20 83 c1 5f 00 00 00 00 \ "], [0], [dnl OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=42 in_port=LOCAL (via no_match) data_len=42 buffer=0xffffff00 -priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:23:20:83:c1:5f->ff:ff:ff:ff:ff:ff) type:8035 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0) +priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:23:20:83:c1:5f->ff:ff:ff:ff:ff:ff) type:8035 ]) AT_CLEANUP diff --git a/tests/ofproto.at b/tests/ofproto.at index 827daa2e2..af7b7ca5b 100644 --- a/tests/ofproto.at +++ b/tests/ofproto.at @@ -588,14 +588,14 @@ check_async () { ovs-ofctl -v packet-out br0 none controller '0001020304050010203040501234' if test X"$1" = X"OFPR_ACTION"; then shift; echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=NONE (via action) data_len=14 (unbuffered) -priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0)" +priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234" fi # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123) ovs-ofctl -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234' if test X"$1" = X"OFPR_NO_MATCH"; then shift; echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=NONE (via no_match) data_len=14 (unbuffered) -priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0)" +priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234" fi # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0) @@ -700,9 +700,9 @@ ovs-appctl -t ovs-ofctl exit AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl OFPT_PACKET_IN: total_len=14 in_port=NONE (via action) data_len=14 (unbuffered) -priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0) +priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered) -priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:5678 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0) +priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:5678 OFPT_BARRIER_REPLY: ]) @@ -730,7 +730,7 @@ ovs-appctl -t ovs-ofctl exit AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl NXT_PACKET_IN: total_len=14 in_port=NONE metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered) -priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 proto:0 tos:0 ttl:0 ip(0.0.0.0->0.0.0.0) +priority:0,tunnel:0,metadata:0,in_port:0000,tci(0) mac(00:10:20:30:40:50->00:01:02:03:04:05) type:1234 OFPT_BARRIER_REPLY: ]) -- 2.43.0