From 64955e59756c102eb7cab763bf1037eb9b042f5e Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Wed, 5 Oct 2022 17:13:47 +0200 Subject: [PATCH 01/22] Revert initscript modification for f36 and older This reverts commit 2c76e0d4d85066a8ab98a0cd506e88f172c702df. --- ipset-config | 5 - ipset.service | 7 +- ipset.spec | 19 +- ipset.start-stop | 504 +++++++++++++++++------------------------------ 4 files changed, 181 insertions(+), 354 deletions(-) delete mode 100644 ipset-config diff --git a/ipset-config b/ipset-config deleted file mode 100644 index 758f40b..0000000 --- a/ipset-config +++ /dev/null @@ -1,5 +0,0 @@ -# Save current ipsets on stop. -# Value: yes|no, default: no -# Saves all ipsets to /etc/sysconfig/ipset.d/ if service gets stopped -# (e.g. on system shutdown). -IPSET_SAVE_ON_STOP="no" diff --git a/ipset.service b/ipset.service index 65c3121..f4a0802 100644 --- a/ipset.service +++ b/ipset.service @@ -9,11 +9,10 @@ RemainAfterExit=yes ExecStart=/usr/libexec/ipset/ipset.start-stop start ExecStop=/usr/libexec/ipset/ipset.start-stop stop ExecReload=/usr/libexec/ipset/ipset.start-stop reload -# Save current ipset entries on stop. +# Save current ipset entries on stop/restart. # Value: yes|no, default: no -# Saves all ipsets to /etc/sysconfig/ipset if ipset gets stopped -Environment=IPSET_SAVE_ON_STOP=no -EnvironmentFile=-/etc/sysconfig/ipset-config +# Saves all ipsets to /etc/ipset/ipset if ipset gets stopped +Environment=IPSET_SAVE_ON_STOP=no IPSET_SAVE_ON_RESTART=no [Install] WantedBy=basic.target diff --git a/ipset.spec b/ipset.spec index 5766288..6c1c108 100644 --- a/ipset.spec +++ b/ipset.spec @@ -104,10 +104,6 @@ install -c -m 644 %{SOURCE1} %{buildroot}/%{_unitdir} install -d -m 755 %{buildroot}%{_libexecdir}/%{name} install -c -m 755 %{SOURCE2} %{buildroot}%{_libexecdir}/%{name} -# install ipset-config -install -d -m 755 %{buildroot}%{_sysconfdir}/sysconfig -install -c -m 600 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-config - # Create directory for configuration mkdir -p %{buildroot}%{_sysconfdir}/%{name} @@ -124,18 +120,6 @@ fi %post service %systemd_post %{name}.service -if [[ -f /etc/ipset/ipset ]] && [[ ! -f /etc/sysconfig/ipset ]]; then - mv /etc/ipset/ipset /etc/sysconfig/ipset - ln -s /etc/sysconfig/ipset /etc/ipset/ipset - echo "Warning: ipset save location has moved to /etc/sysconfig" -fi -[[ -f /etc/sysconfig/iptables-config ]] && . /etc/sysconfig/iptables-config -[[ -f /etc/sysconfig/ip6tables-config ]] && . /etc/sysconfig/ip6tables-config -if [[ ${IPTABLES_SAVE_ON_STOP} == yes ]] || \ - [[ ${IP6TABLES_SAVE_ON_STOP} == yes ]]; then - echo "Warning: ipset no longer saves automatically when iptables does" - echo " must enable explicitly in /etc/sysconfig/ipset-config" -fi %preun service if [[ $1 -eq 0 && -n $(lsmod | grep "^xt_set ") ]]; then @@ -168,9 +152,8 @@ fi %files service %{_unitdir}/%{name}.service %dir %{_libexecdir}/%{name} -%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/ipset-config -%ghost %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/sysconfig/ipset %attr(0755,root,root) %{_libexecdir}/%{name}/%{name}.start-stop +%dir %{_sysconfdir}/%{name} %changelog diff --git a/ipset.start-stop b/ipset.start-stop index 377beed..da21890 100644 --- a/ipset.start-stop +++ b/ipset.start-stop @@ -1,359 +1,209 @@ -#!/bin/sh +#!/bin/bash # # ipset Start and stop ipset firewall sets # -# config: /etc/sysconfig/ipset-config +# config: /etc/ipset/ipset +# -IPSET_BIN=/usr/sbin/ipset -IPSET_CONFIG=/etc/sysconfig/ipset-config -IPSET_DATA_COMPAT=/etc/sysconfig/ipset -IPSET_DATA_COMPAT_BACKUP=${IPSET_DATA_COMPAT}.save -IPSET_DATA_DIR=/etc/sysconfig/ipset.d -IPSET_DATA_DIR_BACKUP=${IPSET_DATA_DIR}.save -IPSET_DATA_SAVED_FLAG=${IPSET_DATA_DIR}/.saved -IPSET_LOCK=/run/ipset.lock -IPSET_RUN=/run/ipset.run -CLEAN_FILES="" +IPSET=ipset +IPSET_BIN=/usr/sbin/${IPSET} +IPSET_DATA=/etc/${IPSET}/${IPSET} -trap "rm -rf \${CLEAN_FILES}" EXIT +IPTABLES_CONFIG=/etc/sysconfig/iptables-config +IP6TABLES_CONFIG=${IPTABLES_CONFIG/iptables/ip6tables} -info() { - echo "ipset: ${*}" >&2 +TMP_FIFO=/tmp/${IPSET}.$$ + +if [[ ! -x ${IPSET_BIN} ]]; then + echo "${IPSET_BIN} does not exist." + exit 5 +fi + +CLEAN_FILES=TMP_FIFO +trap "rm -f \$CLEAN_FILES" EXIT + +# Default ipset configuration: +[[ -z $IPSET_SAVE_ON_STOP ]] && IPSET_SAVE_ON_STOP=no # Overridden by ip(6)tables IP(6)TABLES_SAVE_ON_STOP +[[ -z $IPSET_SAVE_ON_RESTART ]] && IPSET_SAVE_ON_RESTART=no # Overridden by ip(6)tables IP(6)TABLES_SAVE_ON_RESTART + +# Load iptables configuration(s) +[[ -f "$IPTABLES_CONFIG" ]] && . "$IPTABLES_CONFIG" +[[ -f "$IP6TABLES_CONFIG" ]] && . "$IP6TABLES_CONFIG" + +# It doesn't make sense to save iptables config and not our config +[[ ${IPTABLES_SAVE_ON_STOP} = yes || ${IP6TABLES_SAVE_ON_STOP} = yes ]] && IPSET_SAVE_ON_STOP=yes +[[ ${IPTABLES_SAVE_ON_RESTART} = yes || ${IP6TABLES_SAVE_ON_RESTART} = yes ]] && IPSET_SAVE_ON_RESTART=yes + +check_can_unload() { + # If the xt_set module is loaded and can't be unloaded, then iptables is + # using ipsets, so refuse to stop the service. + if [[ -n $(lsmod | grep "^xt_set ") ]]; then + rmmod xt_set 2>/dev/null + [[ $? -ne 0 ]] && echo Current iptables configuration requires ipsets && return 1 + fi + + return 0 } -warn() { - echo "<4>ipset: ${*}" >&2 +flush_n_delete() { + local ret=0 set + + # Flush sets + ${IPSET_BIN} flush + let ret+=$? + + # Delete ipset sets. If we don't do them individually, then none + # will be deleted unless they all can be. + for set in $(${IPSET_BIN} list -name); do + ${IPSET_BIN} destroy 2>/dev/null + [[ $? -ne 0 ]] && ret=1 + done + + return $ret } -err() { - echo "<3>ipset: ${*}" >&2 +start_clean() +{ + mkfifo -m go= "${TMP_FIFO}" + [[ $? -ne 0 ]] && return 1 + + # Get the lists of sets in current(old) config and new config + old_sets="$(${IPSET_BIN} list -name | sort -u)" + new_sets="$(grep ^create "${IPSET_DATA}" | cut -d " " -f 2 | sort -u)" + + # List of sets no longer wanted + drop_sets="$( printf "%s\n" "${old_sets}" > "${TMP_FIFO}" & + printf "%s\n" "${new_sets}" | comm -23 "${TMP_FIFO}" - + )" + + # Get rid of sets no longer needed + # Unfortunately -! doesn't work for destroy, so we have to do it a command at a time + for dset in $drop_sets; do + ipset destroy $dset 2>/dev/null + # If it won't go - ? in use by iptables, just clear it + [[ $? -ne 0 ]] && ipset flush $dset + done + + # Now delete the set members no longer required + ${IPSET_BIN} save | grep "^add " | sort >${TMP_FIFO} & + grep "^add " ${IPSET_DATA} | sort | comm -23 ${TMP_FIFO} - | sed -e "s/^add /del /" \ + | ${IPSET_BIN} restore -! + + # At last we can add the set members we haven't got + ipset restore -! <${IPSET_DATA} + + rm ${TMP_FIFO} + + return 0 } -[ -x ${IPSET_BIN} ] || { err "Cannot execute ${IPSET_BIN}"; exit 1; } +start() { + # Do not start if there is no config file. + [[ ! -f "$IPSET_DATA" ]] && echo "Loaded with no configuration" && return 0 -# Source ipset configuration -# shellcheck source=ipset-config -[ -f ${IPSET_CONFIG} ] && . ${IPSET_CONFIG} + # We can skip the first bit and do a simple load if + # there is no current ipset configuration + res=1 + if [[ -n $(${IPSET_BIN} list -name) ]]; then + # The following may fail for some bizarre reason + start_clean + res=$? -set -f + [[ $res -ne 0 ]] && echo "Some old configuration may remain" + fi -lock() { - CLEAN_FILES="${CLEAN_FILES} ${IPSET_LOCK}" - until mkdir ${IPSET_LOCK} 2>/dev/null; do :; done -} + # res -ne 0 => either start_clean failed, or we didn't need to run it + if [[ $res -ne 0 ]]; then + # This is the easy way to start but would leave any old + # entries still configured. Still, better than nothing - + # but fine if we had no config + ${IPSET_BIN} restore -! <${IPSET_DATA} + res=$? + fi -save() { - fail=0 + if [[ $res -ne 0 ]]; then + return 1 + fi - # Make backups of existing configuration first, if any - [ -d ${IPSET_DATA_DIR} ] && mv -Tf ${IPSET_DATA_DIR} ${IPSET_DATA_DIR_BACKUP} - [ -f ${IPSET_DATA_COMPAT} ] && mv -Tf ${IPSET_DATA_COMPAT} ${IPSET_DATA_COMPAT_BACKUP} - - rm -f ${IPSET_DATA_SAVED_FLAG} - - # Save each set in a separate file - mkdir -p ${IPSET_DATA_DIR} - chmod 0700 ${IPSET_DATA_DIR} - IFS=" -" - for set in $(${IPSET_BIN} list -n -t); do - # Empty name allowed, use ".set" as suffix. 'ipset save' doesn't - # quote set names with spaces: if we have a space in the name, - # work around this by quoting it ourselves in the output. - # shellcheck disable=SC2003 # No POSIX equivalent to expr index - if expr index "${set}" " " >/dev/null; then - :> "${IPSET_DATA_DIR}/${set}.set" - for line in $(${IPSET_BIN} save "${set}"); do - create=0 - echo "${line}" | grep -q "^create " && create=1 - if [ $create -eq 1 ]; then - line=${line#create *} - else - line=${line#add *} - fi - line=${line#${set} *} - set="$(echo "${set}" | sed 's/"/\\"/g')" - if [ $create -eq 1 ]; then - echo "create \"${set}\" ${line}" >> "${IPSET_DATA_DIR}/${set}.set" - else - echo "add \"${set}\" ${line}" >> "${IPSET_DATA_DIR}/${set}.set" - fi - done - else - ${IPSET_BIN} save "${set}" > "${IPSET_DATA_DIR}/${set}.set" || fail=1 - fi - [ -f "${IPSET_DATA_DIR}/${set}.set" ] && chmod 600 "${IPSET_DATA_DIR}/${set}.set" - [ $fail -eq 1 ] && err "Cannot save set ${set}" && unset IFS && return 1 - done - touch ${IPSET_DATA_SAVED_FLAG} || { unset IFS; return 1; } - unset IFS - - # Done: remove backups - rm -rf ${IPSET_DATA_DIR_BACKUP} - rm -rf ${IPSET_DATA_COMPAT_BACKUP} - - return 0 -} - -# Generate a grep regexp matching abbreviated command forms. E.g., for create: -# \(c\|cr\|cre\|crea\|creat\|create\) -cmd_short_expr() { - out= - cmd_len=1 - while [ "${cmd_len}" -le "${#1}" ]; do - [ -z "${out}" ] && out='\(' || out="${out}"'\|' - # shellcheck disable=SC2003 # No POSIX equivalent to expr substr - out="${out}$(expr substr "${1}" 1 "${cmd_len}")" - cmd_len=$((cmd_len + 1)) - done - echo "${out}"'\)' -} - -ipset_restore() { - file="${1}" - - retfile="$(mktemp -q /tmp/ipset.XXXXXX)" - CLEAN_FILES="${CLEAN_FILES} ${retfile}" - - # If restore fails due to invalid lines, remove them and retry - while ! restore_err="$( (${IPSET_BIN} -f "${file}" -! restore 2>&1; echo $? >"${retfile}") | head -n1; exit "$(cat "${retfile}")" )"; do - warn "${restore_err}" - case ${restore_err#*: } in - "No command specified"*) - line="$(grep -m1 -n "^${restore_err##* }" "${file}")" - line="${line%:*}" - ;; - "Missing second mandatory argument to command "*) - cmd="${restore_err##* }" - cmd_expr="$(cmd_short_expr "${cmd}")" - line="$(grep -n '^'"${cmd_expr}" "${file}" | grep -m1 -v '^[0-9]\+\:'"${cmd_expr}"'[[:blank:]]\+[^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+')" - line="${line%:*}" - ;; - "Missing mandatory argument to command "*) - cmd="${restore_err##* }" - cmd_expr="$(cmd_short_expr "${cmd}")" - line="$(grep -n '^'"${cmd_expr}" "${file}" | grep -m1 -v '^[0-9]\+\:'"${cmd_expr}"'[[:blank:]]\+[^[:blank:]]\+')" - line="${line%:*}" - ;; - "Command "*"is invalid in restore mode"*) - restore_err_cmd="${restore_err#*: }" - restore_err_cmd="${restore_err_cmd#*\`}" - restore_err_cmd="${restore_err_cmd%%\'*}" - cmd="${restore_err_cmd##* }" - cmd_expr="$(cmd_short_expr "${cmd}")" - line="$(grep -m1 -ne '^'"${cmd_expr}"'[[:blank:]]\+' -e '^'"${restore_err_cmd}"'$' "${file}")" - line="${line%:*}" - ;; - "Error in line "*) - line="${restore_err%: *}" - line="${line##* }" - ;; - *) - rm "${retfile}" - CLEAN_FILES="${CLEAN_FILES%* ${retfile}}" - return 1 - ;; - esac - - [ -z "${line}" ] && return 1 - - warn "Skipped invalid entry: $(sed "${line}q;d" "${file}")" - sed -i -e "${line}d" "${file}" - - [ -s "${file}" ] || return 1 - done - - rm "${retfile}" - CLEAN_FILES="${CLEAN_FILES%* ${retfile}}" -} - -load() { - if [ -f ${IPSET_DATA_SAVED_FLAG} ]; then - # If we have a cleanly saved directory with all sets, we can - # delete any left-overs and use it - rm -rf ${IPSET_DATA_DIR_BACKUP} - rm -f ${IPSET_DATA_COMPAT_BACKUP} - else - # If sets weren't cleanly saved, restore from backups - [ -d ${IPSET_DATA_DIR_BACKUP} ] && rm -rf ${IPSET_DATA_DIR} && mv -Tf ${IPSET_DATA_DIR_BACKUP} ${IPSET_DATA_DIR} - [ -f ${IPSET_DATA_COMPAT_BACKUP} ] && rm -f ${IPSET_DATA_COMPAT} && mv -Tf ${IPSET_DATA_COMPAT_BACKUP} ${IPSET_DATA_COMPAT} - fi - - if [ ! -d ${IPSET_DATA_DIR} ] && [ ! -f ${IPSET_DATA_COMPAT} ]; then - info "No existing configuration available, none loaded" - touch ${IPSET_RUN} - return - fi - - # Merge all sets into temporary file - merged="$(mktemp -q /tmp/ipset.XXXXXX)" - CLEAN_FILES="${CLEAN_FILES} ${merged}" - chmod 600 "${merged}" - set +f - if [ -d ${IPSET_DATA_DIR} ]; then - # Copy create commands from each saved set first, then the rest: - # list:set entries depend on other sets, so make sure they all - # get created first - for f in "${IPSET_DATA_DIR}"/*; do - [ "${f}" = "${IPSET_DATA_DIR}/*" ] && break - [ -f "${f}" ] || continue - grep '^c' "${f}" >> "${merged}" - done - for f in "${IPSET_DATA_DIR}"/*; do - [ "${f}" = "${IPSET_DATA_DIR}/*" ] && break - [ -f "${f}" ] || continue - grep -v '^c' "${f}" >> "${merged}" - done - fi - set -f - [ -f ${IPSET_DATA_COMPAT} ] && cat ${IPSET_DATA_COMPAT} >> "${merged}" - - # Drop sets that aren't in saved data, mark conflicts with existing sets - conflicts="" - IFS=" -" - for set in $(${IPSET_BIN} list -n -t); do - grep -q "^create ${set} " "${merged}" && conflicts="${conflicts}|${set}" && continue - - # We can't destroy the set if it's in use, flush it instead - if ! ${IPSET_BIN} destroy "${set}" 2>/dev/null; then - ${IPSET_BIN} flush "${set}" - fi - done - unset IFS - conflicts="${conflicts#|*}" - - # Common case: if we have no conflicts, just restore in one shot - if [ -z "${conflicts}" ]; then - if ! ipset_restore "${merged}"; then - err "Failed to restore configured sets" - exit 1 - fi - rm "${merged}" - CLEAN_FILES="${CLEAN_FILES%* ${merged}}" - touch ${IPSET_RUN} - return - fi - - # Find a salt for md5sum that makes names of saved sets unique - salt=0 - while true; do - unique=1 - IFS=" -" - for set in $(${IPSET_BIN} list -n -t); do - if grep -q "^create $(echo "${salt}${set}" | md5sum | head -c31) " "${merged}"; then - unique=0 - break - fi - done - unset IFS - [ ${unique} -eq 1 ] && break - salt=$((salt + 1)) - done - - # Add sets, mangling names for conflicting sets - mangled="$(mktemp -q /tmp/ipset.XXXXXX)" - CLEAN_FILES="${CLEAN_FILES} ${mangled}" - chmod 600 "${mangled}" - - cat "${merged}" > "${mangled}" - IFS='|' - for set in ${conflicts}; do - new_name=$(echo "${salt}${set}" | md5sum | head -c31) - echo "s/^(add|create) $set /\1 $new_name /" - done | sed -i -r -f - "${mangled}" - unset IFS - if ! ipset_restore "${mangled}"; then - err "Failed to restore configured sets" - exit 1 - fi - - rm "${mangled}" - CLEAN_FILES="${CLEAN_FILES%* ${mangled}}" - - # Swap and delete old sets - IFS='|' - for set in ${conflicts}; do - mangled="$(echo "${salt}${set}" | md5sum | head -c31)" - if ! ${IPSET_BIN} swap "${set}" "${mangled}" 2>/dev/null; then - # This fails if set types are different: try to destroy - # existing set - if ! ${IPSET_BIN} destroy "${set}" 2>/dev/null; then - # Conflicting set is in use, we can only warn - # and flush the existing set - err "Cannot load set \"${set}\", set with same name and conflicting type in use" - ${IPSET_BIN} flush "${set}" - ${IPSET_BIN} destroy "${mangled}" - else - ${IPSET_BIN} rename "${mangled}" "${set}" - fi - else - ${IPSET_BIN} destroy "${mangled}" - fi - done - unset IFS - - rm "${merged}" - CLEAN_FILES="${CLEAN_FILES%* ${merged}}" - touch ${IPSET_RUN} -} - -cleanup() { - ${IPSET_BIN} flush || err "Failed to flush sets" - - # Try to destroy all sets at once. This will fail if some are in use, - # destroy all the other ones in that case - ${IPSET_BIN} destroy 2>/dev/null && return - IFS=" -" - for set in $(${IPSET_BIN} list -n -t); do - if ! ${IPSET_BIN} destroy "${set}"; then - err "Failed to destroy set ${set}" - fi - done - unset IFS + return 0 } stop() { - [ -f ${IPSET_RUN} ] || { info "Not running"; return 0; } - [ "${IPSET_SAVE_ON_STOP}" = "yes" ] && { save || err "Failed to save sets"; } + # Nothing to stop if ip_set module is not loaded. + lsmod | grep -q "^ip_set " + [[ $? -ne 0 ]] && return 6 - # Nothing to stop if the ip_set module is not loaded - lsmod | grep -q "^ip_set " || { info "Not running"; rm ${IPSET_RUN}; return 0; } + flush_n_delete + [[ $? -ne 0 ]] && echo Warning: Not all sets were flushed/deleted - # If the xt_set module is in use, then iptables is using ipset, so - # refuse to stop the service - if mod="$(lsmod | grep ^xt_set)"; then - if [ "$(echo "${mod}" | tr -s ' ' | cut -d' ' -f3)" != "0" ]; then - err "Current iptables configuration requires ipset" && return 1 - fi - fi - - cleanup - - rm ${IPSET_RUN} - return 0 + return 0 } -lock +save() { + # Do not save if ip_set module is not loaded. + lsmod | grep -q "^ip_set " + [[ $? -ne 0 ]] && return 6 + + [[ -z $(${IPSET_BIN} list -name) ]] && return 0 + + ret=0 + TMP_FILE=$(/bin/mktemp -q /tmp/$IPSET.XXXXXX) \ + && CLEAN_FILES+=" $TMP_FILE" \ + && chmod 600 "$TMP_FILE" \ + && ${IPSET_BIN} save > $TMP_FILE 2>/dev/null \ + && [[ -s $TMP_FILE ]] \ + || ret=1 + + if [[ $ret -eq 0 ]]; then + # No need to do anything if the files are the same + if [[ ! -f $IPSET_DATA ]]; then + mv $TMP_FILE $IPSET_DATA && chmod 600 $IPSET_DATA || ret=1 + else + diff -q $TMP_FILE $IPSET_DATA >/dev/null + + if [[ $? -ne 0 ]]; then + if [[ -f $IPSET_DATA ]]; then + cp -f --preserve=timestamps $IPSET_DATA $IPSET_DATA.save \ + && chmod 600 $IPSET_DATA.save \ + || ret=1 + fi + if [[ $ret -eq 0 ]]; then + cp -f --preserve=timestamps $TMP_FILE $IPSET_DATA \ + && chmod 600 $IPSET_DATA \ + || ret=1 + fi + fi + fi + fi + + rm -f $TMP_FILE + return $ret +} + + case "$1" in -start) - load + start) + start + RETVAL=$? ;; -stop) + stop) + check_can_unload || exit 1 + [[ $IPSET_SAVE_ON_STOP = yes ]] && save stop + RETVAL=$? + [[ $RETVAL -eq 6 ]] && echo "${IPSET}: not running" && exit 0 ;; -reload) - cleanup - load + reload) + [[ $IPSET_SAVE_ON_RESTART = yes ]] && save + stop + RETVAL=$? + [[ $RETVAL -eq 6 ]] && echo "${IPSET}: not running" && exit 0 + start + RETVAL=$? ;; -save) - save - ;; -*) - info "Usage: $0 {start|stop|reload|save}" + *) + echo "Usage: $IPSET {start|stop|reload}" >&2 exit 1 esac -exit $? +exit $RETVAL From 348bd095bb1640f5c608927fabeec7a75da9328b Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Thu, 6 Oct 2022 09:23:29 +0200 Subject: [PATCH 02/22] Update changelog --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index 6c1c108..54f6644 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.15 -Release: 5%{?dist} +Release: 5%{?dist}.1 Summary: Manage Linux IP sets License: GPLv2 @@ -157,6 +157,9 @@ fi %changelog +* Thu Oct 06 2022 Nicolas Chauvet - 7.15-5.1 +- Revert initscript modification + * Tue Aug 23 2022 Nicolas Chauvet - 7.15-5 - Backport upstream patches - rhbz#2117654 ipset-translate does not work with IPv6 sets From 7445cd3c9f32ace58b8225ab640a5d24dbb79ca9 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Thu, 6 Oct 2022 11:25:53 +0200 Subject: [PATCH 03/22] Fixup ipset-config revert --- ipset.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index 54f6644..ee618cc 100644 --- a/ipset.spec +++ b/ipset.spec @@ -8,7 +8,6 @@ URL: http://ipset.netfilter.org/ Source0: %{url}/%{name}-%{version}.tar.bz2 Source1: %{name}.service Source2: %{name}.start-stop -Source3: %{name}-config Patch0: 0001-Fix-typo-in-ipset-translate-man-page.patch Patch1: 0002-Fix-IPv6-sets-nftables-translation.patch Patch2: 0003-ipset-translate-allow-invoking-with-a-path-name.patch From ea2bf802716251d81fb53c360a66899f402b3177 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Fri, 2 Dec 2022 15:55:31 +0100 Subject: [PATCH 04/22] Update to 7.16 --- ipset.spec | 10 +++++----- sources | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ipset.spec b/ipset.spec index 5766288..7d45a64 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset -Version: 7.15 -Release: 5%{?dist} +Version: 7.16 +Release: 1%{?dist} Summary: Manage Linux IP sets License: GPLv2 @@ -9,9 +9,6 @@ Source0: %{url}/%{name}-%{version}.tar.bz2 Source1: %{name}.service Source2: %{name}.start-stop Source3: %{name}-config -Patch0: 0001-Fix-typo-in-ipset-translate-man-page.patch -Patch1: 0002-Fix-IPv6-sets-nftables-translation.patch -Patch2: 0003-ipset-translate-allow-invoking-with-a-path-name.patch BuildRequires: libmnl-devel BuildRequires: automake @@ -174,6 +171,9 @@ fi %changelog +* Fri Dec 02 2022 Nicolas Chauvet - 7.16-1 +- Update to 7.16 + * Tue Aug 23 2022 Nicolas Chauvet - 7.15-5 - Backport upstream patches - rhbz#2117654 ipset-translate does not work with IPv6 sets diff --git a/sources b/sources index f2cddcc..e6d91a7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ipset-7.15.tar.bz2) = 0fc936d971c30a0925c585d506c8840e782fdaeec09bc8fd249e874fe838fa55a4dbb697f6e1423a6769abf07a1ce2195abc37cb641e8e4ad70f1b4c7130916a +SHA512 (ipset-7.16.tar.bz2) = e69ddee956f0922c8e08e7e5d358d6b5b24178a9f08151b20957cc3465baaba9ecd6aa938ae157f2cd286ccd7f0b7a279cfd89cec2393a00b43e4d945c275307 From 22c1fd017f7af75afe41843f57e2f5202b98c001 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Mon, 2 Jan 2023 11:14:59 +0100 Subject: [PATCH 05/22] Update to 7.17 --- ipset.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ipset.spec b/ipset.spec index 7d45a64..e784cfd 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,5 +1,5 @@ Name: ipset -Version: 7.16 +Version: 7.17 Release: 1%{?dist} Summary: Manage Linux IP sets @@ -171,6 +171,9 @@ fi %changelog +* Mon Jan 02 2023 Nicolas Chauvet - 7.17-1 +- Update to 7.17 + * Fri Dec 02 2022 Nicolas Chauvet - 7.16-1 - Update to 7.16 diff --git a/sources b/sources index e6d91a7..602f1fb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ipset-7.16.tar.bz2) = e69ddee956f0922c8e08e7e5d358d6b5b24178a9f08151b20957cc3465baaba9ecd6aa938ae157f2cd286ccd7f0b7a279cfd89cec2393a00b43e4d945c275307 +SHA512 (ipset-7.17.tar.bz2) = e308a0d7707ccf7d0cb06a32cf9a822f97862e007abdbab8a91a5a0d5bfbd9f2fb9a3f5e8f36b250ec0d565438c8648a31e8e5b45d8205a76558e90f46e6e597 From cbda24853d2e4f3b0caee24d0345a81c1923fcec Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 13:18:58 +0000 Subject: [PATCH 06/22] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index e784cfd..4aa0cba 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.17 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Manage Linux IP sets License: GPLv2 @@ -171,6 +171,9 @@ fi %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 7.17-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Mon Jan 02 2023 Nicolas Chauvet - 7.17-1 - Update to 7.17 From 3ea856c0e04c86339a93bba0605ebb097f4c0c82 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 07:35:10 +0000 Subject: [PATCH 07/22] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index 4aa0cba..73ccd76 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.17 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Manage Linux IP sets License: GPLv2 @@ -171,6 +171,9 @@ fi %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 7.17-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Thu Jan 19 2023 Fedora Release Engineering - 7.17-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From e39a6f6c547bfad8b1aed9a91d43af1ab0f890bd Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 11 Aug 2023 21:13:50 +0200 Subject: [PATCH 08/22] Convert license to SPDX format Signed-off-by: Phil Sutter --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index 73ccd76..eeae4ab 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.17 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Manage Linux IP sets License: GPLv2 @@ -171,6 +171,9 @@ fi %changelog +* Fri Aug 11 2023 Phil Sutter - 7.17-4 +- Convert license to SPDX format + * Thu Jul 20 2023 Fedora Release Engineering - 7.17-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 3b8395e7e676a8eec4045286172c42b20a3e5bac Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 11 Aug 2023 21:13:57 +0200 Subject: [PATCH 09/22] Convert license to SPDX format Signed-off-by: Phil Sutter --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index eeae4ab..5f9152d 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.17 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Manage Linux IP sets License: GPLv2 @@ -171,6 +171,9 @@ fi %changelog +* Fri Aug 11 2023 Phil Sutter - 7.17-5 +- Convert license to SPDX format + * Fri Aug 11 2023 Phil Sutter - 7.17-4 - Convert license to SPDX format From ff45e749b21d9e3838ecfab581dc367380551f4f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 11 Aug 2023 21:14:14 +0200 Subject: [PATCH 10/22] Convert license to SPDX format Signed-off-by: Phil Sutter --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index 5f9152d..6ed9e26 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.17 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Manage Linux IP sets License: GPLv2 @@ -171,6 +171,9 @@ fi %changelog +* Fri Aug 11 2023 Phil Sutter - 7.17-6 +- Convert license to SPDX format + * Fri Aug 11 2023 Phil Sutter - 7.17-5 - Convert license to SPDX format From 904bbed4ddb8ee3bfa98d1928ad30fb948f244ac Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 11 Aug 2023 21:14:56 +0200 Subject: [PATCH 11/22] Convert license to SPDX format Signed-off-by: Phil Sutter --- ipset.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ipset.spec b/ipset.spec index 6ed9e26..9af674c 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,9 +1,9 @@ Name: ipset Version: 7.17 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Manage Linux IP sets -License: GPLv2 +License: GPL-2.0-only URL: http://ipset.netfilter.org/ Source0: %{url}/%{name}-%{version}.tar.bz2 Source1: %{name}.service @@ -171,6 +171,9 @@ fi %changelog +* Fri Aug 11 2023 Phil Sutter - 7.17-7 +- Convert license to SPDX format + * Fri Aug 11 2023 Phil Sutter - 7.17-6 - Convert license to SPDX format From 1d4434c8b293e6d4c9d0d68afe0b6cb279a0be37 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Mon, 23 Oct 2023 13:53:29 +0200 Subject: [PATCH 12/22] Update to 7.19 --- ipset.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ipset.spec b/ipset.spec index 9af674c..6949b49 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset -Version: 7.17 -Release: 7%{?dist} +Version: 7.19 +Release: 1%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -171,6 +171,9 @@ fi %changelog +* Mon Oct 23 2023 Nicolas Chauvet - 7.19-1 +- Update to 7.19 + * Fri Aug 11 2023 Phil Sutter - 7.17-7 - Convert license to SPDX format diff --git a/sources b/sources index 602f1fb..3f5e652 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ipset-7.17.tar.bz2) = e308a0d7707ccf7d0cb06a32cf9a822f97862e007abdbab8a91a5a0d5bfbd9f2fb9a3f5e8f36b250ec0d565438c8648a31e8e5b45d8205a76558e90f46e6e597 +SHA512 (ipset-7.19.tar.bz2) = 0f4252e6d967b0f130a2c7a0307b17c6b7d48336e86b2f838ea176f5faaa0c9bbbf273060906b43d91e9b38a9f33c18918e33d02292839a6bc321181d5d7f84e From 10bf621d6db1c5478cb4782049c34e35da8804c3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jan 2024 23:14:58 +0000 Subject: [PATCH 13/22] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index 6949b49..0c7862f 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.19 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -171,6 +171,9 @@ fi %changelog +* Sat Jan 20 2024 Fedora Release Engineering - 7.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Mon Oct 23 2023 Nicolas Chauvet - 7.19-1 - Update to 7.19 From a657c361cb6d07c4d388d22cbd60e1a892667846 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jan 2024 22:53:46 +0000 Subject: [PATCH 14/22] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index 0c7862f..a5687a5 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.19 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -171,6 +171,9 @@ fi %changelog +* Wed Jan 24 2024 Fedora Release Engineering - 7.19-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sat Jan 20 2024 Fedora Release Engineering - 7.19-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From d87bd16c2c84a448940705512165126deba45721 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Thu, 1 Feb 2024 14:20:15 +0100 Subject: [PATCH 15/22] Update to 7.20 --- ipset.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ipset.spec b/ipset.spec index a5687a5..3400789 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset -Version: 7.19 -Release: 3%{?dist} +Version: 7.20 +Release: 1%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -171,6 +171,9 @@ fi %changelog +* Thu Feb 01 2024 Nicolas Chauvet - 7.20-1 +- Update to 7.20 + * Wed Jan 24 2024 Fedora Release Engineering - 7.19-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 3f5e652..4e000ad 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ipset-7.19.tar.bz2) = 0f4252e6d967b0f130a2c7a0307b17c6b7d48336e86b2f838ea176f5faaa0c9bbbf273060906b43d91e9b38a9f33c18918e33d02292839a6bc321181d5d7f84e +SHA512 (ipset-7.20.tar.bz2) = d0b87ab889987a3febeaf3d73099a262aca86160878258b3bd1be064e52b55baa90601804b30ad3bbb363066c9fc1bbdfe8bc100414f801729215a892e186fc6 From 411d25f4a63f95ff24dd654e1ee8624f5434644d Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Mon, 12 Feb 2024 13:17:00 +0100 Subject: [PATCH 16/22] Update to 7.21 --- ipset.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ipset.spec b/ipset.spec index 3400789..ae31410 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,5 +1,5 @@ Name: ipset -Version: 7.20 +Version: 7.21 Release: 1%{?dist} Summary: Manage Linux IP sets @@ -171,6 +171,9 @@ fi %changelog +* Mon Feb 12 2024 Nicolas Chauvet - 7.21-1 +- Update to 7.21 + * Thu Feb 01 2024 Nicolas Chauvet - 7.20-1 - Update to 7.20 diff --git a/sources b/sources index 4e000ad..588e6be 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ipset-7.20.tar.bz2) = d0b87ab889987a3febeaf3d73099a262aca86160878258b3bd1be064e52b55baa90601804b30ad3bbb363066c9fc1bbdfe8bc100414f801729215a892e186fc6 +SHA512 (ipset-7.21.tar.bz2) = 175c6516c2091c57738a0324678d8d016e4d7f18fa03cb0dcc502391cac4caf4db1e757f61ad2fe312c1dbe431ec9cfabbc8e15a64a94ebd2fa903155b27c88f From 5cff36f4547eb6ff85eec8288e4918bbae848d00 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 10:33:14 +0000 Subject: [PATCH 17/22] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index ae31410..e366c38 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.21 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -171,6 +171,9 @@ fi %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 7.21-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Mon Feb 12 2024 Nicolas Chauvet - 7.21-1 - Update to 7.21 From 044838f10facbd6b7b175f1eab3675f526d32a38 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 1 Aug 2024 14:16:05 +0200 Subject: [PATCH 18/22] ipset-7.22-1 - Turn absolute ipset-translate symlink into a relative one - Rebase onto v7.22 plus fixes --- ...Fix-typo-in-ipset-translate-man-page.patch | 31 -- ...ith-WARN_ON_ONCE-according-to-usage-.patch | 23 ++ 0001-build-do-install-libipset-args.h.patch | 28 -- 0002-Fix-IPv6-sets-nftables-translation.patch | 91 ----- ...-global-buffer-overflow-warning-by-A.patch | 54 +++ ...late-allow-invoking-with-a-path-name.patch | 46 --- ...-ipset-Avoid-argv-array-overstepping.patch | 38 ++ 0004-tests-Reduce-testsuite-run-time.patch | 354 ++++++++++++++++++ ipset.spec | 16 +- sources | 2 +- 10 files changed, 484 insertions(+), 199 deletions(-) delete mode 100644 0001-Fix-typo-in-ipset-translate-man-page.patch create mode 100644 0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch delete mode 100644 0001-build-do-install-libipset-args.h.patch delete mode 100644 0002-Fix-IPv6-sets-nftables-translation.patch create mode 100644 0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch delete mode 100644 0003-ipset-translate-allow-invoking-with-a-path-name.patch create mode 100644 0003-lib-ipset-Avoid-argv-array-overstepping.patch create mode 100644 0004-tests-Reduce-testsuite-run-time.patch diff --git a/0001-Fix-typo-in-ipset-translate-man-page.patch b/0001-Fix-typo-in-ipset-translate-man-page.patch deleted file mode 100644 index 5c841e0..0000000 --- a/0001-Fix-typo-in-ipset-translate-man-page.patch +++ /dev/null @@ -1,31 +0,0 @@ -From c74a420471fd693f89e0b0e19f93c88af22fb7de Mon Sep 17 00:00:00 2001 -From: "Bernhard M. Wiedemann" -Date: Wed, 29 Sep 2021 09:55:43 +0200 -Subject: [PATCH] Fix typo in ipset-translate man page - -originally reported in -https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/ZIXKNQHSSCQ4ZLEGYYKLAXQ4PQ5EYFGZ/ -by Larry Len Rainey - -Signed-off-by: Bernhard M. Wiedemann -Signed-off-by: Pablo Neira Ayuso ---- - src/ipset-translate.8 | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ipset-translate.8 b/src/ipset-translate.8 -index bb4e737e1480..55ce2a99f2cf 100644 ---- a/src/ipset-translate.8 -+++ b/src/ipset-translate.8 -@@ -33,7 +33,7 @@ to \fBnftables(8)\fP. - The only available command is: - - .IP \[bu] 2 --ipset-translate restores < file.ipt -+ipset-translate restore < file.ipt - - .SH USAGE - The \fBipset-translate\fP tool reads an IP sets file in the syntax produced by --- -2.37.2 - diff --git a/0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch b/0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch new file mode 100644 index 0000000..7acff72 --- /dev/null +++ b/0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch @@ -0,0 +1,23 @@ +From 21080dc79c4e9244149aa78f6a8f7fbb6f4b8e81 Mon Sep 17 00:00:00 2001 +From: Jozsef Kadlecsik +Date: Thu, 6 Jun 2024 08:57:11 +0200 +Subject: [PATCH] Replace BUG_ON() with WARN_ON_ONCE() according to usage + policy. + +--- + kernel/net/netfilter/ipset/ip_set_list_set.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/net/netfilter/ipset/ip_set_list_set.c b/kernel/net/netfilter/ipset/ip_set_list_set.c +index fd78e2db06e4f..0d3e5a7331f26 100644 +--- a/kernel/net/netfilter/ipset/ip_set_list_set.c ++++ b/kernel/net/netfilter/ipset/ip_set_list_set.c +@@ -432,7 +432,7 @@ list_set_destroy(struct ip_set *set) + { + struct list_set *map = set->data; + +- BUG_ON(!list_empty(&map->members)); ++ WARN_ON_ONCE(!list_empty(&map->members)); + kfree(map); + + set->data = NULL; diff --git a/0001-build-do-install-libipset-args.h.patch b/0001-build-do-install-libipset-args.h.patch deleted file mode 100644 index c2f8edf..0000000 --- a/0001-build-do-install-libipset-args.h.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 39fde1381f0ba9101f65c08f2abda5426a46f8b1 Mon Sep 17 00:00:00 2001 -From: Jan Engelhardt -Date: Mon, 22 Jan 2018 22:50:33 +0100 -Subject: [PATCH] build: do install libipset/args.h - -libipset/types.h includes args.h, therefore args.h must be installed -too. - -Signed-off-by: Jan Engelhardt -Signed-off-by: Jozsef Kadlecsik ---- - include/libipset/Makefile.am | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/libipset/Makefile.am b/include/libipset/Makefile.am -index 3b47518..79a1357 100644 ---- a/include/libipset/Makefile.am -+++ b/include/libipset/Makefile.am -@@ -1,5 +1,6 @@ - pkgincludedir = ${includedir}/libipset - pkginclude_HEADERS = \ -+ args.h \ - data.h \ - errcode.h \ - linux_ip_set_bitmap.h \ --- -2.11.0 - diff --git a/0002-Fix-IPv6-sets-nftables-translation.patch b/0002-Fix-IPv6-sets-nftables-translation.patch deleted file mode 100644 index f2756e8..0000000 --- a/0002-Fix-IPv6-sets-nftables-translation.patch +++ /dev/null @@ -1,91 +0,0 @@ -From be7f6099feb7b5d34715b06f9308877cdcdc404a Mon Sep 17 00:00:00 2001 -From: Pablo Neira Ayuso -Date: Mon, 28 Feb 2022 19:52:57 +0100 -Subject: [PATCH] Fix IPv6 sets nftables translation - -The parser assumes the set is an IPv4 ipset because IPSET_OPT_FAMILY is -not set. - - # ipset-translate restore < ./ipset-mwan3_set_connected_ipv6.dump - add table inet global - add set inet global mwan3_connected_v6 { type ipv6_addr; flags interval; } - flush set inet global mwan3_connected_v6 - ipset v7.15: Error in line 4: Syntax error: '64' is out of range 0-32 - -Remove ipset_xlate_type_get(), call ipset_xlate_set_get() instead to -obtain the set type and family. - -Reported-by: Florian Eckert -Fixes: 325af556cd3a ("add ipset to nftables translation infrastructure") -Signed-off-by: Pablo Neira Ayuso ---- - lib/ipset.c | 24 ++++++++++-------------- - tests/xlate/xlate.t | 2 ++ - tests/xlate/xlate.t.nft | 2 ++ - 3 files changed, 14 insertions(+), 14 deletions(-) - -diff --git a/lib/ipset.c b/lib/ipset.c -index 73e67db88e0d..50f86aee045b 100644 ---- a/lib/ipset.c -+++ b/lib/ipset.c -@@ -949,18 +949,6 @@ ipset_xlate_set_get(struct ipset *ipset, const char *name) - return NULL; - } - --static const struct ipset_type *ipset_xlate_type_get(struct ipset *ipset, -- const char *name) --{ -- const struct ipset_xlate_set *set; -- -- set = ipset_xlate_set_get(ipset, name); -- if (!set) -- return NULL; -- -- return set->type; --} -- - static int - ipset_parser(struct ipset *ipset, int oargc, char *oargv[]) - { -@@ -1282,8 +1270,16 @@ ipset_parser(struct ipset *ipset, int oargc, char *oargv[]) - if (!ipset->xlate) { - type = ipset_type_get(session, cmd); - } else { -- type = ipset_xlate_type_get(ipset, arg0); -- ipset_session_data_set(session, IPSET_OPT_TYPE, type); -+ const struct ipset_xlate_set *xlate_set; -+ -+ xlate_set = ipset_xlate_set_get(ipset, arg0); -+ if (xlate_set) { -+ ipset_session_data_set(session, IPSET_OPT_TYPE, -+ xlate_set->type); -+ ipset_session_data_set(session, IPSET_OPT_FAMILY, -+ &xlate_set->family); -+ type = xlate_set->type; -+ } - } - if (type == NULL) - return ipset->standard_error(ipset, p); -diff --git a/tests/xlate/xlate.t b/tests/xlate/xlate.t -index b1e7d288e2a9..f09cb202bb6c 100644 ---- a/tests/xlate/xlate.t -+++ b/tests/xlate/xlate.t -@@ -53,3 +53,5 @@ create bp1 bitmap:port range 1-1024 - add bp1 22 - create bim1 bitmap:ip,mac range 1.1.1.0/24 - add bim1 1.1.1.1,aa:bb:cc:dd:ee:ff -+create hn6 hash:net family inet6 -+add hn6 fe80::/64 -diff --git a/tests/xlate/xlate.t.nft b/tests/xlate/xlate.t.nft -index 96eba3b0175e..0152a3081125 100644 ---- a/tests/xlate/xlate.t.nft -+++ b/tests/xlate/xlate.t.nft -@@ -54,3 +54,5 @@ add set inet global bp1 { type inet_service; } - add element inet global bp1 { 22 } - add set inet global bim1 { type ipv4_addr . ether_addr; } - add element inet global bim1 { 1.1.1.1 . aa:bb:cc:dd:ee:ff } -+add set inet global hn6 { type ipv6_addr; flags interval; } -+add element inet global hn6 { fe80::/64 } --- -2.37.2 - diff --git a/0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch b/0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch new file mode 100644 index 0000000..115b5fc --- /dev/null +++ b/0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch @@ -0,0 +1,54 @@ +From f1bcacf5eeb8620ea684524e1ce9c3951a77f1f9 Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Thu, 27 Jun 2024 10:18:16 +0200 +Subject: [PATCH] lib: data: Fix for global-buffer-overflow warning by ASAN + +After compiling with CFLAGS="-fsanitize=address -g", running the +testsuite triggers the following warning: + +| ipmap: Range: Check syntax error: missing range/from-to: FAILED +| Failed test: ../src/ipset 2>.foo.err -N test ipmap +| ================================================================= +| ==4204==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55a21e77172a at pc 0x7f1ef246f2a6 bp 0x7fffed8f4f40 sp 0x7fffed8f46e8 +| READ of size 32 at 0x55a21e77172a thread T0 +| #0 0x7f1ef246f2a5 in __interceptor_memcpy /var/tmp/portage/sys-devel/gcc-13.2.1_p20231014/work/gcc-13-20231014/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:899 +| #1 0x55a21e758bf6 in ipset_strlcpy /home/n0-1/git/ipset/lib/data.c:119 +| #2 0x55a21e758bf6 in ipset_data_set /home/n0-1/git/ipset/lib/data.c:349 +| #3 0x55a21e75ee2f in ipset_parse_typename /home/n0-1/git/ipset/lib/parse.c:1819 +| #4 0x55a21e754119 in ipset_parser /home/n0-1/git/ipset/lib/ipset.c:1205 +| #5 0x55a21e752cef in ipset_parse_argv /home/n0-1/git/ipset/lib/ipset.c:1344 +| #6 0x55a21e74ea45 in main /home/n0-1/git/ipset/src/ipset.c:38 +| #7 0x7f1ef224cf09 (/lib64/libc.so.6+0x23f09) +| #8 0x7f1ef224cfc4 in __libc_start_main (/lib64/libc.so.6+0x23fc4) +| #9 0x55a21e74f040 in _start (/home/n0-1/git/ipset/src/ipset+0x1d040) +| +| 0x55a21e77172a is located 54 bytes before global variable '*.LC1' defined in 'ipset_bitmap_ip.c' (0x55a21e771760) of size 19 +| '*.LC1' is ascii string 'IP|IP/CIDR|FROM-TO' +| 0x55a21e77172a is located 0 bytes after global variable '*.LC0' defined in 'ipset_bitmap_ip.c' (0x55a21e771720) of size 10 +| '*.LC0' is ascii string 'bitmap:ip' + +Fix this by avoiding 'src' array overstep in ipset_strlcpy(): In +contrast to strncpy(), memcpy() does not respect NUL-chars in input but +stubbornly reads as many bytes as specified. + +Fixes: a7432ba786ca4 ("Workaround misleading -Wstringop-truncation warning") +Signed-off-by: Phil Sutter +Signed-off-by: Jozsef Kadlecsik +--- + lib/data.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/data.c b/lib/data.c +index c05b20144cdad..64cad7a377302 100644 +--- a/lib/data.c ++++ b/lib/data.c +@@ -111,6 +111,9 @@ ipset_strlcpy(char *dst, const char *src, size_t len) + assert(dst); + assert(src); + ++ if (strlen(src) < len) ++ len = strlen(src) + 1; ++ + memcpy(dst, src, len); + dst[len - 1] = '\0'; + } diff --git a/0003-ipset-translate-allow-invoking-with-a-path-name.patch b/0003-ipset-translate-allow-invoking-with-a-path-name.patch deleted file mode 100644 index b6e21de..0000000 --- a/0003-ipset-translate-allow-invoking-with-a-path-name.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e1b60b2a93356c313cccb2abfdae4b58d530e02b Mon Sep 17 00:00:00 2001 -From: Quentin Armitage -Date: Thu, 11 Aug 2022 17:52:18 +0100 -Subject: [PATCH] ipset-translate: allow invoking with a path name - -Executing /usr/sbin/ipset-translate results in the ipset functionality being run, rather than the ipset-translate functionality. - - # ipset-translate destroy fred - This command is not supported, use `ipset-translate restore < file' - - # /usr/sbin/ipset-translate destroy fred - ipset v7.15: The set with the given name does not exist - -use basename() to resolve the issue. - -Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1626 -Signed-off-by: Quentin Armitage -Signed-off-by: Pablo Neira Ayuso ---- - src/ipset.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/ipset.c b/src/ipset.c -index 6d42b60d2fe9..162f477d49cd 100644 ---- a/src/ipset.c -+++ b/src/ipset.c -@@ -6,6 +6,7 @@ - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -+#define _GNU_SOURCE - #include /* assert */ - #include /* fprintf */ - #include /* exit */ -@@ -31,7 +32,7 @@ main(int argc, char *argv[]) - exit(1); - } - -- if (!strcmp(argv[0], "ipset-translate")) { -+ if (!strcmp(basename(argv[0]), "ipset-translate")) { - ret = ipset_xlate_argv(ipset, argc, argv); - } else { - ret = ipset_parse_argv(ipset, argc, argv); --- -2.37.2 - diff --git a/0003-lib-ipset-Avoid-argv-array-overstepping.patch b/0003-lib-ipset-Avoid-argv-array-overstepping.patch new file mode 100644 index 0000000..99dfdca --- /dev/null +++ b/0003-lib-ipset-Avoid-argv-array-overstepping.patch @@ -0,0 +1,38 @@ +From 851cb04ffee5040f1e0063f77c3fe9bc6245e0fb Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Thu, 27 Jun 2024 10:18:17 +0200 +Subject: [PATCH] lib: ipset: Avoid 'argv' array overstepping + +The maximum accepted value for 'argc' is MAX_ARGS which matches 'argv' +array size. The maximum allowed array index is therefore argc-1. + +This fix will leave items in argv non-NULL-terminated, so explicitly +NULL the formerly last entry after shifting. + +Looks like a day-1 bug. Interestingly, this neither triggered ASAN nor +valgrind. Yet adding debug output printing argv entries being copied +did. + +Fixes: 1e6e8bd9a62aa ("Third stage to ipset-5") +Signed-off-by: Phil Sutter +Signed-off-by: Jozsef Kadlecsik +--- + lib/ipset.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/ipset.c b/lib/ipset.c +index c910d88805c28..3bf1c5fcdbc59 100644 +--- a/lib/ipset.c ++++ b/lib/ipset.c +@@ -343,9 +343,9 @@ ipset_shift_argv(int *argc, char *argv[], int from) + + assert(*argc >= from + 1); + +- for (i = from + 1; i <= *argc; i++) ++ for (i = from + 1; i < *argc; i++) + argv[i-1] = argv[i]; +- (*argc)--; ++ argv[--(*argc)] = NULL; + return; + } + diff --git a/0004-tests-Reduce-testsuite-run-time.patch b/0004-tests-Reduce-testsuite-run-time.patch new file mode 100644 index 0000000..499d356 --- /dev/null +++ b/0004-tests-Reduce-testsuite-run-time.patch @@ -0,0 +1,354 @@ +From 5c9ef9016d2781f6e07a544e34ec9f4a8d65d0e2 Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Thu, 27 Jun 2024 10:18:18 +0200 +Subject: [PATCH] tests: Reduce testsuite run-time + +Where acceptable, batch add set element calls to avoid overhead of +excessive 'ipset' program spawns. On my (slow) testing VM, this patch +reduces a full run of tests/runtest.sh from ~70min down to ~11min. + +This might eliminate the situation being tested: resize.sh might be such +a case so batch only 255 'ipset add' calls and continue to repeat these +batched calls 32 times in hopes that it still qualifies as the resizing +stress test tests/hash:ip.t calls it. + +Signed-off-by: Phil Sutter +Signed-off-by: Jozsef Kadlecsik +--- + tests/resize.sh | 4 ++-- + tests/resizec.sh | 32 +++++++++++++-------------- + tests/resizen.sh | 49 ++++++++++++++++++++--------------------- + tests/resizet.sh | 40 ++++++++++++++++----------------- + tests/setlist_resize.sh | 4 ++-- + 5 files changed, 64 insertions(+), 65 deletions(-) + +diff --git a/tests/resize.sh b/tests/resize.sh +index 19b93fb01876c..9069b4970e92d 100755 +--- a/tests/resize.sh ++++ b/tests/resize.sh +@@ -9,6 +9,6 @@ set -e + $ipset n resize-test hash:ip hashsize 64 + for x in `seq 1 32`; do + for y in `seq 1 255`; do +- $ipset a resize-test 192.168.$x.$y +- done ++ echo "a resize-test 192.168.$x.$y" ++ done | $ipset restore + done +diff --git a/tests/resizec.sh b/tests/resizec.sh +index 28d674769f76f..781acf74c38dd 100755 +--- a/tests/resizec.sh ++++ b/tests/resizec.sh +@@ -25,65 +25,65 @@ case "$2" in + $ipset n test hash:ip $1 hashsize 64 comment + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y comment "text $ip$x$sep$y" ++ echo "a test $ip$x$sep$y comment \"text $ip$x$sep$y\"" + done +- done ++ done | $ipset restore + ;; + ipport) + $ipset n test hash:ip,port $1 hashsize 64 comment + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023 "text $ip$x$sep$y,1023" ++ echo "a test $ip$x$sep$y,1023 \"text $ip$x$sep$y,1023\"" + done +- done ++ done | $ipset restore + ;; + ipportip) + $ipset n test hash:ip,port,ip $1 hashsize 64 comment + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023,$ip2 comment "text $ip$x$sep$y,1023,$ip2" ++ echo "a test $ip$x$sep$y,1023,$ip2 comment \"text $ip$x$sep$y,1023,$ip2\"" + done +- done ++ done | $ipset restore + ;; + ipportnet) + $ipset n test hash:ip,port,net $1 hashsize 64 comment + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023,$ip2/$net comment "text $ip$x$sep$y,1023,$ip2/$net" ++ echo "a test $ip$x$sep$y,1023,$ip2/$net comment \"text $ip$x$sep$y,1023,$ip2/$net\"" + done +- done ++ done | $ipset restore + ;; + net) + $ipset n test hash:net $1 hashsize 64 comment + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net comment "text $ip$x$sep$y/$net" ++ echo "a test $ip$x$sep$y/$net comment \"text $ip$x$sep$y/$net\"" + done +- done ++ done | $ipset restore + ;; + netnet) + $ipset n test hash:net,net $1 hashsize 64 comment + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,$ip$y$sep$x/$net comment "text $ip$x$sep$y/$net,$ip$y$sep$x/$net" ++ echo "a test $ip$x$sep$y/$net,$ip$y$sep$x/$net comment \"text $ip$x$sep$y/$net,$ip$y$sep$x/$net\"" + done +- done ++ done | $ipset restore + ;; + netport) + $ipset n test hash:net,port $1 hashsize 64 comment + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,1023 comment "text $ip$x$sep$y/$net,1023" ++ echo "a test $ip$x$sep$y/$net,1023 comment \"text $ip$x$sep$y/$net,1023\"" + done +- done ++ done | $ipset restore + ;; + netiface) + $ipset n test hash:net,iface $1 hashsize 64 comment + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,eth0 comment "text $ip$x$sep$y/$net,eth0" ++ echo "$ipset a test $ip$x$sep$y/$net,eth0 comment \"text $ip$x$sep$y/$net,eth0\"" + done +- done ++ done | $ipset restore + ;; + esac + $ipset l test | grep ^$ip | while read x y z; do +diff --git a/tests/resizen.sh b/tests/resizen.sh +index 9322bd2a2cfce..13221f7b0894a 100755 +--- a/tests/resizen.sh ++++ b/tests/resizen.sh +@@ -25,80 +25,79 @@ case "$2" in + $ipset n test hash:ip,port,net $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023,$ip2/$net nomatch ++ echo "a test $ip$x$sep$y,1023,$ip2/$net nomatch" + done +- done ++ done | $ipset restore + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset t test $ip$x$sep$y,1023,$ip2/$net nomatch 2>/dev/null ++ echo "t test $ip$x$sep$y,1023,$ip2/$net nomatch" + done +- done ++ done | $ipset restore 2>/dev/null + ;; + netportnet) + $ipset n test hash:net,port,net $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023,$ip2/$net nomatch ++ echo "a test $ip$x$sep$y,1023,$ip2/$net nomatch" + done +- done ++ done | $ipset restore + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset t test $ip$x$sep$y,1023,$ip2/$net nomatch 2>/dev/null ++ echo "t test $ip$x$sep$y,1023,$ip2/$net nomatch" + done +- done ++ done | $ipset restore 2>/dev/null + ;; + net) + $ipset n test hash:net $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net nomatch ++ echo "a test $ip$x$sep$y/$net nomatch" + done +- done ++ done | $ipset restore + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset t test $ip$x$sep$y/$net nomatch 2>/dev/null ++ echo "t test $ip$x$sep$y/$net nomatch" + done +- done ++ done | $ipset restore 2>/dev/null + ;; + netnet) + $ipset n test hash:net,net $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,$ip$y$sep$x/$net nomatch ++ echo "a test $ip$x$sep$y/$net,$ip$y$sep$x/$net nomatch" + done +- done ++ done | $ipset restore + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset t test $ip$x$sep$y/$net,$ip$y$sep$x/$net nomatch \ +- 2>/dev/null ++ echo "t test $ip$x$sep$y/$net,$ip$y$sep$x/$net nomatch" + done +- done ++ done | $ipset restore 2>/dev/null + ;; + netport) + $ipset n test hash:net,port $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,1023 nomatch ++ echo "a test $ip$x$sep$y/$net,1023 nomatch" + done +- done ++ done | $ipset restore + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset t test $ip$x$sep$y/$net,1023 nomatch 2>/dev/null ++ echo "t test $ip$x$sep$y/$net,1023 nomatch" + done +- done ++ done | $ipset restore 2>/dev/null + ;; + netiface) + $ipset n test hash:net,iface $1 hashsize 64 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,eth0 nomatch ++ echo "a test $ip$x$sep$y/$net,eth0 nomatch" + done +- done ++ done | $ipset restore + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset t test $ip$x$sep$y/$net,eth0 nomatch 2>/dev/null ++ echo "t test $ip$x$sep$y/$net,eth0 nomatch" + done +- done ++ done | $ipset restore 2>/dev/null + ;; + esac + $ipset x +diff --git a/tests/resizet.sh b/tests/resizet.sh +index eed4abf2bd86e..e8fdd732435ab 100755 +--- a/tests/resizet.sh ++++ b/tests/resizet.sh +@@ -25,81 +25,81 @@ case "$2" in + $ipset n test hash:ip $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y ++ echo "a test $ip$x$sep$y" + done +- done ++ done | $ipset restore + ;; + ipmark) + $ipset n test hash:ip,mark $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023 ++ echo "a test $ip$x$sep$y,1023" + done +- done ++ done | $ipset restore + ;; + ipport) + $ipset n test hash:ip,port $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023 ++ echo "a test $ip$x$sep$y,1023" + done +- done ++ done | $ipset restore + ;; + ipportip) + $ipset n test hash:ip,port,ip $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023,$ip2 ++ echo "a test $ip$x$sep$y,1023,$ip2" + done +- done ++ done | $ipset restore + ;; + ipportnet) + $ipset n test hash:ip,port,net $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y,1023,$ip2/$net ++ echo "a test $ip$x$sep$y,1023,$ip2/$net" + done +- done ++ done | $ipset restore + ;; + netportnet) + $ipset n test hash:net,port,net $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 128`; do +- $ipset a test $ip$x$sep$y/$net,1023,$ip$y$sep$x/$net ++ echo "a test $ip$x$sep$y/$net,1023,$ip$y$sep$x/$net" + done +- done ++ done | $ipset restore + ;; + net) + $ipset n test hash:net $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net ++ echo "a test $ip$x$sep$y/$net" + done +- done ++ done | $ipset restore + ;; + netnet) + $ipset n test hash:net,net $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,$ip$y$sep$x/$net ++ echo "a test $ip$x$sep$y/$net,$ip$y$sep$x/$net" + done +- done ++ done | $ipset restore + ;; + netport) + $ipset n test hash:net,port $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,1023 ++ echo "a test $ip$x$sep$y/$net,1023" + done +- done ++ done | $ipset restore + ;; + netiface) + $ipset n test hash:net,iface $1 hashsize 64 timeout 100 + for x in `seq 0 16`; do + for y in `seq 0 255`; do +- $ipset a test $ip$x$sep$y/$net,eth0 ++ echo "a test $ip$x$sep$y/$net,eth0" + done +- done ++ done | $ipset restore + ;; + esac + $ipset l test | grep ^$ip | while read x y z; do +diff --git a/tests/setlist_resize.sh b/tests/setlist_resize.sh +index 1c2be327b841a..acb33e3ba0f08 100755 +--- a/tests/setlist_resize.sh ++++ b/tests/setlist_resize.sh +@@ -25,9 +25,9 @@ rmmod ip_set >/dev/null 2>&1 + create() { + n=$1 + while [ $n -le 1024 ]; do +- $ipset c test$n hash:ip ++ echo "c test$n hash:ip" + n=$((n+2)) +- done ++ done | $ipset restore + } + + for x in `seq 1 $loop`; do diff --git a/ipset.spec b/ipset.spec index e366c38..c10dd01 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset -Version: 7.21 -Release: 2%{?dist} +Version: 7.22 +Release: 1%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -10,6 +10,11 @@ Source1: %{name}.service Source2: %{name}.start-stop Source3: %{name}-config +Patch001: 0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch +Patch002: 0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch +Patch003: 0003-lib-ipset-Avoid-argv-array-overstepping.patch +Patch004: 0004-tests-Reduce-testsuite-run-time.patch + BuildRequires: libmnl-devel BuildRequires: automake BuildRequires: autoconf @@ -108,6 +113,9 @@ install -c -m 600 %{SOURCE3} %{buildroot}%{_sysconfdir}/sysconfig/%{name}-config # Create directory for configuration mkdir -p %{buildroot}%{_sysconfdir}/%{name} +# Turn absolute symlink into a relative one +ln -sf %{name} %{buildroot}/%{_sbindir}/%{name}-translate + %preun if [[ $1 -eq 0 && -n $(lsmod | grep "^xt_set ") ]]; then @@ -171,6 +179,10 @@ fi %changelog +* Thu Aug 01 2024 Phil Sutter - 7.22-1 +- Turn absolute ipset-translate symlink into a relative one +- Rebase onto v7.22 plus fixes + * Thu Jul 18 2024 Fedora Release Engineering - 7.21-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/sources b/sources index 588e6be..f0c0e6f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ipset-7.21.tar.bz2) = 175c6516c2091c57738a0324678d8d016e4d7f18fa03cb0dcc502391cac4caf4db1e757f61ad2fe312c1dbe431ec9cfabbc8e15a64a94ebd2fa903155b27c88f +SHA512 (ipset-7.22.tar.bz2) = e375a9110eb7974480147c57eb2cff4bdd03c7704cdae006a3d254cc80fada587aa8aee25a86f7cab29db83f5e283c5f9a47a314297317660ebba5097f623d79 From e6e33e65e2d096d6bee17c8d4baaec61b257e187 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 07:21:42 +0000 Subject: [PATCH 19/22] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index c10dd01..9f235d0 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.22 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -179,6 +179,9 @@ fi %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 7.22-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Thu Aug 01 2024 Phil Sutter - 7.22-1 - Turn absolute ipset-translate symlink into a relative one - Rebase onto v7.22 plus fixes From 506847bd396e005f3e686a84be16b9263f62344e Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 7 May 2025 16:39:33 +0200 Subject: [PATCH 20/22] New version 7.23 --- ...ith-WARN_ON_ONCE-according-to-usage-.patch | 23 -- ...-global-buffer-overflow-warning-by-A.patch | 54 --- ...-ipset-Avoid-argv-array-overstepping.patch | 38 -- 0004-tests-Reduce-testsuite-run-time.patch | 354 ------------------ ipset.spec | 12 +- sources | 2 +- 6 files changed, 6 insertions(+), 477 deletions(-) delete mode 100644 0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch delete mode 100644 0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch delete mode 100644 0003-lib-ipset-Avoid-argv-array-overstepping.patch delete mode 100644 0004-tests-Reduce-testsuite-run-time.patch diff --git a/0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch b/0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch deleted file mode 100644 index 7acff72..0000000 --- a/0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 21080dc79c4e9244149aa78f6a8f7fbb6f4b8e81 Mon Sep 17 00:00:00 2001 -From: Jozsef Kadlecsik -Date: Thu, 6 Jun 2024 08:57:11 +0200 -Subject: [PATCH] Replace BUG_ON() with WARN_ON_ONCE() according to usage - policy. - ---- - kernel/net/netfilter/ipset/ip_set_list_set.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/net/netfilter/ipset/ip_set_list_set.c b/kernel/net/netfilter/ipset/ip_set_list_set.c -index fd78e2db06e4f..0d3e5a7331f26 100644 ---- a/kernel/net/netfilter/ipset/ip_set_list_set.c -+++ b/kernel/net/netfilter/ipset/ip_set_list_set.c -@@ -432,7 +432,7 @@ list_set_destroy(struct ip_set *set) - { - struct list_set *map = set->data; - -- BUG_ON(!list_empty(&map->members)); -+ WARN_ON_ONCE(!list_empty(&map->members)); - kfree(map); - - set->data = NULL; diff --git a/0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch b/0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch deleted file mode 100644 index 115b5fc..0000000 --- a/0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch +++ /dev/null @@ -1,54 +0,0 @@ -From f1bcacf5eeb8620ea684524e1ce9c3951a77f1f9 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Thu, 27 Jun 2024 10:18:16 +0200 -Subject: [PATCH] lib: data: Fix for global-buffer-overflow warning by ASAN - -After compiling with CFLAGS="-fsanitize=address -g", running the -testsuite triggers the following warning: - -| ipmap: Range: Check syntax error: missing range/from-to: FAILED -| Failed test: ../src/ipset 2>.foo.err -N test ipmap -| ================================================================= -| ==4204==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55a21e77172a at pc 0x7f1ef246f2a6 bp 0x7fffed8f4f40 sp 0x7fffed8f46e8 -| READ of size 32 at 0x55a21e77172a thread T0 -| #0 0x7f1ef246f2a5 in __interceptor_memcpy /var/tmp/portage/sys-devel/gcc-13.2.1_p20231014/work/gcc-13-20231014/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:899 -| #1 0x55a21e758bf6 in ipset_strlcpy /home/n0-1/git/ipset/lib/data.c:119 -| #2 0x55a21e758bf6 in ipset_data_set /home/n0-1/git/ipset/lib/data.c:349 -| #3 0x55a21e75ee2f in ipset_parse_typename /home/n0-1/git/ipset/lib/parse.c:1819 -| #4 0x55a21e754119 in ipset_parser /home/n0-1/git/ipset/lib/ipset.c:1205 -| #5 0x55a21e752cef in ipset_parse_argv /home/n0-1/git/ipset/lib/ipset.c:1344 -| #6 0x55a21e74ea45 in main /home/n0-1/git/ipset/src/ipset.c:38 -| #7 0x7f1ef224cf09 (/lib64/libc.so.6+0x23f09) -| #8 0x7f1ef224cfc4 in __libc_start_main (/lib64/libc.so.6+0x23fc4) -| #9 0x55a21e74f040 in _start (/home/n0-1/git/ipset/src/ipset+0x1d040) -| -| 0x55a21e77172a is located 54 bytes before global variable '*.LC1' defined in 'ipset_bitmap_ip.c' (0x55a21e771760) of size 19 -| '*.LC1' is ascii string 'IP|IP/CIDR|FROM-TO' -| 0x55a21e77172a is located 0 bytes after global variable '*.LC0' defined in 'ipset_bitmap_ip.c' (0x55a21e771720) of size 10 -| '*.LC0' is ascii string 'bitmap:ip' - -Fix this by avoiding 'src' array overstep in ipset_strlcpy(): In -contrast to strncpy(), memcpy() does not respect NUL-chars in input but -stubbornly reads as many bytes as specified. - -Fixes: a7432ba786ca4 ("Workaround misleading -Wstringop-truncation warning") -Signed-off-by: Phil Sutter -Signed-off-by: Jozsef Kadlecsik ---- - lib/data.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/lib/data.c b/lib/data.c -index c05b20144cdad..64cad7a377302 100644 ---- a/lib/data.c -+++ b/lib/data.c -@@ -111,6 +111,9 @@ ipset_strlcpy(char *dst, const char *src, size_t len) - assert(dst); - assert(src); - -+ if (strlen(src) < len) -+ len = strlen(src) + 1; -+ - memcpy(dst, src, len); - dst[len - 1] = '\0'; - } diff --git a/0003-lib-ipset-Avoid-argv-array-overstepping.patch b/0003-lib-ipset-Avoid-argv-array-overstepping.patch deleted file mode 100644 index 99dfdca..0000000 --- a/0003-lib-ipset-Avoid-argv-array-overstepping.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 851cb04ffee5040f1e0063f77c3fe9bc6245e0fb Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Thu, 27 Jun 2024 10:18:17 +0200 -Subject: [PATCH] lib: ipset: Avoid 'argv' array overstepping - -The maximum accepted value for 'argc' is MAX_ARGS which matches 'argv' -array size. The maximum allowed array index is therefore argc-1. - -This fix will leave items in argv non-NULL-terminated, so explicitly -NULL the formerly last entry after shifting. - -Looks like a day-1 bug. Interestingly, this neither triggered ASAN nor -valgrind. Yet adding debug output printing argv entries being copied -did. - -Fixes: 1e6e8bd9a62aa ("Third stage to ipset-5") -Signed-off-by: Phil Sutter -Signed-off-by: Jozsef Kadlecsik ---- - lib/ipset.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/ipset.c b/lib/ipset.c -index c910d88805c28..3bf1c5fcdbc59 100644 ---- a/lib/ipset.c -+++ b/lib/ipset.c -@@ -343,9 +343,9 @@ ipset_shift_argv(int *argc, char *argv[], int from) - - assert(*argc >= from + 1); - -- for (i = from + 1; i <= *argc; i++) -+ for (i = from + 1; i < *argc; i++) - argv[i-1] = argv[i]; -- (*argc)--; -+ argv[--(*argc)] = NULL; - return; - } - diff --git a/0004-tests-Reduce-testsuite-run-time.patch b/0004-tests-Reduce-testsuite-run-time.patch deleted file mode 100644 index 499d356..0000000 --- a/0004-tests-Reduce-testsuite-run-time.patch +++ /dev/null @@ -1,354 +0,0 @@ -From 5c9ef9016d2781f6e07a544e34ec9f4a8d65d0e2 Mon Sep 17 00:00:00 2001 -From: Phil Sutter -Date: Thu, 27 Jun 2024 10:18:18 +0200 -Subject: [PATCH] tests: Reduce testsuite run-time - -Where acceptable, batch add set element calls to avoid overhead of -excessive 'ipset' program spawns. On my (slow) testing VM, this patch -reduces a full run of tests/runtest.sh from ~70min down to ~11min. - -This might eliminate the situation being tested: resize.sh might be such -a case so batch only 255 'ipset add' calls and continue to repeat these -batched calls 32 times in hopes that it still qualifies as the resizing -stress test tests/hash:ip.t calls it. - -Signed-off-by: Phil Sutter -Signed-off-by: Jozsef Kadlecsik ---- - tests/resize.sh | 4 ++-- - tests/resizec.sh | 32 +++++++++++++-------------- - tests/resizen.sh | 49 ++++++++++++++++++++--------------------- - tests/resizet.sh | 40 ++++++++++++++++----------------- - tests/setlist_resize.sh | 4 ++-- - 5 files changed, 64 insertions(+), 65 deletions(-) - -diff --git a/tests/resize.sh b/tests/resize.sh -index 19b93fb01876c..9069b4970e92d 100755 ---- a/tests/resize.sh -+++ b/tests/resize.sh -@@ -9,6 +9,6 @@ set -e - $ipset n resize-test hash:ip hashsize 64 - for x in `seq 1 32`; do - for y in `seq 1 255`; do -- $ipset a resize-test 192.168.$x.$y -- done -+ echo "a resize-test 192.168.$x.$y" -+ done | $ipset restore - done -diff --git a/tests/resizec.sh b/tests/resizec.sh -index 28d674769f76f..781acf74c38dd 100755 ---- a/tests/resizec.sh -+++ b/tests/resizec.sh -@@ -25,65 +25,65 @@ case "$2" in - $ipset n test hash:ip $1 hashsize 64 comment - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y comment "text $ip$x$sep$y" -+ echo "a test $ip$x$sep$y comment \"text $ip$x$sep$y\"" - done -- done -+ done | $ipset restore - ;; - ipport) - $ipset n test hash:ip,port $1 hashsize 64 comment - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023 "text $ip$x$sep$y,1023" -+ echo "a test $ip$x$sep$y,1023 \"text $ip$x$sep$y,1023\"" - done -- done -+ done | $ipset restore - ;; - ipportip) - $ipset n test hash:ip,port,ip $1 hashsize 64 comment - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023,$ip2 comment "text $ip$x$sep$y,1023,$ip2" -+ echo "a test $ip$x$sep$y,1023,$ip2 comment \"text $ip$x$sep$y,1023,$ip2\"" - done -- done -+ done | $ipset restore - ;; - ipportnet) - $ipset n test hash:ip,port,net $1 hashsize 64 comment - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023,$ip2/$net comment "text $ip$x$sep$y,1023,$ip2/$net" -+ echo "a test $ip$x$sep$y,1023,$ip2/$net comment \"text $ip$x$sep$y,1023,$ip2/$net\"" - done -- done -+ done | $ipset restore - ;; - net) - $ipset n test hash:net $1 hashsize 64 comment - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net comment "text $ip$x$sep$y/$net" -+ echo "a test $ip$x$sep$y/$net comment \"text $ip$x$sep$y/$net\"" - done -- done -+ done | $ipset restore - ;; - netnet) - $ipset n test hash:net,net $1 hashsize 64 comment - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,$ip$y$sep$x/$net comment "text $ip$x$sep$y/$net,$ip$y$sep$x/$net" -+ echo "a test $ip$x$sep$y/$net,$ip$y$sep$x/$net comment \"text $ip$x$sep$y/$net,$ip$y$sep$x/$net\"" - done -- done -+ done | $ipset restore - ;; - netport) - $ipset n test hash:net,port $1 hashsize 64 comment - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,1023 comment "text $ip$x$sep$y/$net,1023" -+ echo "a test $ip$x$sep$y/$net,1023 comment \"text $ip$x$sep$y/$net,1023\"" - done -- done -+ done | $ipset restore - ;; - netiface) - $ipset n test hash:net,iface $1 hashsize 64 comment - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,eth0 comment "text $ip$x$sep$y/$net,eth0" -+ echo "$ipset a test $ip$x$sep$y/$net,eth0 comment \"text $ip$x$sep$y/$net,eth0\"" - done -- done -+ done | $ipset restore - ;; - esac - $ipset l test | grep ^$ip | while read x y z; do -diff --git a/tests/resizen.sh b/tests/resizen.sh -index 9322bd2a2cfce..13221f7b0894a 100755 ---- a/tests/resizen.sh -+++ b/tests/resizen.sh -@@ -25,80 +25,79 @@ case "$2" in - $ipset n test hash:ip,port,net $1 hashsize 64 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023,$ip2/$net nomatch -+ echo "a test $ip$x$sep$y,1023,$ip2/$net nomatch" - done -- done -+ done | $ipset restore - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset t test $ip$x$sep$y,1023,$ip2/$net nomatch 2>/dev/null -+ echo "t test $ip$x$sep$y,1023,$ip2/$net nomatch" - done -- done -+ done | $ipset restore 2>/dev/null - ;; - netportnet) - $ipset n test hash:net,port,net $1 hashsize 64 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023,$ip2/$net nomatch -+ echo "a test $ip$x$sep$y,1023,$ip2/$net nomatch" - done -- done -+ done | $ipset restore - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset t test $ip$x$sep$y,1023,$ip2/$net nomatch 2>/dev/null -+ echo "t test $ip$x$sep$y,1023,$ip2/$net nomatch" - done -- done -+ done | $ipset restore 2>/dev/null - ;; - net) - $ipset n test hash:net $1 hashsize 64 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net nomatch -+ echo "a test $ip$x$sep$y/$net nomatch" - done -- done -+ done | $ipset restore - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset t test $ip$x$sep$y/$net nomatch 2>/dev/null -+ echo "t test $ip$x$sep$y/$net nomatch" - done -- done -+ done | $ipset restore 2>/dev/null - ;; - netnet) - $ipset n test hash:net,net $1 hashsize 64 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,$ip$y$sep$x/$net nomatch -+ echo "a test $ip$x$sep$y/$net,$ip$y$sep$x/$net nomatch" - done -- done -+ done | $ipset restore - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset t test $ip$x$sep$y/$net,$ip$y$sep$x/$net nomatch \ -- 2>/dev/null -+ echo "t test $ip$x$sep$y/$net,$ip$y$sep$x/$net nomatch" - done -- done -+ done | $ipset restore 2>/dev/null - ;; - netport) - $ipset n test hash:net,port $1 hashsize 64 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,1023 nomatch -+ echo "a test $ip$x$sep$y/$net,1023 nomatch" - done -- done -+ done | $ipset restore - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset t test $ip$x$sep$y/$net,1023 nomatch 2>/dev/null -+ echo "t test $ip$x$sep$y/$net,1023 nomatch" - done -- done -+ done | $ipset restore 2>/dev/null - ;; - netiface) - $ipset n test hash:net,iface $1 hashsize 64 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,eth0 nomatch -+ echo "a test $ip$x$sep$y/$net,eth0 nomatch" - done -- done -+ done | $ipset restore - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset t test $ip$x$sep$y/$net,eth0 nomatch 2>/dev/null -+ echo "t test $ip$x$sep$y/$net,eth0 nomatch" - done -- done -+ done | $ipset restore 2>/dev/null - ;; - esac - $ipset x -diff --git a/tests/resizet.sh b/tests/resizet.sh -index eed4abf2bd86e..e8fdd732435ab 100755 ---- a/tests/resizet.sh -+++ b/tests/resizet.sh -@@ -25,81 +25,81 @@ case "$2" in - $ipset n test hash:ip $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y -+ echo "a test $ip$x$sep$y" - done -- done -+ done | $ipset restore - ;; - ipmark) - $ipset n test hash:ip,mark $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023 -+ echo "a test $ip$x$sep$y,1023" - done -- done -+ done | $ipset restore - ;; - ipport) - $ipset n test hash:ip,port $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023 -+ echo "a test $ip$x$sep$y,1023" - done -- done -+ done | $ipset restore - ;; - ipportip) - $ipset n test hash:ip,port,ip $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023,$ip2 -+ echo "a test $ip$x$sep$y,1023,$ip2" - done -- done -+ done | $ipset restore - ;; - ipportnet) - $ipset n test hash:ip,port,net $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y,1023,$ip2/$net -+ echo "a test $ip$x$sep$y,1023,$ip2/$net" - done -- done -+ done | $ipset restore - ;; - netportnet) - $ipset n test hash:net,port,net $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 128`; do -- $ipset a test $ip$x$sep$y/$net,1023,$ip$y$sep$x/$net -+ echo "a test $ip$x$sep$y/$net,1023,$ip$y$sep$x/$net" - done -- done -+ done | $ipset restore - ;; - net) - $ipset n test hash:net $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net -+ echo "a test $ip$x$sep$y/$net" - done -- done -+ done | $ipset restore - ;; - netnet) - $ipset n test hash:net,net $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,$ip$y$sep$x/$net -+ echo "a test $ip$x$sep$y/$net,$ip$y$sep$x/$net" - done -- done -+ done | $ipset restore - ;; - netport) - $ipset n test hash:net,port $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,1023 -+ echo "a test $ip$x$sep$y/$net,1023" - done -- done -+ done | $ipset restore - ;; - netiface) - $ipset n test hash:net,iface $1 hashsize 64 timeout 100 - for x in `seq 0 16`; do - for y in `seq 0 255`; do -- $ipset a test $ip$x$sep$y/$net,eth0 -+ echo "a test $ip$x$sep$y/$net,eth0" - done -- done -+ done | $ipset restore - ;; - esac - $ipset l test | grep ^$ip | while read x y z; do -diff --git a/tests/setlist_resize.sh b/tests/setlist_resize.sh -index 1c2be327b841a..acb33e3ba0f08 100755 ---- a/tests/setlist_resize.sh -+++ b/tests/setlist_resize.sh -@@ -25,9 +25,9 @@ rmmod ip_set >/dev/null 2>&1 - create() { - n=$1 - while [ $n -le 1024 ]; do -- $ipset c test$n hash:ip -+ echo "c test$n hash:ip" - n=$((n+2)) -- done -+ done | $ipset restore - } - - for x in `seq 1 $loop`; do diff --git a/ipset.spec b/ipset.spec index 9f235d0..fed78c5 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset -Version: 7.22 -Release: 2%{?dist} +Version: 7.23 +Release: 1%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -10,11 +10,6 @@ Source1: %{name}.service Source2: %{name}.start-stop Source3: %{name}-config -Patch001: 0001-Replace-BUG_ON-with-WARN_ON_ONCE-according-to-usage-.patch -Patch002: 0002-lib-data-Fix-for-global-buffer-overflow-warning-by-A.patch -Patch003: 0003-lib-ipset-Avoid-argv-array-overstepping.patch -Patch004: 0004-tests-Reduce-testsuite-run-time.patch - BuildRequires: libmnl-devel BuildRequires: automake BuildRequires: autoconf @@ -179,6 +174,9 @@ fi %changelog +* Wed May 07 2025 Phil Sutter - 7.23-1 +- new version + * Fri Jan 17 2025 Fedora Release Engineering - 7.22-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/sources b/sources index f0c0e6f..be758ae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ipset-7.22.tar.bz2) = e375a9110eb7974480147c57eb2cff4bdd03c7704cdae006a3d254cc80fada587aa8aee25a86f7cab29db83f5e283c5f9a47a314297317660ebba5097f623d79 +SHA512 (ipset-7.23.tar.bz2) = 5a43c790abf157a55db5a9a22cb5f28a225f5c7969beda81566a2259aa82c9d852979eb805b11b4347f47c6a0c2cc4de6f14e4733bee5b562844422a45fb9dab From 3dd0bb47016d83d57e8f7fcfa5a620a4f8bd3921 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 20 May 2025 13:32:16 +0200 Subject: [PATCH 21/22] New version 7.24 --- ipset.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ipset.spec b/ipset.spec index fed78c5..81df147 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,5 +1,5 @@ Name: ipset -Version: 7.23 +Version: 7.24 Release: 1%{?dist} Summary: Manage Linux IP sets @@ -174,6 +174,9 @@ fi %changelog +* Tue May 20 2025 Phil Sutter - 7.24-1 +- new version + * Wed May 07 2025 Phil Sutter - 7.23-1 - new version diff --git a/sources b/sources index be758ae..66b03f3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ipset-7.23.tar.bz2) = 5a43c790abf157a55db5a9a22cb5f28a225f5c7969beda81566a2259aa82c9d852979eb805b11b4347f47c6a0c2cc4de6f14e4733bee5b562844422a45fb9dab +SHA512 (ipset-7.24.tar.bz2) = 18ccb49bd38083f0556b11e1d17f43791c52a2b094c9a500b6f770796b17e8e70c3860a628eac2252eb672b1fc9de734d3a0e0823d61dd9be7b4188adc6dd214 From 08a38ea64a84f22de26e42e70dd5010518e7f065 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 17:45:50 +0000 Subject: [PATCH 22/22] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- ipset.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipset.spec b/ipset.spec index 81df147..8fa6607 100644 --- a/ipset.spec +++ b/ipset.spec @@ -1,6 +1,6 @@ Name: ipset Version: 7.24 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Manage Linux IP sets License: GPL-2.0-only @@ -174,6 +174,9 @@ fi %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 7.24-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Tue May 20 2025 Phil Sutter - 7.24-1 - new version