1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-11 02:50:24 +00:00

- Update to 1.2-RC4

- Remove my distfile mirror
- Switch to USES ssl
- Provide working versions of airmon-ng and airodump-ng-oui-update
This commit is contained in:
Lars Engels 2016-07-10 13:39:28 +00:00
parent f54fee3c6c
commit a02cac9cd7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=418317
10 changed files with 374 additions and 123 deletions

View File

@ -2,11 +2,9 @@
# $FreeBSD$
PORTNAME= aircrack-ng
DISTVERSION= 1.2-rc2
PORTREVISION= 1
DISTVERSION= 1.2-rc4
CATEGORIES= net-mgmt security
MASTER_SITES= http://download.aircrack-ng.org/ \
http://bsd-geek.de/FreeBSD/distfiles/
MASTER_SITES= http://download.aircrack-ng.org/
MAINTAINER= lme@FreeBSD.org
COMMENT= 802.11 WEP and WPA-PSK keys cracking program
@ -14,14 +12,13 @@ COMMENT= 802.11 WEP and WPA-PSK keys cracking program
LICENSE= GPLv2 BSD3CLAUSE APACHE20
LICENSE_COMB= dual
USES= cpe dos2unix gmake
USES= cpe dos2unix gmake ssl
CPE_VERSION= ${DISTVERSION:C/-.*//}
CPE_UPDATE= ${DISTVERSION:C/^[^-]*$//:C/.*-//}
DOS2UNIX_FILES= src/osdep/byteorder.h
MAKE_ARGS= experimental=true libnl=false prefix=${PREFIX}
# Don't call 'strip' target with WITH_DEBUG set
INSTALL_TARGET= ${STRIP:S/-s/strip/} install
USE_OPENSSL= yes
OPTIONS_DEFINE= PCRE SQLITE
OPTIONS_DEFAULT=PCRE SQLITE
@ -29,7 +26,7 @@ OPTIONS_SUB= yes
PCRE_DESC= Use Perl Compatible Regular Expressions for wesside
PCRE_MAKE_ARGS= pcre=true
PCRE_LIB_DEPENDS= libpcre.so:devel/pcre
PCRE_LIB_DEPENDS= libpcre.so:devel/pcre
PCRE_USES= pkgconfig
SQLITE_DESC= Use SQLite for storing pre-computed key tables
@ -40,12 +37,10 @@ post-patch:
@${REINPLACE_CMD} \
-e 's|share/\(man/man[1-9]\)|\1|' \
${WRKSRC}/common.mak
# Do not install scripts (Linux-specific) and their manpages
@${REINPLACE_CMD} \
-E '/scripts|@echo/d' \
${WRKSRC}/Makefile
@${REINPLACE_CMD} \
-E 's/air(driver|mon)-ng\.1 //' \
${WRKSRC}/manpages/Makefile
-e 's|%%ETCDIR%%|${ETCDIR}|' ${WRKSRC}/scripts/airodump-ng-oui-update
post-install:
${MKDIR} ${STAGEDIR}${ETCDIR}
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (aircrack-ng-1.2-rc2.tar.gz) = ba5b3eda44254efc5b7c9f776eb756f7cc323ad5d0813c101e92edb483d157e9
SIZE (aircrack-ng-1.2-rc2.tar.gz) = 2046531
SHA256 (aircrack-ng-1.2-rc4.tar.gz) = d93ac16aade5b4d37ab8cdf6ce4b855835096ccf83deb65ffdeff6d666eaff36
SIZE (aircrack-ng-1.2-rc4.tar.gz) = 4379880

View File

@ -0,0 +1,279 @@
--- scripts/airmon-ng.freebsd.orig 2015-12-12 03:13:15 UTC
+++ scripts/airmon-ng.freebsd
@@ -1,25 +1,31 @@
#!/bin/sh
-
-
if [ -n "$1" ] && [ -z "$2" ]; then
- echo "Invalid command. Valid commands: [start|stop] INTERFACE."
- exit 1
+ echo "Invalid command. Valid commands: [start|stop] INTERFACE"
+ exit 1
fi
if [ -n "$1" ]; then
- if [ "$1" != 'stop' ] && [ "$1" != 'start' ]; then
- echo "Invalid command. Valid commands: [start|stop] INTERFACE."
- exit 1
- fi
+ if [ "$1" != 'stop' ] && [ "$1" != 'start' ]; then
+ echo "Invalid command. Valid commands: [start|stop] INTERFACE."
+ exit 1
+ fi
fi
+# Get device names from sysctl(8) for parent interfaces and ifconfig(8) for
+PHYSICAL_DEVICES="$(sysctl -n net.wlan.devices)"
+VIRTUAL_DEVICES="$(ifconfig -l | grep -Eo 'wlan[0-9]+')"
+
if [ -n "$2" ]; then
- ifconfig $2 >/dev/null 2>/dev/null
- if [ $? -ne 0 ]; then
- echo "Error: Interface $2 does not exist."
- exit 1
- fi
+ if [ "$(echo ${2} | grep -Eo 'wlan[0-9]+')" ]; then
+ echo "Please use physical device names, e.g. 'ath0'"
+ exit 1
+ fi
+ echo ${PHYSICAL_DEVICES} ${VIRTUAL_DEVICES} | grep -q $2
+ if [ $? -ne 0 ]; then
+ echo "Error: Interface $2 does not exist."
+ exit 1
+ fi
fi
COMMAND=$1
@@ -28,100 +34,143 @@ INTERFACE_TO_USE=$2
CHIPSET=""
DRIVER=""
PARENT=""
+MODE=""
+
+WIFI_IF_REGEX='^(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|upgt|ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+$'
+
+chipset_from_pciconf() {
+ pciconf -lv $1 2>/dev/null | awk -F" = " '/device/ {print $2}'
+}
+
+chipset_from_usbconfig() {
+ USB_INFO=$(dmesg | grep -E "^$1: <" | tail -n 1 | tr ',' '\n' | tail -n 1 | tr '>' ' ')
+ USB_ADDR=$(echo ${USB_INFO} | awk '{print $2}')
+ USB_BUS=$(echo ${USB_INFO} | awk '{print $4}' | sed 's/[^0-9]*//g')
+ VENDOR_ID=$(usbconfig -u ${USB_BUS} -a ${USB_ADDR} dump_device_desc | grep idVendor | awk '{print $3}')
+ PRODUCT_ID=$(usbconfig -u ${USB_BUS} -a ${USB_ADDR} dump_device_desc | grep idProduct | awk '{print $3}')
+ if [ "${VENDOR_ID}" = "0x0bda" ]; then
+ [ "${PRODUCT_ID}" = "0x8171" ] && CHIPSET="RTL8188SU"
+ [ "${PRODUCT_ID}" = "0x8172" ] && CHIPSET="RTL8191SU"
+ [ "${PRODUCT_ID}" = "0x8174" ] && CHIPSET="RTL8192SU"
+ [ "${PRODUCT_ID}" = "0x8176" ] && CHIPSET="RTL8188CUS"
+ [ "${PRODUCT_ID}" = "0x8178" ] && CHIPSET="RTL8192CU"
+ [ "${PRODUCT_ID}" = "0x8179" ] && CHIPSET="RTL8188EUS"
+ [ "${PRODUCT_ID}" = "0x817f" ] && CHIPSET="RTL8188RU"
+ [ "${PRODUCT_ID}" = "0x8192" ] && CHIPSET="RTL8191SU"
+ [ "${PRODUCT_ID}" = "0x8193" ] && CHIPSET="RTL8192DU"
+ [ "${PRODUCT_ID}" = "0x8199" ] && CHIPSET="RTL8187SU"
+ [ "${PRODUCT_ID}" = "0x8812" ] && CHIPSET="RTL8812AU"
+ elif [ "${VENDOR_ID}" = "0x06f8" ] && [ "${PRODUCT_ID}" = "0xe033" ]; then
+ CHIPSET="RTL8188CUS"
+ elif [ "${VENDOR_ID}" = "0x2001" ] && [ "${PRODUCT_ID}" = "0x3308" ]; then
+ CHIPSET="RTL8188CUS"
+ elif [ "${VENDOR_ID}" = "0x20f4" ] && [ "${PRODUCT_ID}" = "0x648b" ]; then
+ CHIPSET="RTL8188CUS"
+ elif [ "${VENDOR_ID}" = "0x7392" ] && [ "${PRODUCT_ID}" = "0x7811" ]; then
+ CHIPSET="RTL8188CUS"
+ elif [ "${VENDOR_ID}" = "0x2019" ]; then
+ [ "${PRODUCT_ID}" = "0xab2a" ] && CHIPSET="RTL8188CUS"
+ [ "${PRODUCT_ID}" = "0xed17" ] && CHIPSET="RTL8188CUS"
+ elif [ "${VENDOR_ID}" = "0x050d" ]; then
+ [ "${PRODUCT_ID}" = "0x1102" ] && CHIPSET="RTL8188CUS"
+ [ "${PRODUCT_ID}" = "0x11f2" ] && CHIPSET="RTL8188CUS"
+ elif [ "${VENDOR_ID}" = "0x0846" ]; then
+ [ "${PRODUCT_ID}" = "0x9041" ] && CHIPSET="RTL8188CUS"
+ [ "${PRODUCT_ID}" = "0x9042" ] && CHIPSET="RTL8188CUS"
+ [ "${PRODUCT_ID}" = "0x9043" ] && CHIPSET="RTL8188CUS"
+ fi
+ [ -z "${CHIPSET}" ] && CHIPSET="Report dmesg and usbconfig (dump commands) to http://trac.aircrack-ng.org"
+}
get_interface_info() {
- [ -z "$1" ] && return
- if [ -n "$(echo $1 | grep -E '^(ath|otus|urtwn)[0-9]+$' )" ]; then
- DRIVER="$(echo $1 | sed 's/[0-9]*//g')"
- elif [ -n "$(echo $1 | grep -E ^wlan[0-9]+$)" ]; then
- # It most likely is a monitor interface.
- IFACE_IDX=$(echo $1 | sed 's/[^0-9]*//g')
- PARENT=$(sysctl net.wlan.${IFACE_IDX}.%parent | awk '{print $2}')
- if [ -n "${PARENT}" ]; then
- get_interface_info ${PARENT}
- return
- fi
- fi
+ [ -z "$1" ] && return
- if [ "${DRIVER}" = "ath" ]; then
- CHIPSET=$(dmesg | grep -E "^$1: <" | tail -n 1 | awk -F\< '{print $2}' | awk -F\> '{print $1}' )
- elif [ "${DRIVER}" = "urtwn" ]; then
- USB_INFO=$(dmesg | grep -E "^$1: <" | tail -n 1 | tr ',' '\n' | tail -n 1 | tr '>' ' ')
- USB_ADDR=$(echo ${USB_INFO} | awk '{print $2}')
- USB_BUS=$(echo ${USB_INFO} | awk '{print $4}' | sed 's/[^0-9]*//g')
- VENDOR_ID=$(usbconfig -u ${USB_BUS} -a ${USB_ADDR} dump_device_desc | grep idVendor | awk '{print $3}')
- PRODUCT_ID=$(usbconfig -u ${USB_BUS} -a ${USB_ADDR} dump_device_desc | grep idProduct | awk '{print $3}')
- if [ "${VENDOR_ID}" = "0x0bda" ]; then
- [ "${PRODUCT_ID}" = "0x8171" ] && CHIPSET="RTL8188SU"
- [ "${PRODUCT_ID}" = "0x8172" ] && CHIPSET="RTL8191SU"
- [ "${PRODUCT_ID}" = "0x8174" ] && CHIPSET="RTL8192SU"
- [ "${PRODUCT_ID}" = "0x8176" ] && CHIPSET="RTL8188CUS"
- [ "${PRODUCT_ID}" = "0x8178" ] && CHIPSET="RTL8192CU"
- [ "${PRODUCT_ID}" = "0x8179" ] && CHIPSET="RTL8188EUS"
- [ "${PRODUCT_ID}" = "0x817f" ] && CHIPSET="RTL8188RU"
- [ "${PRODUCT_ID}" = "0x8192" ] && CHIPSET="RTL8191SU"
- [ "${PRODUCT_ID}" = "0x8193" ] && CHIPSET="RTL8192DU"
- [ "${PRODUCT_ID}" = "0x8199" ] && CHIPSET="RTL8187SU"
- [ "${PRODUCT_ID}" = "0x8812" ] && CHIPSET="RTL8812AU"
- elif [ "${VENDOR_ID}" = "0x06f8" ] && [ "${PRODUCT_ID}" = "0xe033" ]; then
- CHIPSET="RTL8188CUS"
- elif [ "${VENDOR_ID}" = "0x2001" ] && [ "${PRODUCT_ID}" = "0x3308" ]; then
- CHIPSET="RTL8188CUS"
- elif [ "${VENDOR_ID}" = "0x20f4" ] && [ "${PRODUCT_ID}" = "0x648b" ]; then
- CHIPSET="RTL8188CUS"
- elif [ "${VENDOR_ID}" = "0x7392" ] && [ "${PRODUCT_ID}" = "0x7811" ]; then
- CHIPSET="RTL8188CUS"
- elif [ "${VENDOR_ID}" = "0x2019" ]; then
- [ "${PRODUCT_ID}" = "0xab2a" ] && CHIPSET="RTL8188CUS"
- [ "${PRODUCT_ID}" = "0xed17" ] && CHIPSET="RTL8188CUS"
- elif [ "${VENDOR_ID}" = "0x050d" ]; then
- [ "${PRODUCT_ID}" = "0x1102" ] && CHIPSET="RTL8188CUS"
- [ "${PRODUCT_ID}" = "0x11f2" ] && CHIPSET="RTL8188CUS"
- elif [ "${VENDOR_ID}" = "0x0846" ]; then
- [ "${PRODUCT_ID}" = "0x9041" ] && CHIPSET="RTL8188CUS"
- [ "${PRODUCT_ID}" = "0x9042" ] && CHIPSET="RTL8188CUS"
- [ "${PRODUCT_ID}" = "0x9043" ] && CHIPSET="RTL8188CUS"
- fi
- [ -z "${CHIPSET}" ] && CHIPSET="Report dmesg and usbconfig (dump commands) to http://trac.aircrack-ng.org"
- elif [ -n "${DRIVER}" ]; then
- CHIPSET="Report dmesg and usbconfig (dump commands) to http://trac.aircrack-ng.org"
- else
- CHIPSET="Unknown"
- [ -z "${DRIVER}" ] && DRIVER="Unknown"
- fi
+ ### Driver information
+ # Parent interface check
+ if [ -n "$(echo $1 | grep -E ${WIFI_IF_REGEX})" ]; then
+ DRIVER="$(echo $1 | sed 's/[0-9]*//g')"
+ # Child interface check
+ elif [ -n "$(echo $1 | grep -E ^wlan[0-9]+$)" ]; then
+ IFACE_IDX=$(echo $1 | sed 's/[^0-9]*//g')
+ PARENT=$(sysctl -n net.wlan.${IFACE_IDX}.%parent)
+ MODE=$(ifconfig $1 | awk '/media:/ { if ($NF ~ /<[^>]+>/) {print $NF} }' | tr -d '[<>()]')
+ if [ -z "${MODE}" ]; then
+ MODE=client
+ fi
+ if [ -n "${PARENT}" ]; then
+ get_interface_info ${PARENT}
+ return
+ fi
+ fi
+
+ ### Chipset information
+ # PCI devices
+ CHIPSET="$(chipset_from_pciconf $1)"
+
+ # USB devices
+ if [ -z "${CHIPSET}" ]; then
+ CHIPSET="$(chipset_from_usbconfig $1)"
+ fi
+
+ if [ -z "${CHIPSET}" ]; then
+ CHIPSET="Report dmesg and usbconfig (dump commands) to http://trac.aircrack-ng.org"
+ fi
+
+ if [ -z "${DRIVER}" ]; then
+ DRIVER="Unknown"
+ fi
}
-printf "\nInterface\tDriver\t\tChipset\n\n"
+destroy_other_children() {
+ for iface in ${VIRTUAL_DEVICES}; do
+ local iface_idx=$(echo $1 | sed 's/[^0-9]*//g')
+ local parent=$(sysctl -n net.wlan.${iface_idx}.%parent)
+ if [ "${parent}" = "${1}" ]; then
+ ifconfig ${iface} destroy
+ if [ $? -ne 0 ]; then
+ printf "Failed to remove virtual interface ${iface}\n"
+ else
+ printf "Destroyed virtual interface ${iface}\n"
+ fi
+ fi
+ done
+}
-for IFACE in $(ifconfig -a | grep -E '^(wlan|ath|otus|urtwn)[0-9]+' | awk -F: '{print $1}' )
-do
- get_interface_info ${IFACE}
- printf "${IFACE}\t\t${DRIVER}\t\t${CHIPSET}\n\n"
- if [ -n "${PARENT}" ]; then
- printf "\t(monitor mode interface. Parent: ${PARENT})\n"
- fi
+create_device() {
+ local iface=$(ifconfig wlan create wlandev ${1} wlanmode ${2})
+ if [ $? -eq 0 ]; then
+ printf "Created ${2} mode interface ${iface} from ${1}\n"
+ else
+ printf "Failed to create ${sta} mode interface from ${1}\n"
+ exit 1
+ fi
+}
- if [ "${INTERFACE_TO_USE}" = "${IFACE}" ]; then
- if [ "${COMMAND}" = 'start' ]; then
- if [ -n "${PARENT}" ]; then
- printf "\t Interface is already in monitor mode, ignoring\n"
- else
- MONITOR_IFACE=$(ifconfig wlan create wlandev ${IFACE} wlanmode monitor)
- if [ $? -eq 0 ]; then
- printf "\tCreated monitor mode interface ${MONITOR_IFACE} from ${IFACE}\n"
- else
- printf "\tFailed creating monitor interface\n"
- fi
- fi
- elif [ "${COMMAND}" = 'stop' ]; then
- ifconfig ${IFACE} destroy 2>/dev/null
- if [ $? -ne 0 ]; then
- printf "\tFailed to remove monitor mode interface ${IFACE}\n"
- else
- printf "\tDestroyed monitor interface ${IFACE}\n"
- fi
- fi
- fi
+if [ -n "${COMMAND}" ]; then
+ get_interface_info ${INTERFACE_TO_USE}
+ destroy_other_children ${INTERFACE_TO_USE}
+ case ${COMMAND} in
+ start) NEW_MODE=monitor ;;
+ stop) NEW_MODE=sta ;;
+ esac
+ create_device ${INTERFACE_TO_USE} ${NEW_MODE}
+fi
+
+printf "\nPhysical Interfaces:\n"
+printf "==================\n"
+printf "Interface\tDriver\t\tChipset\n"
+
+for IFACE in ${PHYSICAL_DEVICES}; do
+ get_interface_info ${IFACE}
+ printf "${IFACE}\t\t${DRIVER}\t\t${CHIPSET}\n"
+done
+
+printf "\nVirtual Interfaces:\n"
+printf "===================\n"
+printf "Interface\tMode\t\tParent\n"
+
+for IFACE in ${VIRTUAL_DEVICES}; do
+ get_interface_info ${IFACE}
+ printf "${IFACE}\t\t${MODE}\t\t${PARENT}\n"
done
-exit 0

