1

I've been googling for a while about how to do patch linux kernel but still have no clue. My intention is to do a patch to /net/ipv4/ip_gre.c . the patch is from here http://patchwork.ozlabs.org/patch/264994/

diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
    index 855004f..c52fee0 100644
    --- a/net/ipv4/ip_gre.c
    +++ b/net/ipv4/ip_gre.c
    @@ -572,7 +572,7 @@  static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
        if (daddr)
            memcpy(&iph->daddr, daddr, 4);
        if (iph->daddr)
    -       return t->hlen;
    +       return t->hlen + sizeof(*iph);

        return -(t->hlen + sizeof(*iph));
     }

doing patch command still no success. so i tried change the line just like decribed in the patch to the file i wanted to patch, delete the (-) and add (+) line.

does the ip_gre.c file need to be compiled again??

lapmer
  • 11
  • Why don't you do it in the Ubuntu way as Oli's answer say? BTW, that is a git patch, so it normally needs -p1 to slice the first path. – Braiam Sep 03 '13 at 13:10
  • thanks for your reply. i have tried it that way but it seems i did mistype or something funny happened so the command won't work. and after i tried again, it works. but for some long patch there are still errors when patching.. i wonder why?? maybe the patch need to be split? – lapmer Sep 04 '13 at 11:49
  • There are ways to convert that patch into quilt patch. Also, if you were playing with the package you may need to clean the build directory. – Braiam Sep 04 '13 at 11:52

0 Answers0