LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-04-2006, 12:23 PM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Boston, MA
Distribution: Debian
Posts: 380

Rep: Reputation: 30
need help applying this kernel patch that gives 3 hunk failures


Hi,

I am having trouble applying a kernel patch that gives me 3 hunk failures. This is slightly difficult because the code in the patch is not under the GPL So I have "masked" the code in the best way possible. If anyone could help me apply this patch i'd greatly appreciate it.

- George


I get the following output trying to apply the patch:
Code:
monster linux # patch -p0 < endhost-2.4.patch 
patching file include/net/sock.h
Hunk #1 FAILED at 429.
1 out of 1 hunk FAILED -- saving rejects to file include/net/sock.h.rej
patching file include/net/tcp.h
Hunk #1 succeeded at 424 (offset 18 lines).
Hunk #2 succeeded at 435 (offset 18 lines).
Hunk #3 succeeded at 1560 (offset 108 lines).
patching file include/linux/tcp.h
patching file net/ipv4/tcp.c
Hunk #1 succeeded at 2401 (offset 8 lines).
patching file net/ipv4/tcp_input.c
Hunk #1 succeeded at 130 (offset 20 lines).
Hunk #2 succeeded at 276 (offset 20 lines).
Hunk #3 succeeded at 391 with fuzz 2 (offset -94 lines).
Hunk #4 succeeded at 909 (offset 204 lines).
Hunk #5 succeeded at 1270 (offset 204 lines).
Hunk #6 succeeded at 1318 (offset 208 lines).
Hunk #7 succeeded at 1619 (offset 208 lines).
Hunk #8 succeeded at 1649 (offset 221 lines).
Hunk #9 succeeded at 1694 (offset 224 lines).
Hunk #10 succeeded at 1796 with fuzz 2 (offset 225 lines).
Hunk #11 succeeded at 1936 (offset 225 lines).
Hunk #12 succeeded at 1988 (offset 225 lines).
Hunk #13 succeeded at 2138 with fuzz 1 (offset 288 lines).
Hunk #14 succeeded at 2572 (offset 523 lines).
Hunk #15 succeeded at 2875 with fuzz 2 (offset 752 lines).
Hunk #16 succeeded at 2931 (offset 754 lines).
Hunk #17 succeeded at 3037 (offset 754 lines).
Hunk #18 succeeded at 3966 (offset 754 lines).
patching file net/ipv4/tcp_output.c
Hunk #1 succeeded at 116 (offset 3 lines).
Hunk #2 FAILED at 227.
Hunk #3 succeeded at 574 (offset 16 lines).
1 out of 3 hunks FAILED -- saving rejects to file net/ipv4/tcp_output.c.rej
patching file net/ipv4/fp16.c
socket.h reject file:
Code:
monster linux # cat include/net/sock.h.rej 
***************
*** 429,434 ****
        __u32                   frto_highmark; /* snd_nxt when RTO occurred */
  
        unsigned long last_synq_overflow; 
  };
  
        
--- 429,452 ----
        __u32                   frto_highmark; /* snd_nxt when RTO occurred */
  
        unsigned long last_synq_overflow; 
+ 
+ #ifdef SOME_DEFINE
+       int     blahblah;
+       struct a_structure {
+               int a_declaration;
+               ...........
+               .............
+ 
+ #define ANOTHER_DEFINE        (0x7fff) 
+              int some_more_declarations; 
+              ................
+              ...............
+ 
+               ..........
+               .............
+       } a_struct;
+ #endif
+ 
  };
net/ipv4/tcp_output.c reject file:
Code:
monster linux # cat net/ipv4/tcp_output.c.rej
***************
*** 226,231 ****
                        tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED +
                                            (tp->eff_sacks * TCPOLEN_SACK_PERBLOCK));
                }
                th = (struct tcphdr *) skb_push(skb, tcp_header_size);
                skb->h.th = th;
                skb_set_owner_w(skb, sk);
--- 227,264 ----
                        tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED +
                                            (tp->eff_sacks * TCPOLEN_SACK_PERBLOCK));
                }
+ #ifdef A_DEFINE
+               if ((tp->blah_blah) && !(tcb->flags &
+                         (TCPCB_FLAG_SYN | TCPCB_FLAG_FIN | TCPCB_FLAG_RST))) {
+                       ......
+                      ............
+                       ............
+                         ............
+                            ............
+                       ............
+                            ............
+                            ............
+                            ............
+                       }
+ 
+                       /*
+                        *............
+                        * ............
+                        * ............
+                        * ............
+                        *............
+                        */
+                       if (something_is_true &&
+                           (more_is_true)) {
+                               ............
+                              ............
+                       }
+                       /* ............
+                        * ............
+                        * ............
+                        */
+               }
+ #endif
                th = (struct tcphdr *) skb_push(skb, tcp_header_size);
                skb->h.th = th;
                skb_set_owner_w(skb, sk);
Sorry, that really sucked, bless the GPL :P
 
Old 04-05-2006, 03:10 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617Reputation: 3617
Looking at the .rej's I only see chunks you can add. Should be easy. If you for instance take net/ipv4/tcp_output.c.rej you'll see, looking at the add sign markers, the patch code should be placed between:
Code:
                        tcp_header_size += (TCPOLEN_SACK_BASE_ALIGNED +
                                            (tp->eff_sacks * TCPOLEN_SACK_PERBLOCK));
                }
and
Code:
                th = (struct tcphdr *) skb_push(skb, tcp_header_size);
                skb->h.th = th;
                skb_set_owner_w(skb, sk);
Same goes for the other ones. Only stuff to add, no fuzz.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Applying Kernel Patch browser Linux - Software 2 08-31-2005 06:18 AM
Applying a kernel patch.. RoaCh Of DisCor Linux - Software 2 05-07-2005 07:41 PM
applying kernel patch pirozzi Debian 1 12-01-2004 07:47 AM
applying ck kernel patch Abe_the_Man Linux - General 1 01-29-2004 11:43 AM
kernel compilation; applying patch h/w Linux - Software 11 07-23-2003 10:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration