From 88ef251c44a867d4d8ffa62aaaa8e0c37d93c272 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 21 May 2024 15:48:52 -0700 Subject: [PATCH] net-snmp: finish up GCC14 fix This fixes it with musl support. Also fixed several -Wformat warnings. Main problem was __fd_mask not existing on musl but fd_mask existing. Signed-off-by: Rosen Penev --- net/net-snmp/Makefile | 2 +- net/net-snmp/patches/161-project_types.patch | 2 +- net/net-snmp/patches/750-ieee802dot11.patch | 64 ++++++++++---------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile index 6fb5c90060..d7e51c037f 100644 --- a/net/net-snmp/Makefile +++ b/net/net-snmp/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=net-snmp PKG_VERSION:=5.9.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/net-snmp diff --git a/net/net-snmp/patches/161-project_types.patch b/net/net-snmp/patches/161-project_types.patch index 3fe030a4e1..0818f5dd46 100644 --- a/net/net-snmp/patches/161-project_types.patch +++ b/net/net-snmp/patches/161-project_types.patch @@ -5,7 +5,7 @@ AC_MSG_CHECKING([for the type of fd_set::fds_bits]) -for type in __fd_mask __int32_t unknown; do -+for type in __fd_mask __int32_t u_int32_t; do ++for type in fd_mask int32_t size_t; do AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #include diff --git a/net/net-snmp/patches/750-ieee802dot11.patch b/net/net-snmp/patches/750-ieee802dot11.patch index aaee1b6611..2eb598a822 100644 --- a/net/net-snmp/patches/750-ieee802dot11.patch +++ b/net/net-snmp/patches/750-ieee802dot11.patch @@ -3974,7 +3974,7 @@ + rc = ioctl ( skfd, SIOCGIFHWADDR, &ifr ); + if ( rc >= 0 ) { + -+ sprintf ( MACAddress, "%02X:%02X:%02X:%02X:%02X:%02X\0", ++ sprintf ( MACAddress, "%02X:%02X:%02X:%02X:%02X:%02X", + ( UCHAR ) ifr.ifr_hwaddr.sa_data[0], ( UCHAR ) ifr.ifr_hwaddr.sa_data[1], + ( UCHAR ) ifr.ifr_hwaddr.sa_data[2], ( UCHAR ) ifr.ifr_hwaddr.sa_data[3], + ( UCHAR ) ifr.ifr_hwaddr.sa_data[4], ( UCHAR ) ifr.ifr_hwaddr.sa_data[5] ); @@ -3997,83 +3997,83 @@ + + if ( hasChanged (( char * ) &nSc, sizeof ( nSc ))) { + nSc.ifIndex = ifIndex; -+ sprintf ( nSc.UID, "%04d\0", nSc.ifIndex ); ++ sprintf ( nSc.UID, "%04ld", nSc.ifIndex ); + strcpy ( nSc.ifName, ifName ); + addList (( char * ) &scList, ( char * ) &nSc, sizeof ( nSc )); + } + + if ( hasChanged (( char * ) &nPr, sizeof ( nPr ))) { + nPr.ifIndex = ifIndex; -+ sprintf ( nPr.UID, "%04d\0", nPr.ifIndex ); ++ sprintf ( nPr.UID, "%04ld", nPr.ifIndex ); + strcpy ( nPr.ifName, ifName ); + addList (( char * ) &prList, ( char * ) &nPr, sizeof ( nPr )); + } + + if ( hasChanged (( char * ) &nOp, sizeof ( nOp ))) { + nOp.ifIndex = ifIndex; -+ sprintf ( nOp.UID, "%04d\0", nOp.ifIndex ); ++ sprintf ( nOp.UID, "%04ld", nOp.ifIndex ); + strcpy ( nOp.ifName, ifName ); + addList (( char * ) &opList, ( char * ) &nOp, sizeof ( nOp )); + } + + if ( hasChanged (( char * ) &nCo, sizeof ( nCo ))) { + nCo.ifIndex = ifIndex; -+ sprintf ( nCo.UID, "%04d\0", nCo.ifIndex ); ++ sprintf ( nCo.UID, "%04ld", nCo.ifIndex ); + strcpy ( nCo.ifName, ifName ); + addList (( char * ) &coList, ( char * ) &nCo, sizeof ( nCo )); + } + + if ( hasChanged (( char * ) &nRi, sizeof ( nRi ))) { + nRi.ifIndex = ifIndex; -+ sprintf ( nRi.UID, "%04d\0", nRi.ifIndex ); ++ sprintf ( nRi.UID, "%04ld", nRi.ifIndex ); + strcpy ( nRi.ifName, ifName ); + addList (( char * ) &riList, ( char * ) &nRi, sizeof ( nRi )); + } + + if ( hasChanged (( char * ) &nPo, sizeof ( nPo ))) { + nPo.ifIndex = ifIndex; -+ sprintf ( nPo.UID, "%04d\0", nPo.ifIndex ); ++ sprintf ( nPo.UID, "%04ld", nPo.ifIndex ); + strcpy ( nPo.ifName, ifName ); + addList (( char * ) &poList, ( char * ) &nPo, sizeof ( nPo )); + } + + if ( hasChanged (( char * ) &nPa, sizeof ( nPa ))) { + nPa.ifIndex = ifIndex; -+ sprintf ( nPa.UID, "%04d\0", nPa.ifIndex ); ++ sprintf ( nPa.UID, "%04ld", nPa.ifIndex ); + strcpy ( nPa.ifName, ifName ); + addList (( char * ) &paList, ( char * ) &nPa, sizeof ( nPa )); + } + + if ( hasChanged (( char * ) &nPt, sizeof ( nPt ))) { + nPt.ifIndex = ifIndex; -+ sprintf ( nPt.UID, "%04d\0", nPt.ifIndex ); ++ sprintf ( nPt.UID, "%04ld", nPt.ifIndex ); + strcpy ( nPt.ifName, ifName ); + addList (( char * ) &ptList, ( char * ) &nPt, sizeof ( nPt )); + } + + if ( hasChanged (( char * ) &nPf, sizeof ( nPf ))) { + nPf.ifIndex = ifIndex; -+ sprintf ( nPf.UID, "%04d\0", nPf.ifIndex ); ++ sprintf ( nPf.UID, "%04ld", nPf.ifIndex ); + strcpy ( nPf.ifName, ifName ); + addList (( char * ) &pfList, ( char * ) &nPf, sizeof ( nPf )); + } + + if ( hasChanged (( char * ) &nPd, sizeof ( nPd ))) { + nPd.ifIndex = ifIndex; -+ sprintf ( nPd.UID, "%04d\0", nPd.ifIndex ); ++ sprintf ( nPd.UID, "%04ld", nPd.ifIndex ); + strcpy ( nPd.ifName, ifName ); + addList (( char * ) &pdList, ( char * ) &nPd, sizeof ( nPd )); + } + + if ( hasChanged (( char * ) &nPi, sizeof ( nPi ))) { + nPi.ifIndex = ifIndex; -+ sprintf ( nPi.UID, "%04d\0", nPi.ifIndex ); ++ sprintf ( nPi.UID, "%04ld", nPi.ifIndex ); + strcpy ( nPi.ifName, ifName ); + addList (( char * ) &piList, ( char * ) &nPi, sizeof ( nPi )); + } + } + -+//printf ( "%s - ifIndex: %d ifName: %s UID: %s\n", ++//printf ( "%s - ifIndex: %ld ifName: %s UID: %s\n", +// "load80211Structs() - HASCHANGED", ifIndex, ifName, nSc.UID ); +} + @@ -4164,7 +4164,7 @@ + nAa.ifIndex = ifIndex; + nAa.authenticationAlgorithmsIndex = 1; // index number one + nAa.authenticationAlgorithm = 1; // 1 => open key -+ sprintf ( nAa.UID, "%04d%04d\0", nAa.ifIndex, nAa.authenticationAlgorithmsIndex ); ++ sprintf ( nAa.UID, "%04ld%04ld", nAa.ifIndex, nAa.authenticationAlgorithmsIndex ); + nAa.authenticationAlgorithmsEnable = 1; // enabled by default + if ( ( wi->has_key ) && + ( wi->key_size != 0 ) && @@ -4177,7 +4177,7 @@ + nAa.ifIndex = ifIndex; + nAa.authenticationAlgorithmsIndex = 2; // index number 2 + nAa.authenticationAlgorithm = 2; // 2 => shared key -+ sprintf ( nAa.UID, "%04d%04d\0", nAa.ifIndex, nAa.authenticationAlgorithmsIndex ); ++ sprintf ( nAa.UID, "%04ld%04ld", nAa.ifIndex, nAa.authenticationAlgorithmsIndex ); + nAa.authenticationAlgorithmsEnable = 2; + if ( ( wi->has_key ) && + ( wi->key_size != 0 ) && @@ -4191,7 +4191,7 @@ + nDf.haveWEPDefaultKeyValue = TRUE; + nDf.ifIndex = ifIndex; + nDf.WEPDefaultKeyIndex = i + 1; // index number -+ sprintf ( nDf.UID, "%04d%04d\0", nDf.ifIndex, nDf.WEPDefaultKeyIndex ); ++ sprintf ( nDf.UID, "%04ld%04ld", nDf.ifIndex, nDf.WEPDefaultKeyIndex ); + if ( wep[i].haveKey ) + strcpy ( nDf.WEPDefaultKeyValue, "*****" ); + else @@ -4256,7 +4256,7 @@ + nRt.supportedDataRatesTxIndex = i + 1; + nRt.supportedDataRatesTxValue = wi->range.bitrate[i] / 500000L; + nRt.haveSupportedDataRatesTxValue = TRUE; -+ sprintf ( nRt.UID, "%04d%04d\0", nRt.ifIndex, nRt.supportedDataRatesTxIndex ); ++ sprintf ( nRt.UID, "%04ld%04ld", nRt.ifIndex, nRt.supportedDataRatesTxIndex ); + strcpy ( nRt.ifName, ifName ); + addList (( char * ) &rtList, ( char * ) &nRt, sizeof ( nRt )); + } @@ -4269,7 +4269,7 @@ + nRr.supportedDataRatesRxIndex = i + 1; + nRr.supportedDataRatesRxValue = wi->range.bitrate[i] / 500000L; + nRr.haveSupportedDataRatesRxValue = TRUE; -+ sprintf ( nRr.UID, "%04d%04d\0", nRr.ifIndex, nRr.supportedDataRatesRxIndex ); ++ sprintf ( nRr.UID, "%04ld%04ld", nRr.ifIndex, nRr.supportedDataRatesRxIndex ); + strcpy ( nRr.ifName, ifName ); + addList (( char * ) &rrList, ( char * ) &nRr, sizeof ( nRr )); + } @@ -4442,22 +4442,22 @@ + s = bfr; + s = strchr ( s, ':' ); s++; /* Skip ethX: */ + s = strtok ( s, " " ); /* ' ' => '\0' */ -+ sscanf ( s, "%X", &wi->stats.status ); // status ++ sscanf ( s, "%hX", &wi->stats.status ); // status + + s = strtok ( NULL, " " ); // link quality + if ( strchr ( s, '.' ) != NULL ) + wi->stats.qual.updated |= 1; -+ sscanf ( s, "%d", &wi->stats.qual.qual ); ++ sscanf ( s, "%hhd", &wi->stats.qual.qual ); + + s = strtok ( NULL, " " ); // signal level + if ( strchr ( s,'.' ) != NULL ) + wi->stats.qual.updated |= 2; -+ sscanf ( s, "%d", &wi->stats.qual.level ); ++ sscanf ( s, "%hhd", &wi->stats.qual.level ); + + s = strtok ( NULL, " " ); // noise level + if ( strchr ( s, '.' ) != NULL ) + wi->stats.qual.updated += 4; -+ sscanf ( s, "%d", &wi->stats.qual.noise ); ++ sscanf ( s, "%hhd", &wi->stats.qual.noise ); + + s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.nwid ); + s = strtok ( NULL, " " ); sscanf ( s, "%d", &wi->stats.discard.code ); @@ -4563,12 +4563,12 @@ + printf ( "%s %s\n", "SIOCGIWFREQ", " ===> no info.freq support" ); + + if ( info.has_sens ) -+ printf ( "%s sens: %d\n", "SIOCGIWSENS", info.sens ); ++ printf ( "%s sens: %" PRIdPTR "\n", "SIOCGIWSENS", *(intptr_t *)&info.sens ); + else + printf ( "%s %s\n", "SIOCGIWSENS", " ===> no info.sens support" ); + + if ( info.has_key ) { -+ printf ( "%s key_size: %d key_flags: %d wepCurrentKey: %d\n", ++ printf ( "%s key_size: %d key_flags: %d wepCurrentKey: %ld\n", + "SIOCGIWENCODE", info.key_size, info.key_flags, wepCurrentKey ); + printf ( "%s MODE: %d DISABLED: %d INDEX: %d OPEN: %d RESTRICTED: %d NOKEY: %d TEMP: %d\n", + "SIOCGIWENCODE", info.key_flags & IW_ENCODE_MODE, @@ -4581,7 +4581,7 @@ + + for ( i = 0; i < MAX_WEP_KEYS; i++ ) { + if ( wep[i].haveKey ) -+ printf ( "%s wep[%d].len: %d wep[%d].key: %s\n", ++ printf ( "%s wep[%d].len: %ld wep[%d].key: %s\n", + "SIOCGIWENCODE", i, wep[i].len, i, wep[i].key ); + } + @@ -4595,19 +4595,19 @@ + printf ( "%s %s\n", "SIOCGIWAP", " ===> no ap_addr information" ); + + if ( info.has_bitrate ) -+ printf ( "%s bitrate: %d value: %d fixed: %d disabled: %d flags: %d\n", -+ "SIOCGIWRATE", info.bitrate, info.bitrate.value, info.bitrate.fixed, ++ printf ( "%s bitrate: %" PRIdPTR " value: %d fixed: %d disabled: %d flags: %d\n", ++ "SIOCGIWRATE", *(intptr_t *)&info.bitrate, info.bitrate.value, info.bitrate.fixed, + info.bitrate.disabled, info.bitrate.flags ); + else + printf ( "%s %s\n", "SIOCGIWRATE", " ===> no info.bitrate support" ); + + if ( info.has_rts ) -+ printf ( "%s rts: %d\n", "SIOCGIWRTS", info.rts ); ++ printf ( "%s rts: %" PRIdPTR "\n", "SIOCGIWRTS", *(intptr_t *)&info.rts ); + else + printf ( "%s %s\n", "SIOCGIWRTS", " ===> no info.rts support" ); + + if ( info.has_frag ) -+ printf ( "%s frag: %d\n", "SIOCGIWFRAG", info.frag ); ++ printf ( "%s frag: %" PRIdPTR "\n", "SIOCGIWFRAG", *(intptr_t *)&info.frag ); + else + printf ( "%s %s\n", "SIOCGIWFRAG", " ===> no info.frag support" ); + @@ -4617,7 +4617,7 @@ + printf ( "%s %s\n", "SIOCGIWMODE", " ===> no info.mode support" ); + + if ( info.has_power ) { -+ printf ( "%s power: %d\n", "SIOCGIWPOWER", info.power ); ++ printf ( "%s power: %" PRIdPTR "\n", "SIOCGIWPOWER", *(intptr_t *)&info.power ); + printf ( "%s disabled: %d MIN: %d MAX: %d TIMEOUT: %d RELATIVE: %d\n", + "SIOCGIWPOWER", + info.power.disabled ? 1:0, @@ -4637,7 +4637,7 @@ + printf ( "%s %s\n", "SIOCGIWPOWER", " ===> no info.power support" ); + + if ( info.has_retry ) -+ printf ( "%s retry: %d\n", "SIOCGIWRETRY", info.retry ); ++ printf ( "%s retry: %" PRIdPTR "\n", "SIOCGIWRETRY", *(intptr_t *)&info.retry ); + else + printf ( "%s %s\n", "SIOCGIWRETRY", " ===> no info.retry support" ); + @@ -5025,7 +5025,7 @@ +/**************************************************************************** +* Linked List Structure * +****************************************************************************/ -+static struct avNode { ++struct avNode { + LIST_ENTRY ( avNode ) nodes; + char *data; // pointer to data +}; -- 2.30.2