The pflow regression test could fail due to a race where the close(2)
authormbuhl <mbuhl@openbsd.org>
Tue, 31 May 2022 19:01:46 +0000 (19:01 +0000)
committermbuhl <mbuhl@openbsd.org>
Tue, 31 May 2022 19:01:46 +0000 (19:01 +0000)
call of the receiver was called before the FIN on the sender was
processed.

OK bluhm@
OK anton@

regress/sys/net/pflow/flow.10_4
regress/sys/net/pflow/flow.10_6
regress/sys/net/pflow/gen_traffic.c

index a29d1fe..d2b15be 100644 (file)
@@ -3,8 +3,8 @@
 SetId: 256
 sourceIPv4Address: 0a0b0c0d
 destinationIPv4Address: 0a0b0c0d
-packetDeltaCount: 000000000000000f
-octetDeltaCount: 000000000000a318
+packetDeltaCount: 000000000000000e
+octetDeltaCount: 000000000000a2e4
 sourceTransportPort: 3039
 destinationTransportPort: 303a
 ipClassOfService: 00
@@ -14,8 +14,8 @@ ingressInterface == egressInterface && egressInterface > 0: 1
 SetId: 256
 sourceIPv4Address: 0a0b0c0d
 destinationIPv4Address: 0a0b0c0d
-packetDeltaCount: 000000000000000e
-octetDeltaCount: 00000000000002e4
+packetDeltaCount: 000000000000000d
+octetDeltaCount: 00000000000002b0
 sourceTransportPort: 303a
 destinationTransportPort: 3039
 ipClassOfService: 00
@@ -25,8 +25,8 @@ ingressInterface == egressInterface && egressInterface > 0: 1
 SetId: 256
 sourceIPv4Address: 0a0b0c0d
 destinationIPv4Address: 0a0b0c0d
-packetDeltaCount: 000000000000000f
-octetDeltaCount: 000000000000a318
+packetDeltaCount: 000000000000000e
+octetDeltaCount: 000000000000a2e4
 sourceTransportPort: 3039
 destinationTransportPort: 303a
 ipClassOfService: 00
@@ -36,8 +36,8 @@ ingressInterface == egressInterface && egressInterface > 0: 1
 SetId: 256
 sourceIPv4Address: 0a0b0c0d
 destinationIPv4Address: 0a0b0c0d
-packetDeltaCount: 000000000000000e
-octetDeltaCount: 00000000000002e4
+packetDeltaCount: 000000000000000d
+octetDeltaCount: 00000000000002b0
 sourceTransportPort: 303a
 destinationTransportPort: 3039
 ipClassOfService: 00
index f90610c..c1e075c 100644 (file)
@@ -3,8 +3,8 @@
 SetId: 257
 sourceIPv6Address: 20010db8000000000000000000000013
 destinationIPv6Address: 20010db8000000000000000000000013
-packetDeltaCount: 000000000000000f
-octetDeltaCount: 000000000000a444
+packetDeltaCount: 000000000000000e
+octetDeltaCount: 000000000000a3fc
 sourceTransportPort: 3039
 destinationTransportPort: 303a
 ipClassOfService: 00
@@ -14,8 +14,8 @@ ingressInterface == egressInterface && egressInterface > 0: 1
 SetId: 257
 sourceIPv6Address: 20010db8000000000000000000000013
 destinationIPv6Address: 20010db8000000000000000000000013
-packetDeltaCount: 000000000000000e
-octetDeltaCount: 00000000000003fc
+packetDeltaCount: 000000000000000d
+octetDeltaCount: 00000000000003b4
 sourceTransportPort: 303a
 destinationTransportPort: 3039
 ipClassOfService: 00
@@ -25,8 +25,8 @@ ingressInterface == egressInterface && egressInterface > 0: 1
 SetId: 257
 sourceIPv6Address: 20010db8000000000000000000000013
 destinationIPv6Address: 20010db8000000000000000000000013
-packetDeltaCount: 000000000000000f
-octetDeltaCount: 000000000000a444
+packetDeltaCount: 000000000000000e
+octetDeltaCount: 000000000000a3fc
 sourceTransportPort: 3039
 destinationTransportPort: 303a
 ipClassOfService: 00
@@ -36,8 +36,8 @@ ingressInterface == egressInterface && egressInterface > 0: 1
 SetId: 257
 sourceIPv6Address: 20010db8000000000000000000000013
 destinationIPv6Address: 20010db8000000000000000000000013
-packetDeltaCount: 000000000000000e
-octetDeltaCount: 00000000000003fc
+packetDeltaCount: 000000000000000d
+octetDeltaCount: 00000000000003b4
 sourceTransportPort: 303a
 destinationTransportPort: 3039
 ipClassOfService: 00
index 51c259c..373138c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: gen_traffic.c,v 1.2 2016/10/26 14:06:33 bluhm Exp $ */
+/*     $OpenBSD: gen_traffic.c,v 1.3 2022/05/31 19:01:46 mbuhl Exp $ */
 /*
  * Copyright (c) 2013 Florian Obser <florian@openbsd.org>
  *
@@ -219,18 +219,12 @@ gen_traffic_request(int fd, short events, void *arg)
                break;
 
        case 0:
-               event_del(&r->ev);
-               close(fd);
-               break;
+               exit(0);
        default:
                total += n;
                /* warnx("read: %lld - %lld", n, total); */
                break;
        }
-       if (total == 10 * 4096) {
-               /* warnx("done %lld", total); */
-               exit(0);
-       }
 }
 
 void