Hello community,

here is the log from the commit of package packit for openSUSE:Factory checked 
in at 2020-06-07 21:39:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/packit (Old)
 and      /work/SRC/openSUSE:Factory/.packit.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "packit"

Sun Jun  7 21:39:40 2020 rev:4 rq:812215 version:1.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/packit/packit.changes    2019-04-23 
14:36:26.377488239 +0200
+++ /work/SRC/openSUSE:Factory/.packit.new.3606/packit.changes  2020-06-07 
21:39:52.633746597 +0200
@@ -1,0 +2,7 @@
+Sun Jun  7 10:53:02 UTC 2020 - Luigi Baldoni <aloi...@gmx.com>
+
+- Update to version 1.7
+  * Fixed buffer overruns with `R' arguments to options.
+  * Fixed compiling with -fno-common.
+
+-------------------------------------------------------------------

Old:
----
  packit-1.6.1.tar.gz

New:
----
  packit-1.7.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ packit.spec ++++++
--- /var/tmp/diff_new_pack.kVMQkC/_old  2020-06-07 21:39:54.177751492 +0200
+++ /var/tmp/diff_new_pack.kVMQkC/_new  2020-06-07 21:39:54.181751505 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package packit
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           packit
-Version:        1.6.1
+Version:        1.7
 Release:        0
 Summary:        Network injection and capture
 License:        GPL-2.0-or-later

++++++ packit-1.6.1.tar.gz -> packit-1.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/AUTHORS new/packit-1.7/AUTHORS
--- old/packit-1.6.1/AUTHORS    2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/AUTHORS      2020-02-05 18:34:31.000000000 +0100
@@ -2,7 +2,10 @@
 ------------------------
 
 Darren Bounds <dbou...@gmail.com>
+David Polverari <david.polver...@gmail.com>
+Dennis Vshivkov <wal...@amur.ru>
 Edward Betts <edw...@4angle.com>
+Jeroen Roovers <j...@gentoo.org>
 Joao Eriberto Mota Filho <eribe...@eriberto.pro.br>
 Robert Krause <rup...@f00l.de>
 Sander Kleijwegt <sander.kleijw...@netscout.com>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/ChangeLog new/packit-1.7/ChangeLog
--- old/packit-1.6.1/ChangeLog  2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/ChangeLog    2020-02-05 18:34:31.000000000 +0100
@@ -1,3 +1,19 @@
+Version 1.7, 2020-02-05
+-------------------------
+
+  [ Joao Eriberto Mota Filho ], eribe...@eriberto.pro.br
+
+* Updated AUTHORS file and manpage.
+
+  [ Dennis Vshivkov], <wal...@amur.ru>
+  [ David Polverari ], <david.polver...@gmail.com>
+
+* Fixed buffer overruns with `R' arguments to options.
+
+  [ Jeroen Roovers ], <j...@gentoo.org>
+
+* Fixed compiling with -fno-common.
+
 Version 1.6.1, 2019-01-25
 -------------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/configure.ac new/packit-1.7/configure.ac
--- old/packit-1.6.1/configure.ac       2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/configure.ac 2020-02-05 18:34:31.000000000 +0100
@@ -25,7 +25,7 @@
 # packit official page at https://github.com/eribertomota/packit
 
 AC_PREREQ([2.69])
