[OpenWrt-Devel] [PATCH] mini_snmpd: support for IPv6

2009-08-01 Thread Linus Lüssing
The following patch adds IPv6 support to mini-snmpd in the packages repository. 
It is then able to handle requests from IPv4 and IPv6 clients.

Signed-off-by: Linus Lüssing 

Index: net/mini_snmpd/patches/104-ipv6-support.patch
===
--- net/mini_snmpd/patches/104-ipv6-support.patch   (revision 0)
+++ net/mini_snmpd/patches/104-ipv6-support.patch   (revision 0)
@@ -0,0 +1,285 @@
+--- a/mini_snmpd.c
 b/mini_snmpd.c
+@@ -90,9 +90,10 @@
+ 
+ static void handle_udp_client(void)
+ {
+-  struct sockaddr_in sockaddr;
++  struct sockaddr_in6 sockaddr;
+   socklen_t socklen;
+   int rv;
++  char straddr[INET6_ADDRSTRLEN];
+ 
+   /* Read the whole UDP packet from the socket at once */
+   socklen = sizeof (sockaddr);
+@@ -105,8 +106,8 @@
+   }
+   g_udp_client.timestamp = time(NULL);
+   g_udp_client.sockfd = g_udp_sockfd;
+-  g_udp_client.addr = sockaddr.sin_addr.s_addr;
+-  g_udp_client.port = sockaddr.sin_port;
++  g_udp_client.addr = sockaddr.sin6_addr;
++  g_udp_client.port = sockaddr.sin6_port;
+   g_udp_client.size = rv;
+   g_udp_client.outgoing = 0;
+ #ifdef DEBUG
+@@ -114,13 +115,14 @@
+ #endif
+ 
+   /* Call the protocol handler which will prepare the response packet */
++  inet_ntop(AF_INET6, &sockaddr.sin6_addr, straddr, sizeof(straddr));
+   if (snmp(&g_udp_client) == -1) {
+   lprintf(LOG_WARNING, "could not handle packet from UDP client 
%s:%d: %m\n",
+-  inet_ntoa(sockaddr.sin_addr), sockaddr.sin_port);
++  straddr, sockaddr.sin6_port);
+   return;
+   } else if (g_udp_client.size == 0) {
+   lprintf(LOG_WARNING, "could not handle packet from UDP client 
%s:%d: ignored\n",
+-  inet_ntoa(sockaddr.sin_addr), sockaddr.sin_port);
++  straddr, sockaddr.sin6_port);
+   return;
+   }
+   g_udp_client.outgoing = 1;
+@@ -128,13 +130,14 @@
+   /* Send the whole UDP packet to the socket at once */
+   rv = sendto(g_udp_sockfd, g_udp_client.packet, g_udp_client.size,
+   MSG_DONTWAIT, (struct sockaddr *)&sockaddr, socklen);
++  inet_ntop(AF_INET6, &sockaddr.sin6_addr, straddr, sizeof(straddr));
+   if (rv == -1) {
+   lprintf(LOG_WARNING, "could not send packet to UDP client 
%s:%d: %m\n",
+-  inet_ntoa(sockaddr.sin_addr), sockaddr.sin_port);
++  straddr, sockaddr.sin6_port);
+   } else if (rv != g_udp_client.size) {
+   lprintf(LOG_WARNING, "could not send packet to UDP client 
%s:%d: "
+-  "only %d of %d bytes written\n", 
inet_ntoa(sockaddr.sin_addr),
+-  sockaddr.sin_port, rv, (int) g_udp_client.size);
++  "only %d of %d bytes written\n", straddr,
++  sockaddr.sin6_port, rv, (int) g_udp_client.size);
+   }
+ #ifdef DEBUG
+   dump_packet(&g_udp_client);
+@@ -143,11 +146,12 @@
+ 
+ static void handle_tcp_connect(void)
+ {
+-  struct sockaddr_in tmp_sockaddr;
+-  struct sockaddr_in sockaddr;
++  struct sockaddr_in6 tmp_sockaddr;
++  struct sockaddr_in6 sockaddr;
+   socklen_t socklen;
+   client_t *client;
+   int rv;
++  char straddr[INET6_ADDRSTRLEN];
+ 
+   /* Accept the new connection (remember the client's IP address and 
port) */
+   socklen = sizeof (sockaddr);
+@@ -168,10 +172,11 @@
+   lprintf(LOG_ERR, "could not accept TCP connection: 
internal error");
+   exit(EXIT_SYSCALL);
+   }
+-  tmp_sockaddr.sin_addr.s_addr = client->addr;
+-  tmp_sockaddr.sin_port = client->port;
++  tmp_sockaddr.sin6_addr = client->addr;
++  tmp_sockaddr.sin6_port = client->port;
++  inet_ntop(AF_INET6, &tmp_sockaddr.sin6_addr, straddr, 
sizeof(straddr));
+   lprintf(LOG_WARNING, "maximum number of %d clients reached, 
kicking out %s:%d\n",
+-  MAX_NR_CLIENTS, inet_ntoa(tmp_sockaddr.sin_addr), 
tmp_sockaddr.sin_port);
++  MAX_NR_CLIENTS, straddr, tmp_sockaddr.sin6_port);
+   close(client->sockfd);
+   } else {
+   client = malloc(sizeof (client_t));
+@@ -183,35 +188,38 @@
+   }
+ 
+   /* Now fill out the client control structure values */
++  inet_ntop(AF_INET6, &sockaddr.sin6_addr, straddr, sizeof(straddr));
+   lprintf(LOG_DEBUG, "connected TCP client %s:%d\n",
+-  inet_ntoa(sockaddr.sin_addr), sockaddr.sin_port);
++  straddr, sockaddr.sin6_port);
+   client->timestamp = time(NULL);
+   client->sockfd = rv;
+-  client->addr = sockaddr.sin_addr.s_addr;
+-  client->port = sockaddr.sin_port;
++  client->addr = sockaddr.sin6_addr;
++  client->port = sockaddr.sin6_port;