View File

@ -0,0 +1,77 @@
--- scripts/airodump-ng-oui-update.orig 2015-07-02 23:53:33 UTC
+++ scripts/airodump-ng-oui-update
@@ -44,50 +44,37 @@ if [ ! -d "${OUI_PATH}" ]; then
mkdir -p ${OUI_PATH}
fi
-if [ ${CURL} ] || [ ${WGET} ]; then
- # Delete previous partially downloaded file (if the script was aborted)
- rm -f ${OUI_IEEE} >/dev/null 2>/dev/null
-
- # Download it
- echo "[*] Downloading IEEE OUI file..."
-
- if [ ${WGET} ]; then
- ${WGET} ${OUI_DOWNLOAD_URL} -O ${OUI_IEEE} >/dev/null 2>/dev/null
- else
- ${CURL} -L ${OUI_DOWNLOAD_URL} > ${OUI_IEEE} 2>/dev/null
- fi
+# Delete previous partially downloaded file (if the script was aborted)
+rm -f ${OUI_IEEE} >/dev/null 2>/dev/null
- if [ "${?}" -ne 0 ]; then
- echo "[*] Error: Failed to download OUI list, aborting..."
- exit 1
- fi
+# Download it
+echo "[*] Downloading IEEE OUI file..."
- # Parse the downloaded OUI list
- echo "[*] Parsing OUI file..."
+fetch -o "${OUI_IEEE}" ${OUI_DOWNLOAD_URL}
- # Keep the previous file
- if [ -f "${OUI_DOWNLOADED}" ]; then
- mv ${AIRODUMP_NG_OUI} ${OUI}-old
- fi
+if [ "${?}" -ne 0 ]; then
+ echo "[*] Error: Failed to download OUI list, aborting..."
+ exit 1
+fi
- # Parse it
- grep "(hex)" ${OUI_IEEE} | sed 's/^[ \t]*//g;s/[ \t]*$//g' > ${AIRODUMP_NG_OUI}
- if [ "${?}" -ne 0 ]; then
- echo "[*] Error: Failed to parse OUI, aborting..."
- exit 1
- fi
+# Parse the downloaded OUI list
+echo "[*] Parsing OUI file..."
- # Cleanup
- rm -f ${OUI_IEEE}
+# Keep the previous file
+if [ -f "${OUI_DOWNLOADED}" ]; then
+ mv ${AIRODUMP_NG_OUI} ${OUI}-old
+fi
- echo "[*] Airodump-ng OUI file successfully updated"
-else
- if [ -f "${OUI}" ]; then
- echo "[*] Please install curl or wget to update OUI list"
- else
- echo "[*] Please install curl or wget to install OUI list"
- fi
+# Parse it
+grep "(hex)" ${OUI_IEEE} | sed 's/^[ \t]*//g;s/[ \t]*$//g' > ${AIRODUMP_NG_OUI}
+if [ "${?}" -ne 0 ]; then
+ echo "[*] Error: Failed to parse OUI, aborting..."
exit 1
fi
+# Cleanup
+rm -f ${OUI_IEEE}
+
+echo "[*] Airodump-ng OUI file successfully updated"
+
exit 0

