Small patch to multicast code...
Sam Leffler
sam at freebsd.org
Fri Aug 29 16:32:11 UTC 2008
Luigi Rizzo wrote:
> On Tue, Aug 26, 2008 at 05:56:13PM -0700, Sam Leffler wrote:
>
>> gnn at freebsd.org wrote:
>>
>>> At Tue, 26 Aug 2008 14:50:33 +0000 (UTC),
>>> Bjoern A. Zeeb wrote:
>>>
>>>
>>>> On Tue, 26 Aug 2008, George V. Neville-Neil wrote:
>>>>
>>>> Hi,
>>>>
>>>>
>>>>
>>>>> At Mon, 25 Aug 2008 21:40:38 +0200,
>>>>> John Hay wrote:
>>>>>
>>>>>
>>>>>> I have tried it and it does fix my problem. RIP2 over multicast works
>>>>>> again. :-)
>>>>>>
>>>>>>
>>>>> Good to hear. I'm waiting on a bit more feedback but I think I'll be
>>>>> checking this in soon, with a big comment talking about the
>>>>> performance implications etc.
>>>>>
>>>>>
>>>> So wait a second; what was the m_pullup vs. m_dup thing? Has anyone
>>>> actually tried that? I mean using a sledgehammer if a mitten would be
>>>> enough is kind of .. uhm. You get it.
>>>>
>>>>
>>> Perhaps I'm confused, I've been off dealing with other issues for a
>>> few days, but m_pullup doesn't make a copy of the packet or its
>>> fields, only makes sure that it's contiguous in memory. Am I wrong in
>>> that?
>>>
>>> Since the bug is that two pieces of code modify the same data, in ways
>>> that interfere, I'm not sure how we can avoid making a copy. It might
>>> be nice to limit the copy, but we'd still need two copies, one for the
>>> loopback device and one for the real device.
>>>
>>>
>>>
>> pull the headers up. copy just the headers. no deep copy.
>>
>
> and to be more explicit - the result of m_pullup is that
> the number of bytes specified as m_pullup argument are in
> a private piece of memory -- the 'data' region within the mbuf -- so
> you can freely play with them without trouble.
>
> That is why i suggested to just increase the argument to m_pullup
> by the size of the udp header so one can overwrite the checksum
> within the mbuf without touching the shared part in the cluster
> (if any).
>
Hmm, never considered the m_pullup guaranteed a private copy (but I see
it in the code). The original semantics were just that the data was
contiguous.
Sam
More information about the freebsd-net
mailing list