Re: OpenBSD's tcpdrop(8)

From: Maxim Konovalov (maxim_at_macomnet.ru)
Date: 01/31/05

  • Next message: Robert Watson: "Jan 31 09:00:33 www ftpd[26164]: Internal: maskurg() while no transfer"
    Date: Mon, 31 Jan 2005 16:42:50 +0300 (MSK)
    To: Robert Watson <rwatson@FreeBSD.org>
    
    

    On Mon, 31 Jan 2005, 13:14-0000, Robert Watson wrote:

    >
    > On Mon, 31 Jan 2005, Maxim Konovalov wrote:
    >
    > > > The locking in the 6.x version looked reasonable, although you need to
    > > > check to see if the (tp) returned by tcp_drop() is NULL or not and then
    > > > conditionally unlock the inpcb if it's non-NULL -- otherwise you might
    > > > unlock a free'd inpcb. There doesn't seem to be much validation of the
    > > > tcp_ident_mapping structure, such as validation that the address lengths,
    > > > etc, are correct?
    > >
    > > I've updated the diff for HEAD. How does it look now? TIA!
    >
    > The locking needs slightly more tweaking -- note that you still need to
    > unlock (inp) if (tp = intotcpcb(inp)) returns NULL, and right now that
    > won't happen. The "check tp for NULL" unlock case should only occur if
    > you call tcp_drop(). Perhaps something like this:
    >
    > INP_LOCK(inp);
    > if ((tp = intotcpcb(inp)) &&
    > ((inp->inp_socket->so_options & SO_ACCEPTCONN) == 0)) {
    > tp = tcp_drop(tp, ECONNABORTED);
    > if (tp != NULL)
    > INP_UNLOCK(inp);
    > } else
    > INP_UNLOCK(inp);

    I see, updated. Thanks!

    --
    Maxim Konovalov
    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
    

  • Next message: Robert Watson: "Jan 31 09:00:33 www ftpd[26164]: Internal: maskurg() while no transfer"

    Relevant Pages

    • Re: tcsh in current-8.0 coredump
      ... Diff to: previous 1.1.1.7: preferred, ... Import vendor patch to fix postcmd regression in tcsh-6.15.00. ... But this bug was not fixed in HEAD. ... retrieving revision 1.1.1.9 ...
      (freebsd-current)
    • Re: Good SVN client?
      ... I can see another method, but the only difference would be not to rename anything or take everything from repository, just use diffs and make your additional copy of repository file on the fly. ... If something goes wrong- I check, diff with previous ... knowing that HEAD will probably deviate from my local ... Access subversion usual way to check in, use WebDAV for diff-ing. ...
      (comp.arch.embedded)
    • Re: ot: Heart Attacks
      ... I've got it into my head that I'm going to have one so I want to ... A small TIA will also get you entry to the club too. ... ('three foot high vertigo') ... from the toilet floor and get back to my desk I felt really ill and my ...
      (uk.rec.motorcycles)
    • Re: Perforce and `p4 diff2 against the origin
      ... If I diff foo.c against baz.c should it diff against #1 or #2? ... The other thing to recall is that if you were just using p4 w/o HEAD in CVS you wouldn't generate patches in the first place. ... I do this at work where all out stuff lives in p4 and don't really use patches much anymore except to review before a submit (so I ... Thus, we use p4 in a bit of an odd way since HEAD is in CVS and if you use it as it is designed to be used patches aren't all that important, hence they aren't going to focus as much effort on it. ...
      (freebsd-hackers)
    • Re: Perforce and `p4 diff2 against the origin
      ... I diff foo.c against baz.c should it diff against #1 or #2? ... just using p4 w/o HEAD in CVS you wouldn't generate patches in the first ... branches up into HEAD. ... don't really use patches much anymore except to review before a submit (so I ...
      (freebsd-hackers)