Perl on 32 bit architectures does not support pack('Q'), replace
authorbluhm <bluhm@openbsd.org>
Thu, 22 Jun 2017 20:17:22 +0000 (20:17 +0000)
committerbluhm <bluhm@openbsd.org>
Thu, 22 Jun 2017 20:17:22 +0000 (20:17 +0000)
it with 'NN'.

regress/usr.sbin/switchd/OFP.pm
regress/usr.sbin/switchd/run.pl

index fde9b2d..be6112a 100644 (file)
@@ -258,12 +258,12 @@ sub ofp_table_features_reply {
        #
        # Finish
        #
-       $tf_header = pack('nCx[5]a[32]QQNN',
+       $tf_header = pack('nCx[5]a[32]NNNNNN',
            64 + length($tf_payload),   # length
            0,                          # tableid
            'start',                    # name
-           0x0000000000000000,         # metadata_match
-           0x0000000000000000,         # metadata_write
+           0x00000000, 0x00000000,     # metadata_match
+           0x00000000, 0x00000000,     # metadata_write
            0x00000000,                 # config
            10000                       # max_entries
            );
index 6656504..fbc045e 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $OpenBSD: run.pl,v 1.10 2017/06/22 20:06:14 bluhm Exp $
+# $OpenBSD: run.pl,v 1.11 2017/06/22 20:17:22 bluhm Exp $
 
 # Copyright (c) 2017 Alexander Bluhm <bluhm@openbsd.org>
 # Copyright (c) 2016 Reyk Floeter <reyk@openbsd.org>
@@ -134,8 +134,8 @@ sub ofp_hello {
                $pkt->{version} = $self->{version};
                $pkt->{type} = OFP_T_FEATURES_REPLY();
                $pkt->{xid} = $features->{xid};
-               $pkt->{data} = pack('QNCCxxNN',
-                   0xFFAABBCCDDEEFF,           # datapath_id
+               $pkt->{data} = pack('NNNCCxxNN',
+                   0x00FFAABB, 0xCCDDEEFF,     # datapath_id
                    0,                          # nbuffers
                    1,                          # ntables
                    0,                          # aux_id
@@ -184,12 +184,12 @@ sub ofp_packet_in {
                        $match .= pack("x[$padding]");
                }
 
-               $pkt = pack('NnCCQnna*xxa*',
+               $pkt = pack('NnCCNNnna*xxa*',
                    OFP_PKTOUT_NO_BUFFER(),                     # buffer_id
                    length($data),                              # total_len
                    OFP_PKTIN_REASON_NO_MATCH(),                # reason
                    0,                                          # table_id
-                   0x0000000000000000,                         # cookie
+                   0x00000000, 0x00000000,                     # cookie
                    OFP_MATCH_OXM(),                            # match_type
                    $matchlen,                                  # match_len
                    $match,                                     # OXM matches