Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2002 23:12:31 -0700 (PDT)
From:      Philip Hallstrom <philip@adhesivemedia.com>
To:        Patrick Thomas <root@utility.clubscholarship.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: how to apply a cut and paste patchfile
Message-ID:  <20020809231142.B5908-100000@cypress.adhesivemedia.com>
In-Reply-To: <20020809225516.H58763-100000@utility.clubscholarship.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I'm not sure what's wrong with patch (don't use it much) but the patch
below is pretty simple (just the addition of two lines).

Why not just edit in_pcb.c and go to line 501 (or there abouts) and look
for the code to insert those two lines...

would have the same effect...

On Fri, 9 Aug 2002, Patrick Thomas wrote:

>
> Hello,
>
> I have seen in a usenet posting a patch I would like to apply to
> /usr/src/sys/netinet/in_pcb.c
>
> As I say, the patch is in a news posting.  So, I copied and pasted from
> the news posting into a file called:
>
> /usr/src/sys/netinet/patchfile
>
> My cut/paste looked just like this:
>
> --- in_pcb.c.old        Mon Mar 18 23:57:57 2002
> +++ in_pcb.c    Tue Mar 19 09:52:45 2002
> @@ -501,6 +501,8 @@
>         int error;
>         if (inp->inp_laddr.s_addr == INADDR_ANY && p->p_prison != NULL) {
> +               if (inp->inp_lport != 0)
> +                       inp->inp_laddr.s_addr = htonl(p->p_prison->pr_ip);
>                 bzero(&sa, sizeof (sa));
>                 sa.sin_addr.s_addr = htonl(p->p_prison->pr_ip);
>                 sa.sin_len=sizeof (sa);
>
> then I saved the file, and while in the /usr/src/sys/netinet directory, I
> ran the command:
>
> patch < patchfile
>
> and I got this error:
>
> Hmm...  Looks like a unified diff to me...
> The text leading up to this was:
> --------------------------
> |--- in_pcb.c.old        Mon Mar 18 23:57:57 2002
> |+++ in_pcb.c    Tue Mar 19 09:52:45 2002
> --------------------------
> Patching file in_pcb.c using Plan A...
> Hunk #1 failed at 501.
> 1 out of 1 hunks failed--saving rejects to in_pcb.c.rej
> done
>
>
> So ... what am I doing wrong ?  Am I screwing up the patchfile when I
> copy/paste it and the tab indents turn into multiple space indents ?  Or
> some other thing getting lost in the copy/paste translation ?
>
> Or am I doing something else wrong ?
>
> thanks,
>
> PT
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020809231142.B5908-100000>