From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19535 invoked by alias); 11 Aug 2009 13:32:36 -0000 Received: (qmail 19523 invoked by uid 22791); 11 Aug 2009 13:32:33 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_20,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from www.meduna.org (HELO meduna.org) (92.240.244.38) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Aug 2009 13:32:24 +0000 Received: from dial-78-141-95-31-orange.orange.sk ([78.141.95.31] helo=[192.168.130.27]) by meduna.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MarSb-0008Fx-2n for ecos-discuss@ecos.sourceware.org; Tue, 11 Aug 2009 15:32:19 +0200 Message-ID: <4A8172DA.4070001@meduna.org> Date: Tue, 11 Aug 2009 13:32:00 -0000 From: Stanislav Meduna User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: eCos Discussion Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Authenticated-User: stano@meduna.org X-Authenticator: dovecot_plain X-Spam-Score: -8.1 X-Spam-Score-Int: -80 X-Exim-Version: 4.69 (build at 30-Sep-2008 18:26:44) X-Date: 2009-08-11 15:32:19 X-Connected-IP: 78.141.95.31:3608 X-Message-Linecount: 78 X-Body-Linecount: 68 X-Message-Size: 2210 X-Body-Size: 1815 X-Received-Count: 1 X-Recipient-Count: 1 X-Local-Recipient-Count: 1 X-Local-Recipient-Defer-Count: 0 X-Local-Recipient-Fail-Count: 0 X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: How to send UDP broadcast to 255.255.255.255? X-SW-Source: 2009-08/txt/msg00029.txt.bz2 Jay Foster wrote: > You can try the following patch that someone added > to my local source. It adds a CDL option > (CYGOPT_NET_INET_FORCE_DIRECTED_BROADCAST I also stumbled upon the problem mentioned in the older post and I'd like to confirm that the patch from http://www.mail-archive.com/ecos-discuss@ecos.sourceware.org/msg09992.html seems to really help. Using this and setting the default route to my interface (code borrowed from the ppp) static int setDefaultRoute(u_int32_t g, int cmd) { static int rtm_seq; int routes; struct { struct rt_msghdr hdr; struct sockaddr_in dst; struct sockaddr_in gway; struct sockaddr_in mask; } rtmsg; if ((routes = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) { diag_printf("Couldn't %s default route: socket: %d\n", cmd=='s'? "add": "delete",errno); return 0; } memset(&rtmsg, 0, sizeof(rtmsg)); rtmsg.hdr.rtm_type = cmd == 's'? RTM_ADD: RTM_DELETE; rtmsg.hdr.rtm_flags = RTF_UP | RTF_GATEWAY | RTF_STATIC; rtmsg.hdr.rtm_version = RTM_VERSION; rtmsg.hdr.rtm_seq = ++rtm_seq; rtmsg.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY | RTA_NETMASK; rtmsg.dst.sin_len = sizeof(rtmsg.dst); rtmsg.dst.sin_family = AF_INET; rtmsg.gway.sin_len = sizeof(rtmsg.gway); rtmsg.gway.sin_family = AF_INET; rtmsg.gway.sin_addr.s_addr = g; rtmsg.mask.sin_len = sizeof(rtmsg.dst); rtmsg.mask.sin_family = AF_INET; rtmsg.hdr.rtm_msglen = sizeof(rtmsg); if (write(routes, &rtmsg, sizeof(rtmsg)) < 0) { diag_printf("Couldn't %s default route: %d\n", cmd=='s'? "add": "delete",errno); close(routes); return 0; } close(routes); return 1; } I am able to send the broadcasts as I intended. I'd vote for the inclusion of the option in the main tree. Thanks -- Stano -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss