From patchwork Thu Sep 25 14:50:02 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 5333 Received: from john.hrz.tu-chemnitz.de (john.hrz.tu-chemnitz.de [134.109.132.2]) by open-mesh.net (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id m8PEslBG011763 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 25 Sep 2008 16:54:48 +0200 Received: from galba.hrz.tu-chemnitz.de ([134.109.133.156] helo=mailbox.hrz.tu-chemnitz.de) by john.hrz.tu-chemnitz.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1KisAV-0001wg-Ik for b.a.t.m.a.n@open-mesh.net; Thu, 25 Sep 2008 16:50:11 +0200 Received: from vpnclient-009.hrz.tu-chemnitz.de ([134.109.232.9] helo=sven-desktop) by mailbox.hrz.tu-chemnitz.de with smtp (Exim 4.69) (envelope-from ) id 1KisAQ-00045O-9m for b.a.t.m.a.n@open-mesh.net; Thu, 25 Sep 2008 16:50:11 +0200 Received: by sven-desktop (nbSMTP-1.00) for uid 1000 sven.eckelmann@gmx.de; Thu, 25 Sep 2008 16:50:07 +0200 (CEST) Date: Thu, 25 Sep 2008 16:50:02 +0200 From: Sven Eckelmann To: b.a.t.m.a.n@open-mesh.net Message-ID: <20080925145002.GA9344@sven-desktop.lazhur.ath.cx> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Scan-Signature: fcf1401baba826a07c1d2e148aadced1 Subject: [B.A.T.M.A.N.] [PATCH] Allow unoptimized builds of batgat X-BeenThere: b.a.t.m.a.n@open-mesh.net X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Sep 2008 14:54:48 -0000 Currently htons is a functions provided by userspace libraries and will only be replaced by a special builtin functions of gcc when optimization is enabled. Linux v2.6.27-rc2-497-gbc2aa80 will provide these function symbols as macros for in-kernel usage. --- batman/linux/modules/gateway.c | 4 ++-- batman/linux/modules/gateway24.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/batman/linux/modules/gateway.c b/batman/linux/modules/gateway.c index 9411575..41d75b5 100644 --- a/batman/linux/modules/gateway.c +++ b/batman/linux/modules/gateway.c @@ -313,7 +313,7 @@ static int packet_recv_thread(void *data) server_addr.sin_family = AF_INET; server_addr.sin_addr.s_addr = INADDR_ANY; - server_addr.sin_port = htons( (unsigned short) BATMAN_PORT ); + server_addr.sin_port = __constant_htons( (unsigned short) BATMAN_PORT ); if ( ( sock_create_kern( PF_INET, SOCK_RAW, IPPROTO_RAW, &inet_sock ) ) < 0 ) { @@ -551,7 +551,7 @@ static int bat_netdev_xmit( struct sk_buff *skb, struct net_device *dev ) sa.sin_family = AF_INET; sa.sin_addr.s_addr = client_data->wip_addr; - sa.sin_port = htons( (unsigned short)BATMAN_PORT ); + sa.sin_port = __constant_htons( (unsigned short)BATMAN_PORT ); msg.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT; msg.msg_name = &sa; diff --git a/batman/linux/modules/gateway24.c b/batman/linux/modules/gateway24.c index 9b60fe4..dbd1f42 100644 --- a/batman/linux/modules/gateway24.c +++ b/batman/linux/modules/gateway24.c @@ -291,7 +291,7 @@ static int packet_recv_thread(void *data) server_addr.sin_family = AF_INET; server_addr.sin_addr.s_addr = INADDR_ANY; - server_addr.sin_port = htons( (unsigned short) BATMAN_PORT ); + server_addr.sin_port = __constant_htons( (unsigned short) BATMAN_PORT ); if ( ( sock_create( PF_INET, SOCK_RAW, IPPROTO_RAW, &inet_sock ) ) < 0 ) { @@ -509,7 +509,7 @@ static int bat_netdev_xmit( struct sk_buff *skb, struct net_device *dev ) sa.sin_family = AF_INET; sa.sin_addr.s_addr = client_data->wip_addr; - sa.sin_port = htons( (unsigned short)BATMAN_PORT ); + sa.sin_port = __constant_htons( (unsigned short)BATMAN_PORT ); msg.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT; msg.msg_name = &sa;