Linux Kernel Network Subsystem Patching
Aruna Hewapathirane
aruna.hewapathirane-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Sat Jan 11 02:12:50 UTC 2014
Thank's Ted will go through and see...
On Fri, Jan 10, 2014 at 9:03 PM, ted leslie <ted.leslie-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
> Not familiar with Git patch, but I guess it is just "patch".
> follow this
>
> https://groups.google.com/forum/#!topic/msysgit/6NNvXeyd5xM
>
> -tl
>
>
> On Fri, Jan 10, 2014 at 8:42 PM, Aruna Hewapathirane <
> aruna.hewapathirane-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
>
>> Ted believe me I have tried and tried and finally decided to ask for
>> help. The patch errors are below:
>>
>> aruna at aruna-desktop:/media/kernel-dev/next-net/net-next$ git
>> format-patch --subject-prefix="PATCH v1" HEAD^
>> 0001-Network-Subsystem-v2.patch
>>
>> aruna at aruna-desktop:/media/kernel-dev/next-net/net-next$ git apply
>> --check 0001-Network-Subsystem-v2.patch
>>
>> error: patch failed: net/core/neighbour.c:117
>>
>> error: net/core/neighbour.c: patch does not apply
>>
>> It makes no sense to me because all the other files compile clean nil
>> errors :(
>>
>> On Fri, Jan 10, 2014 at 8:36 PM, ted leslie <ted.leslie-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
>>
>>> What patch error are you getting?
>>>
>>> You can see what the patch is doing, you can just go put the changed two
>>> lines in with editor.
>>> -tl
>>>
>>>
>>>
>>>
>>> On Fri, Jan 10, 2014 at 8:05 PM, Aruna Hewapathirane <
>>> aruna.hewapathirane-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org> wrote:
>>>
>>>> Hello Everybody,
>>>>
>>>> I am a total newbie to kernel hacking and I have a question. Am trying
>>>> to patch the Network Subsystem and changing the net_random() to direct
>>>> calls of prandom_u32. Why ? Because it is
>>>> harder to audit / grep and new commits actually use prandom_u32 only
>>>> am told.
>>>>
>>>> u32 prandom_u32(void); /* defined in include/linux/random.h: */
>>>>
>>>> #define net_random() prandom_u32() /* defined in
>>>> include/linux/net.h */
>>>>
>>>> Everything works as expected until I get to net/core/neighbour.c and
>>>> then patch fails to apply.
>>>>
>>>> The diff is here:
>>>>
>>>>
>>>> -------------------------------------------------------------------------------------------------------------------------------
>>>> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
>>>> index 47d834e..ea97361 100644
>>>> --- a/net/core/neighbour.c
>>>> +++ b/net/core/neighbour.c
>>>> @@ -117,7 +117,7 @@ static void neigh_cleanup_and_release(struct
>>>> neighbour *neig
>>>>
>>>> unsigned long neigh_rand_reach_time(unsigned long base)
>>>> {
>>>> - return base ? (prandom_u32() % base) + (base >> 1) : 0;
>>>> + return base ? (net_random() % base) + (base >> 1) : 0;
>>>> }
>>>> EXPORT_SYMBOL(neigh_rand_reach_time);
>>>>
>>>> @@ -1415,7 +1415,7 @@ void pneigh_enqueue(struct neigh_table *tbl,
>>>> struct neigh_
>>>> struct sk_buff *skb)
>>>> {
>>>> unsigned long now = jiffies;
>>>> - unsigned long sched_next = now + (prandom_u32() %
>>>> + unsigned long sched_next = now + (net_random() %
>>>> NEIGH_VAR(p, PROXY_DELAY));
>>>>
>>>> if (tbl->proxy_queue.qlen > NEIGH_VAR(p, PROXY_QLEN)) {
>>>>
>>>> -------------------------------------------------------------------------------------------------------------------------------
>>>>
>>>> I can use some help and guidance please, what am I doing wrong ? Or not
>>>> seeing ? It's just this neighbor.c file that is doing this and I am
>>>> stumped.
>>>>
>>>> Thank you.
>>>> Aruna
>>>>
>>>> <https://sites.google.com/site/arunahewapathirane/home/business-card/buisness-card.png?attredirects=0>
>>>>
>>>
>>>
>>
>>
>> --
>> *Aruna Hewapathirane*
>> Consultant/Trainer
>> Phone : 647-709-9269
>> Website: <http://goog_1768911931>Open Source Solutions<http://sahanaya.net/aruna/>
>>
>>
>>
>>
>> <https://sites.google.com/site/arunahewapathirane/home/business-card/buisness-card.png?attredirects=0>
>>
>
>
--
*Aruna Hewapathirane*
Consultant/Trainer
Phone : 647-709-9269
Website: <http://goog_1768911931>Open Source
Solutions<http://sahanaya.net/aruna/>
<https://sites.google.com/site/arunahewapathirane/home/business-card/buisness-card.png?attredirects=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/legacy/attachments/20140110/fd60e9d9/attachment.html>
More information about the Legacy
mailing list