Re: [OpenWrt-Devel] WDS and broadcast/multicast?

2009-08-01 Thread David A . Bandel



On Sat, Aug 1, 2009 at 19:49, Jeremy Kerr wrote:

Hi all,

[sending this to -devel, as I haven't had any response on -users, hope
this is okay]

I've recently set up WDS between two WRT54Gs (one v2 and one v4).
However, with WDS enabled it seems that wireless clients aren't
receiving broadcast or multicast packets.



Have you reviewed the /proc filesystem?  Check the wireless interfaces for 
/proc/sys/net/ipv4/conf//mc_forwarding nad 
/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

Ciao,

David A. Bandel
--
Focus on the dream, not the competition.
   - Nemesis Air Racing Team motto
Visit my blog at: http://www.pananix.com/cgi-bin/blosxom




signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] WDS and broadcast/multicast?

2009-08-01 Thread Jeremy Kerr
Hi all,

[sending this to -devel, as I haven't had any response on -users, hope 
this is okay]

I've recently set up WDS between two WRT54Gs (one v2 and one v4).  
However, with WDS enabled it seems that wireless clients aren't 
receiving broadcast or multicast packets.

Some details:

 * Both WRTs are running 8.09.1, bcrm-2.4
 * There are wired hosts connected to both WRTs
 * There are a few wireless clients
 * Wireless is WPA/PSK

If I do a broadcast ping from the wired network, only other wired hosts 
will see the ping. However, this *includes* wired hosts on the other 
side of the WDS link. Wireless hosts do not see any ping packets. Same 
applies for UDP packets sent to the local broadcast address, as well as 
mutlicast packets.

If I do a broadcast ping from a wireless client, the wired hosts see the 
packet as expected.

