Bug 184988 - [PORT net-mgmt/aircrack-ng] Added MTU get/set operations
Summary: [PORT net-mgmt/aircrack-ng] Added MTU get/set operations
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Lars Engels
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-19 10:20 UTC by Yuri Victorovich
Modified: 2013-12-20 16:54 UTC (History)
0 users

See Also:


Attachments
file.diff (1.39 KB, patch)
2013-12-19 10:20 UTC, Yuri Victorovich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2013-12-19 10:20:00 UTC
Please add this patch on top of existing ones for the file freebsd.c

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer 2013-12-19 10:20:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lme

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer 2013-12-20 16:41:40 UTC
Author: lme
Date: Fri Dec 20 16:41:26 2013
New Revision: 337038
URL: http://svnweb.freebsd.org/changeset/ports/337038

Log:
  - Added MTU get/set operations for use in airbase-ng(8) [1]
  - Bump PORTREVISION
  - Add licence
  - Strip binaries
  
  PR:		ports/184988 [1]
  Submitted by:	Yuri <yuri@rawbw.com>
  Reviewed by:	adrian [1]

Modified:
  head/net-mgmt/aircrack-ng/Makefile
  head/net-mgmt/aircrack-ng/files/patch-src_osdep_freebsd.c

Modified: head/net-mgmt/aircrack-ng/Makefile
==============================================================================
--- head/net-mgmt/aircrack-ng/Makefile	Fri Dec 20 16:38:53 2013	(r337037)
+++ head/net-mgmt/aircrack-ng/Makefile	Fri Dec 20 16:41:26 2013	(r337038)
@@ -3,6 +3,7 @@
 
 PORTNAME=	aircrack-ng
 DISTVERSION=	1.2b2
+PORTREVISION=	1
 CATEGORIES=	net-mgmt security
 MASTER_SITES=	http://download.aircrack-ng.org/ \
 		http://bsd-geek.de/FreeBSD/distfiles/
@@ -11,12 +12,20 @@ DISTNAME=	${PORTNAME}-${DISTVERSION:C/b/
 MAINTAINER=	lme@FreeBSD.org
 COMMENT=	An 802.11 WEP and WPA-PSK keys cracking program
 
+LICENSE=	GPLv2 BSD3CLAUSE AL2
+LICENSE_COMB=	dual
+
 USES=		gmake dos2unix
 DOS2UNIX_FILES=	src/osdep/byteorder.h
 MAKE_ARGS+=	unstable=true prefix=${PREFIX}
 USE_OPENSSL=	yes
 SUB_FILES=	pkg-message
 
+BIN_FILES=	airdecloak-ng buddy-ng aircrack-ng airdecap-ng ivstools \
+		airolib-ng makeivs-ng packetforge-ng wpaclean kstats do
+SBIN_FILES=	airtun-ng besside-ng airbase-ng easside-ng airodump-ng \
+		aireplay-ng wesside-ng airserv-ng tkiptun-ng
+
 OPTIONS_DEFINE=	SQLITE
 OPTIONS_SUB=	yes
 SQLITE_DESC=	Use SQLite for storing pre-computed key tables
@@ -52,5 +61,13 @@ post-patch:
 	@${REINPLACE_CMD} \
 		-e 's|-lpthread|${PTHREAD_LIBS}|' \
 			${WRKSRC}/src/Makefile
+post-install:
+.for f in ${BIN_FILES}
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/$f
+.endfor
+
+.for f in ${SBIN_FILES}
+	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/sbin/$f
+.endfor
 
 .include <bsd.port.mk>

Modified: head/net-mgmt/aircrack-ng/files/patch-src_osdep_freebsd.c
==============================================================================
--- head/net-mgmt/aircrack-ng/files/patch-src_osdep_freebsd.c	Fri Dec 20 16:38:53 2013	(r337037)
+++ head/net-mgmt/aircrack-ng/files/patch-src_osdep_freebsd.c	Fri Dec 20 16:41:26 2013	(r337038)
@@ -1,5 +1,5 @@
 --- src/osdep/freebsd.c.orig	2011-09-25 00:05:54.000000000 +0200
-+++ src/osdep/freebsd.c	2013-09-29 13:49:18.588462319 +0200
++++ src/osdep/freebsd.c	2013-12-20 17:15:28.184126473 +0100
 @@ -53,7 +53,9 @@ struct priv_fbsd {
  	unsigned char			pf_buf[4096];
  	unsigned char			*pf_next;
@@ -56,7 +56,58 @@
          if (ioctl(s, SIOCSIFMEDIA, &ifr) == -1)
  		goto close_sock;
  
-@@ -542,13 +554,17 @@ static struct wif *fbsd_open(char *iface
+@@ -510,6 +522,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 +575,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);
+@@ -542,13 +589,17 @@ static struct wif *fbsd_open(char *iface
  	/* setup private state */
  	pf = wi_priv(wi);
  	pf->pf_fd = fd;
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Lars Engels freebsd_committer 2013-12-20 16:54:04 UTC
State Changed
From-To: open->closed

Committed, with minor changes. Thanks!