From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Mariusz Janiak <mariuszjaniak@wp.pl>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] Odp: Re: RTnet -- receive broadcast frame at the local machine
Date: Wed, 2 Mar 2016 14:07:33 +0100 [thread overview]
Message-ID: <20160302130733.GA14986@hermes.click-hack.org> (raw)
In-Reply-To: <56d616b706ffa3.50702648@wp.pl>
On Tue, Mar 01, 2016 at 11:24:55PM +0100, Mariusz Janiak wrote:
> > From what I understand from this post, it is not easy to fix, as it
> > requires duplicating packets. So, patch welcome.
>
> Ok, we went back to the original question, could someone point the
> place that has to be modified. I have played a little bit with the
> RTnet stack recently, but this task require far better
> understanding of the stack. Maybe someone more advanced can give
> some guidelines.
It is not that complicated. The udp send function (rt_udp_sendmsg)
is in udp.c, it calls rt_ip_route_output (found in route.c) to find
the output route, than rt_ip_build_xmit (found in ip_output.c) to
build the packet and send in on the device. rt_ip_build_xmit calls
rt_eth_header to build the ethernet header (found in eth.c), then
rtdev_xmit (found in dev.c) to send the packet.
So you can do this either at the IP level in rt_ip_build_xmit, or at
the ethernet level in rtdev_xmit. What you need to do is that when
the destination is broadcast (there should be a macro to test that
an IP address is broadcast if you want to do it at IP level, and the
mac address for broadcast is just ff:ff:ff:ff:ff:ff if you want to
do it at ethernet level) you need to duplicate the packet, and
either trigger a receive on the same device, or send the packet on
the loopback device. If you go the ethernet route, you will have to
use a per-device callback to test if the destination is broadcast,
as rtdev_xmit is supposed to not be specific to ethernet, like is
done with the hard_header and start_xmit callbacks.
Hope this helps.
Regards.
--
Gilles.
https://click-hack.org
next prev parent reply other threads:[~2016-03-02 13:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 22:24 [Xenomai] Odp: Re: RTnet -- receive broadcast frame at the local machine Mariusz Janiak
2016-03-02 13:07 ` Gilles Chanteperdrix [this message]
2016-03-02 13:25 ` Gilles Chanteperdrix
-- strict thread matches above, loose matches on Subject: below --
2016-03-03 9:15 Mariusz Janiak
2016-03-03 9:08 Mariusz Janiak
2016-03-01 21:59 Mariusz Janiak
2016-03-01 22:05 ` Gilles Chanteperdrix
2016-02-29 21:57 Mariusz Janiak
2016-03-01 6:57 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160302130733.GA14986@hermes.click-hack.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=mariuszjaniak@wp.pl \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.