Hello community, here is the log from the commit of package dynamips for openSUSE:Factory checked in at 2020-01-06 15:21:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/dynamips (Old) and /work/SRC/openSUSE:Factory/.dynamips.new.6675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "dynamips" Mon Jan 6 15:21:26 2020 rev:24 rq:760996 version:0.2.21 Changes: -------- --- /work/SRC/openSUSE:Factory/dynamips/dynamips.changes 2018-02-20 17:55:16.426035588 +0100 +++ /work/SRC/openSUSE:Factory/.dynamips.new.6675/dynamips.changes 2020-01-06 15:21:29.216459106 +0100 @@ -1,0 +2,13 @@ +Wed Dec 25 10:32:09 UTC 2019 - Martin Hauke <[email protected]> + +- Update to version 0.2.21 + * Fix SEGV during snprintf and localtime_r. +- Update to version 0.2.20 + * New fix for segmentation fault when using localtime() +- Update to version 0.2.19 + * Fix segmentation fault when using localtime() (64-bit only). +- Update to version 0.2.18 + * Allow to reuse socket in udp_connect. + * Fix segfault when exporting startup-config. + +------------------------------------------------------------------- Old: ---- dynamips-0.2.17.tar.gz New: ---- dynamips-0.2.21.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dynamips.spec ++++++ --- /var/tmp/diff_new_pack.oimh9o/_old 2020-01-06 15:21:29.984459504 +0100 +++ /var/tmp/diff_new_pack.oimh9o/_new 2020-01-06 15:21:29.988459505 +0100 @@ -1,7 +1,7 @@ # # spec file for package dynamips # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,17 +12,17 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: dynamips -Version: 0.2.17 +Version: 0.2.21 Release: 0 Summary: Cisco router Emulator -License: GPL-2.0+ +License: GPL-2.0-or-later Group: System/Emulators/Other -Url: https://www.gns3.net +URL: https://www.gns3.net Source: https://github.com/GNS3/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Patch1: define-s390x-arch.patch BuildRequires: cmake @@ -62,9 +62,9 @@ %files %{_bindir}/%{name} %{_bindir}/nvram_export -%{_mandir}/man1/%{name}.1%{ext_man} -%{_mandir}/man1/nvram_export.1%{ext_man} -%{_mandir}/man7/hypervisor_mode.7%{ext_man} +%{_mandir}/man1/%{name}.1%{?ext_man} +%{_mandir}/man1/nvram_export.1%{?ext_man} +%{_mandir}/man7/hypervisor_mode.7%{?ext_man} %{_datadir}/doc/%{name} %changelog ++++++ dynamips-0.2.17.tar.gz -> dynamips-0.2.21.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/.circleci/config.yml new/dynamips-0.2.21/.circleci/config.yml --- old/dynamips-0.2.17/.circleci/config.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/dynamips-0.2.21/.circleci/config.yml 2019-07-12 11:41:16.000000000 +0200 @@ -0,0 +1,57 @@ +# iOS CircleCI 2.0 configuration file +version: 2 +jobs: + build: + macos: + xcode: "9.4.0" + + steps: + - checkout + + - run: + name: Set timezone and check current datetime + command: | + sudo systemsetup -settimezone Europe/Warsaw + echo "Today is $(date +"%Y-%m-%d %T")" + + - run: + name: Install libelf + command: | + brew install libelf + + - run: + name: Install cmake + command: | + brew install cmake + + - run: + name: Build dynamips + command: | + mkdir build + cd build + cmake .. + make + cd .. + + - run: + name: Gather artifacts + command: | + mkdir artifacts + mv build/unstable/dynamips artifacts/dynamips-unstable-osx + + - store_artifacts: + path: artifacts + destination: artifacts + + - run: + name: Upload nightly builds to SF + command: | + if [ -n "${RUN_NIGHTLY_BUILD}" ]; then + ssh-keyscan -H frs.sourceforge.net >> ~/.ssh/known_hosts + echo "mkdir \"/home/frs/project/gns-3/Nightly Builds/$(date +"%Y-%m-%d")/\"" | sftp [email protected] + echo -ne " + cd \"/home/frs/project/gns-3/Nightly Builds/$(date +"%Y-%m-%d")/\" + put \"artifacts/dynamips-unstable-osx\" + " | sftp [email protected] + fi + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/CMakeLists.txt new/dynamips-0.2.21/CMakeLists.txt --- old/dynamips-0.2.17/CMakeLists.txt 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/CMakeLists.txt 2019-07-12 11:41:16.000000000 +0200 @@ -25,7 +25,7 @@ message ( STATUS "CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}" ) project ( dynamips C ) -set ( DYNAMIPS_VERSION_TRAIN 0.2.17 ) +set ( DYNAMIPS_VERSION_TRAIN 0.2.21 ) set ( DYNAMIPS_VERSION_SUB ) include ( utils ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/ChangeLog new/dynamips-0.2.21/ChangeLog --- old/dynamips-0.2.17/ChangeLog 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/ChangeLog 2019-07-12 11:41:16.000000000 +0200 @@ -2983,3 +2983,39 @@ * Fix build on FreeBSD * NM-16ESW: process packets even if MAC address table is full. Fixes #72. ++--------------------+ +| Release: v0.2.18 | ++--------------------+ + +31-03-2018 +---------- + +* Allow to reuse socket in udp_connect. Fixes #87 +* Fix segfault when exporting startup-config. Fixes #68 + ++--------------------+ +| Release: v0.2.19 | ++--------------------+ + +19-01-2019 +---------- + +* Fix segmentation fault when using localtime() (64-bit only). Fixes #91 + ++--------------------+ +| Release: v0.2.20 | ++--------------------+ + +20-02-2019 +---------- + +* New fix for segmentation fault when using localtime() (64-bit only). Fixes #91 + ++--------------------+ +| Release: v0.2.21 | ++--------------------+ + +12-07-2019 +---------- + +* Fix SEGV during snprintf and localtime_r. Fixes #91 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/RELEASE-NOTES new/dynamips-0.2.21/RELEASE-NOTES --- old/dynamips-0.2.17/RELEASE-NOTES 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/RELEASE-NOTES 2019-07-12 11:41:16.000000000 +0200 @@ -1,22 +1,20 @@ Release Notes for Cisco router simulator (Dynamips) =================================================== -Version: v0.2.17 +Version: v0.2.21 -Release date: Monday, July 24st, 2017 (2017-07-24) +Release date: Friday, July 12th, 2019 (2019-07-12) -Source code: https://github.com/GNS3/dynamips/tree/v0.2.17 +Source code: https://github.com/GNS3/dynamips/tree/v0.2.21 License: GNU GPLv2 -What's New since v0.2.17 +What's New since v0.2.20 ======================== -* Set nonblocking I/O for UDP sockets -* Fix tap interface usage on FreeBSD -* Fix build on FreeBSD -* NM-16ESW: process packets even if MAC address table is full. Fixes #72. +* Fix SEGV during snprintf and localtime_r. Fixes #91 + Known Issues ============ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/appveyor.yml new/dynamips-0.2.21/appveyor.yml --- old/dynamips-0.2.17/appveyor.yml 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/appveyor.yml 2019-07-12 11:41:16.000000000 +0200 @@ -16,6 +16,14 @@ - 'appveyor DownloadFile http://www.mr511.de/software/libelf-0.8.13.tar.gz' - 'mkdir libelf && tar xvzf libelf-0.8.13.tar.gz -C libelf' - '%CYG_ROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER/libelf/libelf-0.8.13 && ./configure && make && make install' + - 'cinst 7zip.commandline' + - 'cinst winpcap' + - 'appveyor DownloadFile http://www.winpcap.org/install/bin/WpdPack_4_1_2.zip' + - 'dir' + - '7za x .\WpdPack_4_1_2.zip -o.' + - 'xcopy .\WpdPack\Lib\libwpcap.a C:\cygwin\lib' + - 'xcopy .\WpdPack\Lib\libpacket.a C:\cygwin\lib' + - 'xcopy /Y /E .\WpdPack\Include\*.* C:\cygwin\usr\include\' build_script: - '%CYG_ROOT%/bin/bash -lc "ls $APPVEYOR_BUILD_FOLDER' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/common/dev_nvram.c new/dynamips-0.2.21/common/dev_nvram.c --- old/dynamips-0.2.17/common/dev_nvram.c 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/common/dev_nvram.c 2019-07-12 11:41:16.000000000 +0200 @@ -49,19 +49,19 @@ static m_uint64_t get_current_time(cpu_gen_t *cpu) { m_uint64_t res; - struct tm *tmx; - time_t ct; - - time(&ct); - tmx = localtime(&ct); - - res = u8_to_bcd(tmx->tm_sec) << 8; - res += u8_to_bcd(tmx->tm_min) << 16; - res += u8_to_bcd(tmx->tm_hour) << 24; - res += ((m_uint64_t)(u8_to_bcd(tmx->tm_wday))) << 32; - res += ((m_uint64_t)(u8_to_bcd(tmx->tm_mday))) << 40; - res += ((m_uint64_t)(u8_to_bcd(tmx->tm_mon+1))) << 48; - res += ((m_uint64_t)(u8_to_bcd(tmx->tm_year))) << 56; + struct tm tmx; + struct timespec spec; + + clock_gettime(CLOCK_REALTIME, &spec); + gmtime_r(&spec.tv_sec, &tmx); + + res = u8_to_bcd(tmx.tm_sec) << 8; + res += u8_to_bcd(tmx.tm_min) << 16; + res += u8_to_bcd(tmx.tm_hour) << 24; + res += ((m_uint64_t)(u8_to_bcd(tmx.tm_wday))) << 32; + res += ((m_uint64_t)(u8_to_bcd(tmx.tm_mday))) << 40; + res += ((m_uint64_t)(u8_to_bcd(tmx.tm_mon+1))) << 48; + res += ((m_uint64_t)(u8_to_bcd(tmx.tm_year))) << 56; return(res); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/common/dynamips.c new/dynamips-0.2.21/common/dynamips.c --- old/dynamips-0.2.17/common/dynamips.c 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/common/dynamips.c 2019-07-12 11:41:16.000000000 +0200 @@ -73,7 +73,7 @@ const char *sw_version = DYNAMIPS_VERSION"-"JIT_ARCH; /* Software version tag */ -const char *sw_version_tag = "2017072410"; +const char *sw_version_tag = "2019071212"; /* Hypervisor */ int hypervisor_mode = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/common/fs_nvram.c new/dynamips-0.2.21/common/fs_nvram.c --- old/dynamips-0.2.17/common/fs_nvram.c 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/common/fs_nvram.c 2019-07-12 11:41:16.000000000 +0200 @@ -623,8 +623,12 @@ if (FS_NVRAM_MAGIC_STARTUP_CONFIG != startup_head.magic) return(0); // done, no startup-config and no private-config - off = fs_nvram_offset_of(fs, startup_head.end); + off = fs_nvram_offset_of(fs, startup_head.start + startup_head.len); off += fs_nvram_padding_at(fs, off); + + if (off + sizeof(private_head) > fs->len) + goto err_memory; + fs_nvram_memcpy_from(fs, off, (u_char *)&private_head, sizeof(private_head)); be_to_native_header_private(&private_head); @@ -667,7 +671,7 @@ } // read private-config - if (FS_NVRAM_MAGIC_PRIVATE_CONFIG != private_head.magic) + if (fs_nvram_offset_of(fs, private_head.start + private_head.len) > fs->len || FS_NVRAM_MAGIC_PRIVATE_CONFIG != private_head.magic) return(0); // done, no private-config if (FS_NVRAM_FORMAT_RAW == private_head.format) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/common/net.c new/dynamips-0.2.21/common/net.c --- old/dynamips-0.2.17/common/net.c 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/common/net.c 2019-07-12 11:41:16.000000000 +0200 @@ -278,7 +278,7 @@ { struct addrinfo hints,*res,*res0; struct sockaddr_storage st; - int error, sck = -1; + int error, sck = -1, yes = 1; char port_str[20]; memset(&hints,0,sizeof(hints)); @@ -333,6 +333,7 @@ } /* try to connect to remote host */ + setsockopt(sck, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)); if (!bind(sck,(struct sockaddr *)&st,res->ai_addrlen) && !connect(sck,res->ai_addr,res->ai_addrlen)) break; @@ -359,7 +360,7 @@ { struct sockaddr_in sin; struct hostent *hp; - int sck; + int sck, yes = 1; if (!(hp = gethostbyname(remote_host))) { fprintf(stderr,"udp_connect: unable to resolve '%s'\n",remote_host); @@ -375,7 +376,8 @@ memset(&sin,0,sizeof(sin)); sin.sin_family = PF_INET; sin.sin_port = htons(local_port); - + + setsockopt(sck, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)); if (bind(sck,(struct sockaddr *)&sin,sizeof(sin)) < 0) { perror("udp_connect: bind"); close(sck); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/common/utils.c new/dynamips-0.2.21/common/utils.c --- old/dynamips-0.2.17/common/utils.c 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/common/utils.c 2019-07-12 11:41:16.000000000 +0200 @@ -257,19 +257,17 @@ /* Logging function */ void m_flog(FILE *fd,char *module,char *fmt,va_list ap) { - struct timeval now; + struct timespec spec; struct tm tmn; - time_t ct; char buf[256]; if (fd != NULL) { - gettimeofday(&now,0); - ct = now.tv_sec; - localtime_r(&ct,&tmn); + clock_gettime(CLOCK_REALTIME, &spec); + gmtime_r(&spec.tv_sec, &tmn); strftime(buf,sizeof(buf),"%b %d %H:%M:%S",&tmn); - fprintf(fd,"%s.%03ld %s: ",buf,(long)now.tv_usec/1000,module); + fprintf(fd,"%s.%03ld %s: ",buf,(long)spec.tv_nsec/1000000,module); vfprintf(fd,fmt,ap); fflush(fd); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dynamips-0.2.17/stable/cpu.c new/dynamips-0.2.21/stable/cpu.c --- old/dynamips-0.2.17/stable/cpu.c 2017-07-24 13:37:51.000000000 +0200 +++ new/dynamips-0.2.21/stable/cpu.c 2019-07-12 11:41:16.000000000 +0200 @@ -123,9 +123,61 @@ { char buffer[256]; va_list ap; + char *i; + char *buf; + + buffer[0] = 'C'; + buffer[1] = 'P'; + buffer[2] = 'U'; + + switch (cpu->id){ + case 0: + buffer[3] = '0'; + break; + case 1: + buffer[3] = '1'; + break; + case 2: + buffer[3] = '2'; + break; + case 3: + buffer[3] = '3'; + break; + case 4: + buffer[3] = '4'; + break; + case 5: + buffer[3] = '5'; + break; + case 6: + buffer[3] = '6'; + break; + case 7: + buffer[3] = '7'; + break; + case 8: + buffer[3] = '8'; + break; + case 9: + buffer[3] = '9'; + break; + default: + buffer[3] = '-'; + break; + } + + buffer[4] = ':'; + buffer[5] = ' '; + + buf = &buffer[6]; + for(i = module; *i != '\0'; ++i) { + *buf = *i; + ++buf; + } + + *buf = '\0'; va_start(ap,format); - snprintf(buffer,sizeof(buffer),"CPU%u: %s",cpu->id,module); vm_flog(cpu->vm,buffer,format,ap); va_end(ap); }