-AC_INIT([packit], [1.6], [https://github.com/eribertomota/packit/issues])
+AC_INIT([packit], [1.7], [https://github.com/eribertomota/packit/issues])
 AC_CONFIG_SRCDIR([src/main.c])
 AM_INIT_AUTOMAKE
 AC_CONFIG_HEADERS(config.h)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/man/generate-man.sh 
new/packit-1.7/man/generate-man.sh
--- old/packit-1.6.1/man/generate-man.sh        2019-01-26 01:03:57.000000000 
+0100
+++ new/packit-1.7/man/generate-man.sh  2020-02-05 18:34:31.000000000 +0100
@@ -4,9 +4,9 @@
 # Copyright 2016 Joao Eriberto Mota Filho <eribe...@eriberto.pro.br>
 # This file is under BSD-3-Clause
 
-P_DATA="25 Jan 2019"
+P_DATA="05 Feb 2020"
 P_NAME=packit
-P_VERSION=1.6
+P_VERSION=1.7
 P_MANLEVEL=8
 P_DESCRIPT="Network packet generator and capture tool "
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/man/packit.8 new/packit-1.7/man/packit.8
--- old/packit-1.6.1/man/packit.8       2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/man/packit.8 2020-02-05 18:34:31.000000000 +0100
@@ -1,5 +1,5 @@
 .\" Text automatically generated by txt2man
-.TH packit 8 "25 Jan 2019" "packit-1.6" "Network packet generator and capture 
tool "
+.TH packit 8 "05 Feb 2020" "packit-1.7" "Network packet generator and capture 
tool "
 .SH NAME
 \fBPackit \fP- network packet generator and capture tool
 \fB
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/src/capture_defs.h 
new/packit-1.7/src/capture_defs.h
--- old/packit-1.6.1/src/capture_defs.h 2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/src/capture_defs.h   2020-02-05 18:34:31.000000000 +0100
@@ -5,6 +5,7 @@
  *
  * Copyright 2002 Darren Bounds <dbou...@intrusense.com>
  * Copyright 2017 Sharad B
+ * Copyright 2020 Jeroen Roovers <j...@gentoo.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -30,12 +31,12 @@
 #define READ_TIMEOUT                    500
 #define SNAPLEN_DEFAULT                 68
 
-u_int16_t g_display;
-u_int16_t g_link_layer;
-u_int16_t g_dump_pkt;
-u_int16_t g_time_gmt;
-u_int16_t g_t_rst;
-u_int16_t g_snap_len;
-u_int32_t g_pkt_rst;
+extern u_int16_t g_display;
+extern u_int16_t g_link_layer;
+extern u_int16_t g_dump_pkt;
+extern u_int16_t g_time_gmt;
+extern u_int16_t g_t_rst;
+extern u_int16_t g_snap_len;
+extern u_int32_t g_pkt_rst;
 
 #endif /* __CAPTURE_DEFS_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/src/error.c new/packit-1.7/src/error.c
--- old/packit-1.6.1/src/error.c        2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/src/error.c  2020-02-05 18:34:31.000000000 +0100
@@ -5,6 +5,7 @@
  *
  * Copyright 2002 Darren Bounds <dbou...@intrusense.com>
  * Copyright 2016 Robert Krause <rup...@f00l.de>
+ * Copyright 2020 Jeroen Roovers <j...@gentoo.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -26,6 +27,8 @@
 
 #include "error.h"
 
+char error_buf[ERRBUF_MAXLEN];
+
 void
 fatal_error(char *err,...)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/src/error.h new/packit-1.7/src/error.h
--- old/packit-1.6.1/src/error.h        2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/src/error.h  2020-02-05 18:34:31.000000000 +0100
@@ -5,6 +5,7 @@
  *
  * Copyright 2002 Darren Bounds <dbou...@intrusense.com>
  * Copyright 2016 Robert Krause <rup...@f00l.de>
+ * Copyright 2020 Jeroen Roovers <j...@gentoo.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -33,7 +34,7 @@
 #define SUCCESS                        1
 #define FAILURE                        -1
 
-char error_buf[ERRBUF_MAXLEN];
+extern char error_buf[ERRBUF_MAXLEN];
 
 void fatal_error(char *,...);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/src/globals.h 
new/packit-1.7/src/globals.h
--- old/packit-1.6.1/src/globals.h      2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/src/globals.h        2020-02-05 18:34:31.000000000 +0100
@@ -7,6 +7,7 @@
  * Copyright 2007      Kumar Appaiah <aku...@ee.iitm.ac.in>
  * Copyright 2016-2017 Robert Krause <rup...@f00l.de>
  * Copyright 2017      Sharad B
+ * Copyright 2020      Jeroen Roovers <j...@gentoo.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -138,20 +139,20 @@
 #define P_INT64                         0x7FFFFFFFFFFFFFFF
 #define P_UINT64                        0xFFFFFFFFFFFFFFFF
 
-char g_w_file[OPT_MAXLEN];
-char g_r_file[OPT_MAXLEN];
+extern char g_w_file[OPT_MAXLEN];
+extern char g_r_file[OPT_MAXLEN];
 
-pcap_t *g_pkt;
-u_int8_t g_tr_fin;
-char *g_filter;
-char *g_device;
-u_int16_t g_hdr_len;
-u_int16_t g_pkt_len;
-u_int16_t g_verbose;
-u_int16_t g_resolve;
-u_int16_t g_p_mode;
-u_int64_t g_cnt;
-u_int64_t g_inj_cnt;
-u_int64_t g_cap_cnt;
+extern pcap_t *g_pkt;
+extern u_int8_t g_tr_fin;
+extern char *g_filter;
+extern char *g_device;
+extern u_int16_t g_hdr_len;
+extern u_int16_t g_pkt_len;
+extern u_int16_t g_verbose;
+extern u_int16_t g_resolve;
+extern u_int16_t g_p_mode;
+extern u_int64_t g_cnt;
+extern u_int64_t g_inj_cnt;
+extern u_int64_t g_cap_cnt;
 
 #endif /* __GLOBALS_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/src/inject_defs.h 
new/packit-1.7/src/inject_defs.h
--- old/packit-1.6.1/src/inject_defs.h  2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/src/inject_defs.h    2020-02-05 18:34:31.000000000 +0100
@@ -8,6 +8,7 @@
  * Copyright 2016-2017 Robert Krause <rup...@f00l.de>
  * Copyright 2017      Edward Betts <edw...@4angle.com>
  * Copyright 2017      Sharad B
+ * Copyright 2020      Jeroen Roovers <j...@gentoo.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -30,7 +31,7 @@
 #ifndef __INJECTION_STRUCTS_H
 #define __INJECTION_STRUCTS_H
 
-struct ip4hdr_opts
+extern struct ip4hdr_opts
 {
     u_int16_t p;                   /* protocol type */
     u_int16_t rand_p;
@@ -59,7 +60,7 @@
     u_int16_t rand_d_addr;
 } g_ip4hdr_o;
 
-struct tcphdr_opts
+extern struct tcphdr_opts
 {
     u_int16_t s_port;              /* tcp source port */
     u_int16_t d_port;              /* tcp destination port */
@@ -82,7 +83,7 @@
 
 } g_thdr_o;
 
-struct udphdr_opts
+extern struct udphdr_opts
 {
     u_int16_t s_port;              /* udp source port */
     u_int16_t d_port;              /* udp destination port */
@@ -90,7 +91,7 @@
     u_int16_t sum;                      /* udp checksum */
 } g_uhdr_o;
 
-struct icmp4hdr_opts
+extern struct icmp4hdr_opts
 {
     u_int16_t type;                /* icmp4 type */
     u_int16_t code;                /* icmp4 code */
@@ -132,7 +133,7 @@
     u_int32_t ttime;                    /* transmit timestamp */
 } g_i4hdr_o;
 
-struct enethdr_opts
+extern struct enethdr_opts
 {
     u_int16_t rand_s_addr;
     u_int16_t rand_d_addr;
@@ -143,7 +144,7 @@
     u_int8_t dhw_addr[18];
 } g_ehdr_o;
 
-struct arphdr_opts
+extern struct arphdr_opts
 {
     u_int16_t op_type;                  /* arp operation */
 
@@ -163,28 +164,28 @@
     u_int8_t rhw_addr[18];
 } g_ahdr_o;
 
-libnet_t *g_pkt_d;
+extern libnet_t *g_pkt_d;
 
-u_int16_t g_init_type;
-u_int16_t g_rand_d_port;
-u_int16_t g_rand_s_port;
-u_int16_t g_s_port;
-u_int16_t g_d_port;
-u_int16_t g_port_range;
-u_int16_t g_interval_sec;
-u_int16_t g_interval_usec;
-u_int16_t g_injection_type;
-u_int16_t g_r_timeout;
-u_int16_t g_burst_rate;
-u_int16_t g_payload_len;
-u_int8_t *g_payload;
-u_int8_t g_hex_payload;
-u_int8_t *g_s_d_port;
-u_int8_t g_hwaddr_p[18];
-u_int8_t g_rawip;
+extern u_int16_t g_init_type;
+extern u_int16_t g_rand_d_port;
+extern u_int16_t g_rand_s_port;
+extern u_int16_t g_s_port;
+extern u_int16_t g_d_port;
+extern u_int16_t g_port_range;
+extern u_int16_t g_interval_sec;
+extern u_int16_t g_interval_usec;
+extern u_int16_t g_injection_type;
+extern u_int16_t g_r_timeout;
+extern u_int16_t g_burst_rate;
+extern u_int16_t g_payload_len;
+extern u_int8_t *g_payload;
+extern u_int8_t g_hex_payload;
+extern u_int8_t *g_s_d_port;
+extern u_int8_t g_hwaddr_p[18];
+extern u_int8_t g_rawip;
 
-struct timeval g_bf_pcap;
-struct timeval g_af_pcap;
+extern struct timeval g_bf_pcap;
+extern struct timeval g_af_pcap;
 
 
 #endif /* __INJECTION_STRUCTS_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/src/main.c new/packit-1.7/src/main.c
--- old/packit-1.6.1/src/main.c 2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/src/main.c   2020-02-05 18:34:31.000000000 +0100
@@ -4,11 +4,13 @@
  * Original author: Darren Bounds <dbou...@intrusense.com>
  *
  * Copyright 2002-2004 Darren Bounds <dbou...@intrusense.com>
- * Copyright 2005      Dennis Vshivkov <wal...@amur.ru>
+ * Copyright 2004-2005 Dennis Vshivkov <wal...@amur.ru>
  * Copyright 2006      Deniz Adrian <adr...@netzquadrat.de>
  * Copyright 2013      Mats Erik Andersson <g...@gisladisker.se>
  * Copyright 2017      Robert Krause <rup...@f00l.de>
  * Copyright 2017      Sharad B
+ * Copyright 2020      David Polverari <david.polver...@gmail.com>
+ * Copyright 2020      Jeroen Roovers <j...@gentoo.org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -30,6 +32,78 @@
 
 #include "main.h"
 
+char g_w_file[OPT_MAXLEN];
+char g_r_file[OPT_MAXLEN];
+
+pcap_t *g_pkt;
+u_int8_t g_tr_fin;
+char *g_filter;
+char *g_device;
+u_int16_t g_hdr_len;
+u_int16_t g_pkt_len;
+u_int16_t g_verbose;
+u_int16_t g_resolve;
+u_int16_t g_p_mode;
+u_int64_t g_cnt;
+u_int64_t g_inj_cnt;
+u_int64_t g_cap_cnt;
+
+/* capture_defs.h */
+u_int16_t g_display;
+u_int16_t g_link_layer;
+u_int16_t g_dump_pkt;
+u_int16_t g_time_gmt;
+u_int16_t g_t_rst;
+u_int16_t g_snap_len;
+u_int32_t g_pkt_rst;
+
+/* inject_defs.h */
+u_int16_t g_init_type;
+u_int16_t g_rand_d_port;
+u_int16_t g_rand_s_port;
+u_int16_t g_s_port;
+u_int16_t g_d_port;
+u_int16_t g_port_range;
+u_int16_t g_interval_sec;
+u_int16_t g_interval_usec;
+u_int16_t g_injection_type;
+u_int16_t g_r_timeout;
+u_int16_t g_burst_rate;
+u_int16_t g_payload_len;
+u_int8_t *g_payload;
+u_int8_t g_hex_payload;
+u_int8_t *g_s_d_port;
+u_int8_t g_hwaddr_p[18];
+u_int8_t g_rawip;
+
+struct timeval g_bf_pcap;
+struct timeval g_af_pcap;
+
+struct arphdr_opts g_ahdr_o;
+struct enethdr_opts g_ehdr_o;
+struct icmp4hdr_opts g_i4hdr_o;
+struct ip4hdr_opts g_ip4hdr_o;
+struct tcphdr_opts g_thdr_o;
+struct udphdr_opts g_uhdr_o;
+
+libnet_t *g_pkt_d;
+
+static void
+randomisable_str(u_int8_t **to, u_int16_t *rand, size_t size, const char *desc)
+{
+    if (strcmp(optarg, "R") != 0)
+    {
+       if ((*to = strdup(optarg)) == NULL)
+           fatal_error("Memory unavailable for: %s", optarg);
+    }
+    else
+    {
+       *rand = 1;
+       if ((*to = malloc(size)) == NULL)
+           fatal_error("Memory unavailable for: %s", desc);
+    }
+}
+
 void
 parse_capture_options(int argc, char *argv[])
 {
@@ -256,12 +330,7 @@
                 break;
 
             case 'd':
-               if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_ip4hdr_o.rand_d_addr = 1;
-
-               if(!(g_ip4hdr_o.d_addr = (u_int8_t*)strdup(optarg)))
-                   fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_ip4hdr_o.d_addr, &g_ip4hdr_o.rand_d_addr, 
16, "destination IP");
                 break;
 
             case 'D':
@@ -275,15 +344,10 @@
 
             case 'e':
 #ifdef MACOS
-            fprintf(stderr, "\nWarning: You cannot specify an ethernet address 
on this operating system.\n");
-           break;
+                fprintf(stderr, "\nWarning: You cannot specify an ethernet 
address on this operating system.\n");
+                break;
 #endif
-               if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_ehdr_o.rand_s_addr = 1;
-
-               if(!(g_ehdr_o.s_addr = (u_int8_t*)strdup(optarg)))
-                   fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_ehdr_o.s_addr, &g_ehdr_o.rand_s_addr, 18, 
"source MAC");
                 g_init_type = 0;
                 g_link_layer = 1;
                 break;
@@ -291,14 +355,9 @@
             case 'E':
 #ifdef MACOS
                 fprintf(stderr, "\nWarning: You cannot specify an ethernet 
address on this operating system.\n");
-               break;
+                break;
 #endif
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_ehdr_o.rand_d_addr = 1;
-
-                if(!(g_ehdr_o.d_addr = (u_int8_t*)strdup(optarg)))
-                   fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_ehdr_o.d_addr, &g_ehdr_o.rand_d_addr, 18, 
"destination MAC");
                 g_init_type = 0;
                 g_link_layer = 1;
                 break;
@@ -329,12 +388,7 @@
                 break;
 
             case 'g':
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_i4hdr_o.rand_gw = 1;
-
-                if(!(g_i4hdr_o.gw = (u_int8_t*)strdup(optarg)))
-                    fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_i4hdr_o.gw, &g_i4hdr_o.rand_gw, 16, 
"gateway IP");
                 break;
 
             case 'G':
@@ -360,12 +414,7 @@
                 break;
 
             case 'j':
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_i4hdr_o.rand_orig_s_addr = 1;
-
-                if(!(g_i4hdr_o.orig_s_addr = (u_int8_t*)strdup(optarg)))
-                    fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_i4hdr_o.orig_s_addr, 
&g_i4hdr_o.rand_orig_s_addr, 16, "original source IP");
                 break;
 
             case 'J':
@@ -385,12 +434,7 @@
                 break;
 
             case 'l':
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_i4hdr_o.rand_orig_d_addr = 1;
-
-                if(!(g_i4hdr_o.orig_d_addr = (u_int8_t*)strdup(optarg)))
-                    fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_i4hdr_o.orig_d_addr, 
&g_i4hdr_o.rand_orig_d_addr, 16, "original destination IP");
                 break;
 
             case 'L':
@@ -472,11 +516,7 @@
                 break;
 
             case 's':
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_ip4hdr_o.rand_s_addr = 1;
-
-                if(!(g_ip4hdr_o.s_addr = (u_int8_t*)strdup(optarg)))
-                   fatal_error("Memory unavailable for: %s", optarg);
+                randomisable_str(&g_ip4hdr_o.s_addr, &g_ip4hdr_o.rand_s_addr, 
16, "source IP");
                 break;
 
             case 'S':
@@ -524,39 +564,19 @@
                 break;
 
             case 'x':
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_ahdr_o.rand_s_paddr = 1;
-
-                if(!(g_ahdr_o.s_paddr = (u_int8_t*)strdup(optarg)))
-                    fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_ahdr_o.s_paddr, &g_ahdr_o.rand_s_paddr, 
16, "ARP sender IP");
                 break;
 
             case 'X':
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_ahdr_o.rand_s_eaddr = 1;
-
-                if(!(g_ahdr_o.s_eaddr = (u_int8_t*)strdup(optarg)))
-                    fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_ahdr_o.s_eaddr, &g_ahdr_o.rand_s_eaddr, 
18, "ARP sender MAC");
                 break;
 
             case 'y':
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_ahdr_o.rand_r_paddr = 1;
-
-                if(!(g_ahdr_o.r_paddr = (u_int8_t*)strdup(optarg)))
-                    fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_ahdr_o.r_paddr, &g_ahdr_o.rand_r_paddr, 
16, "ARP receiver IP");
                 break;
 
             case 'Y':
-                if(strlen(optarg) == 1 && !strncmp(optarg, "R", 1))
-                    g_ahdr_o.rand_r_eaddr = 1;
-
-                if(!(g_ahdr_o.r_eaddr = (u_int8_t*)strdup(optarg)))
-                    fatal_error("Memory unavailable for: %s", optarg);
-
+                randomisable_str(&g_ahdr_o.r_eaddr, &g_ahdr_o.rand_r_eaddr, 
18, "ARP receiver MAC");
                 break;
 
             case 'z':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/packit-1.6.1/src/version.h.in 
new/packit-1.7/src/version.h.in
--- old/packit-1.6.1/src/version.h.in   2019-01-26 01:03:57.000000000 +0100
+++ new/packit-1.7/src/version.h.in     2020-02-05 18:34:31.000000000 +0100
@@ -24,6 +24,6 @@
  * packit official page at https://github.com/eribertomota/packit
  */
 
-#define P_VERSION "1.6"
+#define P_VERSION "1.7"
 #define P_AUTHOR "Darren Bounds, Eriberto Mota and others"
 #define P_SITE "https://github.com/eribertomota/packit";


Reply via email to