From owner-freebsd-questions Fri Aug 9 23:12:38 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 215AD37B400 for ; Fri, 9 Aug 2002 23:12:34 -0700 (PDT) Received: from cypress.adhesivemedia.com (cypress.adhesivemedia.com [207.202.159.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7904843E42 for ; Fri, 9 Aug 2002 23:12:33 -0700 (PDT) (envelope-from philip@adhesivemedia.com) Received: from cypress.adhesivemedia.com (localhost [127.0.0.1]) by cypress.adhesivemedia.com (8.12.3/8.12.3) with ESMTP id g7A6CV1b005954; Fri, 9 Aug 2002 23:12:31 -0700 (PDT) (envelope-from philip@adhesivemedia.com) Received: from localhost (philip@localhost) by cypress.adhesivemedia.com (8.12.3/8.12.3/Submit) with ESMTP id g7A6CVCM005951; Fri, 9 Aug 2002 23:12:31 -0700 (PDT) X-Authentication-Warning: cypress.adhesivemedia.com: philip owned process doing -bs Date: Fri, 9 Aug 2002 23:12:31 -0700 (PDT) From: Philip Hallstrom To: Patrick Thomas Cc: freebsd-questions@FreeBSD.ORG Subject: Re: how to apply a cut and paste patchfile In-Reply-To: <20020809225516.H58763-100000@utility.clubscholarship.com> Message-ID: <20020809231142.B5908-100000@cypress.adhesivemedia.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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