View File

@ -1,10 +0,0 @@
--- src/crypto.h.orig 2014-07-12 02:24:03 UTC
+++ src/crypto.h
@@ -34,6 +34,7 @@
#ifndef _CRYPTO_H
#define _CRYPTO_H
+#include <sys/types.h>
#ifdef USE_GCRYPT
#include "gcrypt-openssl-wrapper.h"

View File

@ -1,22 +1,11 @@
--- src/osdep/byteorder.h.orig 2015-09-07 17:11:56 UTC
--- src/osdep/byteorder.h.orig 2016-04-28 20:42:03 UTC
+++ src/osdep/byteorder.h
@@ -181,7 +181,7 @@
* Solaris
* -------
*/
- #if defined(__sparc__) && defined(__sun__)
- #if defined(__SVR4) && defined(__sun__)
+ #if defined(__sparc__) && defined(__SVR4) && defined(__sun__)
#include <sys/byteorder.h>
#include <sys/types.h>
#include <unistd.h>
@@ -223,7 +223,9 @@
// FreeBSD
#ifdef __FreeBSD__
- #include <machine/endian.h>
+ #undef ushort
+ #undef uint
+ #include <sys/types.h>
#endif
// XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...?

View File

@ -1,71 +0,0 @@
--- src/osdep/freebsd.c.orig 2011-09-24 22:05:54 UTC
+++ src/osdep/freebsd.c
@@ -389,7 +389,7 @@ static int do_fbsd_open(struct wif *wi,
memset(&ifr, 0, sizeof(ifr));
strcpy(ifr.ifr_name, iface);
- ifr.ifr_media = ifmr.ifm_current | IFM_IEEE80211_MONITOR;
+ ifr.ifr_media = ifmr.ifm_current;
if (ioctl(s, SIOCSIFMEDIA, &ifr) == -1)
goto close_sock;
@@ -510,6 +510,39 @@ static int fbsd_set_mac(struct wif *wi,
return ioctl(priv->pf_s, SIOCSIFLLADDR, ifr);
}
+static int fbsd_set_mtu(struct wif *wi, int mtu)
+{
+ struct priv_fbsd *priv = wi_priv(wi);
+ struct ifreq *ifr = &priv->pf_ifr;
+
+ memset(ifr, 0, sizeof(struct ifreq));
+
+ strncpy(ifr->ifr_name, wi_get_ifname(wi), sizeof(ifr->ifr_name));
+ ifr->ifr_mtu = mtu;
+
+ if(ioctl(priv->pf_s, SIOCSIFMTU, ifr) < 0)
+ return -1;
+
+ return 0;
+}
+
+static int fbsd_get_mtu(struct wif *wi)
+{
+ struct priv_fbsd *priv = wi_priv(wi);
+ struct ifreq ifr;
+
+ memset(&ifr, 0, sizeof(struct ifreq));
+
+ ifr.ifr_addr.sa_family = AF_INET;
+
+ strncpy(ifr.ifr_name, wi_get_ifname(wi), sizeof(ifr.ifr_name));
+
+ if(ioctl(priv->pf_s, SIOCGIFMTU, (caddr_t)&ifr) < 0)
+ return -1;
+
+ return ifr.ifr_mtu;
+}
+
static struct wif *fbsd_open(char *iface)
{
struct wif *wi;
@@ -530,7 +563,9 @@ static struct wif *fbsd_open(char *iface
wi->wi_set_mac = fbsd_set_mac;
wi->wi_get_rate = fbsd_get_rate;
wi->wi_set_rate = fbsd_set_rate;
- wi->wi_get_monitor = fbsd_get_monitor;
+ wi->wi_get_monitor = fbsd_get_monitor;
+ wi->wi_get_mtu = fbsd_get_mtu;
+ wi->wi_set_mtu = fbsd_set_mtu;
/* setup iface */
fd = do_fbsd_open(wi, iface);
@@ -544,6 +579,8 @@ static struct wif *fbsd_open(char *iface
pf->pf_fd = fd;
pf->pf_txparams.ibp_vers = IEEE80211_BPF_VERSION;
pf->pf_txparams.ibp_len = sizeof(struct ieee80211_bpf_params) - 6;
+ pf->pf_txparams.ibp_rate0 = 2; /* 1 MB/s XXX */
+ pf->pf_txparams.ibp_try0 = 1; /* no retransmits */
pf->pf_txparams.ibp_rate1 = 2; /* 1 MB/s XXX */
pf->pf_txparams.ibp_try1 = 1; /* no retransmits */
pf->pf_txparams.ibp_flags = IEEE80211_BPF_NOACK;

View File

@ -1,11 +0,0 @@
--- src/osdep/radiotap/platform.h.orig 2014-03-22 20:26:59 UTC
+++ src/osdep/radiotap/platform.h
@@ -3,7 +3,7 @@
#ifndef _BSD_SOURCE
#define _BSD_SOURCE
#endif
-#include <endian.h>
+#include <machine/endian.h>
#define le16_to_cpu le16toh
#define le32_to_cpu le32toh

View File

@ -1,9 +1,9 @@
--- src/osdep/radiotap/radiotap.c.orig 2014-03-31 01:39:15 UTC
--- src/osdep/radiotap/radiotap.c.orig 2016-02-08 04:12:03 UTC
+++ src/osdep/radiotap/radiotap.c
@@ -19,6 +19,16 @@
#include "../byteorder.h"
@@ -20,6 +20,16 @@
#endif
+#ifdef _BSD_SOURCE
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define le16toh(x) (x)

View File

@ -32,10 +32,13 @@ man/man8/tkiptun-ng.8.gz
man/man8/wesside-ng.8.gz
sbin/airbase-ng
sbin/aireplay-ng
sbin/airmon-ng
sbin/airodump-ng
sbin/airodump-ng-oui-update
sbin/airserv-ng
sbin/airtun-ng
sbin/besside-ng
sbin/easside-ng
sbin/tkiptun-ng
sbin/wesside-ng
@dir %%ETCDIR%%