If I disable WDS (and turn off the WDS-connected WRT, because it's now 
isolated from the network), then wireless clients are able to see the 
broadcast packets. ARP seems to work fine in both cases though.

Is this a known issue? Or perhaps a mistake in my configuration, or is 
there something I need to do to enable to allow broadcast and multicast 
packets to be sent on the wireless network?

I've included /etc/config/wireless for both WRTs below. Let me know if 
there's any other information that might assist.

Any help would be much appreciated, this has got me stumped :)

Cheers,


Jeremy

 /etc/config/wireless -

config wifi-device  wl0
option type broadcom
option channel  5

config wifi-iface
option device   wl0
option network  lan
option mode ap
option ssid ""
option encryption psk
option key  ""

config wifi-iface
   option device   wl0
   option network  lan
   option mode wds
   option bssid""
   option ssid ""
   option encryption psk
   option key  ""


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] mklibs.py integration

2009-08-01 Thread Daniel Dickinson
On Sat, 1 Aug 2009 05:03:22 -0400
Daniel Dickinson  wrote:

> 
> Doesn't mklibs.py remove portions of a library that are unused?
> Wouldn't that mean that fewer programs would result in more removal
> (due to more unused bits).   Or do you strip all libraries and not
> just uClibc?
> 

Never mind.  I see that you are stripping all libraries.  So yes, good
idea.  I was confused by your specifically mentioning the uClibc loader.
Can you give comparative squashfs sizes instead?

Also, this may takes signficantly long periods of time for large
numbers of packages.  Have you tested with more than the base setup?

Regards,

Daniel

-- 
And that's my crabbing done for the day.  Got it out of the way early, 
now I have the rest of the afternoon to sniff fragrant tea-roses or 
strangle cute bunnies or something.   -- Michael Devore
GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C  http://gnupg.org
The C Shore (Daniel Dickinson's Website) http://www.bmts.com/~cshore


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] mklibs.py integration

2009-08-01 Thread Florian Fainelli
Hi Daniel,

Le Saturday 01 August 2009 11:03:22 Daniel Dickinson, vous avez écrit :
> On Sat, 25 Jul 2009 12:25:20 +0200
>
> Florian Fainelli  wrote:
> > Hi all,
> >
> > Please find below a proof-of-concept of the mklibs.py reduction
> > integration in OpenWrt. I have not been able to strip the uClibc
> > loader more than 4KB out of 28KB (original size) but it might
> > significantly better results with more softare installed in the
> > rootfs. --- Index: Config.in
>
> Doesn't mklibs.py remove portions of a library that are unused?

It does indeed.

> Wouldn't that mean that fewer programs would result in more removal
> (due to more unused bits).   Or do you strip all libraries and not just
> uClibc?

I think I did not ask it to strip down all shared libraries, thus it only 
stripped down the linker. I will try to look at it later in the weekend.
-- 
Best regards, Florian Fainelli
Email: flor...@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
---


signature.asc
Description: This is a digitally signed message part.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC] mklibs.py integration

2009-08-01 Thread Daniel Dickinson
On Sat, 25 Jul 2009 12:25:20 +0200
Florian Fainelli  wrote:

> Hi all,
> 
> Please find below a proof-of-concept of the mklibs.py reduction
> integration in OpenWrt. I have not been able to strip the uClibc
> loader more than 4KB out of 28KB (original size) but it might
> significantly better results with more softare installed in the
> rootfs. --- Index: Config.in

Doesn't mklibs.py remove portions of a library that are unused?
Wouldn't that mean that fewer programs would result in more removal
(due to more unused bits).   Or do you strip all libraries and not just
uClibc?

Regards,

Daniel
-- 
And that's my crabbing done for the day.  Got it out of the way early, 
now I have the rest of the afternoon to sniff fragrant tea-roses or 
strangle cute bunnies or something.   -- Michael Devore
GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C  http://gnupg.org
The C Shore (Daniel Dickinson's Website) http://www.bmts.com/~cshore


signature.asc
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel