From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Dec 19 10:20:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF280BF0 for ; Thu, 19 Dec 2013 10:20:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8A36B114F for ; Thu, 19 Dec 2013 10:20:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJAK0Tj047660 for ; Thu, 19 Dec 2013 10:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rBJAK0uC047659; Thu, 19 Dec 2013 10:20:00 GMT (envelope-from gnats) Resent-Date: Thu, 19 Dec 2013 10:20:00 GMT Resent-Message-Id: <201312191020.rBJAK0uC047659@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Yuri Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D57FB20 for ; Thu, 19 Dec 2013 10:10:24 +0000 (UTC) Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1A14C110B for ; Thu, 19 Dec 2013 10:10:24 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBJAANi4026586 for ; Thu, 19 Dec 2013 10:10:23 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBJAANWV026563; Thu, 19 Dec 2013 10:10:23 GMT (envelope-from nobody) Message-Id: <201312191010.rBJAANWV026563@oldred.freebsd.org> Date: Thu, 19 Dec 2013 10:10:23 GMT From: Yuri To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/184988: [PORT net-mgmt/aircrack-ng] Added MTU get/set operations X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 10:20:00 -0000 >Number: 184988 >Category: ports >Synopsis: [PORT net-mgmt/aircrack-ng] Added MTU get/set operations >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 19 10:20:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Yuri >Release: 9.2 >Organization: n/a >Environment: >Description: Please add this patch on top of existing ones for the file freebsd.c >How-To-Repeat: >Fix: Patch attached with submission follows: --- src/osdep/freebsd.c 2013-12-18 14:02:41.000000000 -0800 +++ src/osdep/freebsd.c 2013-12-19 02:04:28.000000000 -0800 @@ -42,6 +42,7 @@ #include "osdep.h" + struct priv_fbsd { /* iface */ int pf_fd; @@ -522,6 +523,39 @@ 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; @@ -542,7 +576,9 @@ 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); >Release-Note: >Audit-Trail: >Unformatted: