Return to BSD News archive
Xref: sserve comp.os.386bsd.bugs:2214 comp.protocols.ppp:4079 Path: sserve!newshost.anu.edu.au!munnari.oz.au!bunyip.cc.uq.oz.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!vixen.cso.uiuc.edu!newsrelay.iastate.edu!news.iastate.edu!ponderous.cc.iastate.edu!michaelv From: michaelv@iastate.edu (Michael L. VanLoon) Newsgroups: comp.os.386bsd.bugs,comp.protocols.ppp Subject: Re: priority queuing bug in *BSD ppp (if_ppp.c) Date: 12 May 94 01:05:05 GMT Organization: Iowa State University, Ames, Iowa Lines: 39 Message-ID: <michaelv.768704705@ponderous.cc.iastate.edu> References: <1994May7.004353.695@fasterix.frmug.fr.net> <1994May10.130723.28188@zen.void.oz.au> <2qrk8v$qnb@news.iastate.edu> NNTP-Posting-Host: ponderous.cc.iastate.edu Keywords: ppp BSD In <2qrk8v$qnb@news.iastate.edu> john@iastate.edu (John Hascall) writes: >Simon J. Gerraty <sjg@zen.void.oz.au> wrote: >}pb@fasterix.frmug.fr.net (Pierre Beyssac) writes: >}> if (INTERACTIVE(p & 0xffff) || INTERACTIVE(p >> 16)) > [should be] >}> if (INTERACTIVE(ntohs(p & 0xffff)) || INTERACTIVE(ntohs(p >> 16))) >}I suspect that >} if (INTERACTIVE(ntohs(p) & 0xffff) || INTERACTIVE(ntohs(p) >> 16)) >}is more likely to resolve the ntohs() problem without changing the >}meaning of the code. ntohs(p >> 16) and ntohs(p) >> 16 can >}produce _very_ different results. > That they do -- with the former being correct > (provided p is unsigned). > I never seen the PPP code in question, but dimes to > donuts, the variable "p" is the 32 bit quantity: > +--------+--------+--------+--------+ > | source port | dest port | > +--------+--------+--------+--------+ > (or vice-versa depending on your endian-preference). >John Hascall ``An ill-chosen word is the fool's messenger.'' Which makes it sound to me like (ntohl(p) >> 16) is what's needed... --Michael -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Michael L. VanLoon Iowa State University Computation Center michaelv@iastate.edu Project Vincent Systems Staff Free your mind and your machine -- NetBSD free Un*x for PC/Mac/Amiga/etc. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -