Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #13323

Re: pcap problem

From Rich <rich@example.invalid>
Newsgroups comp.os.linux.misc
Subject Re: pcap problem
Date 2015-01-06 20:05 +0000
Organization My Linux Box
Message-ID <m8hf6c$7t5$1@dont-email.me> (permalink)
References <m8fhc1$d5g$1@speranza.aioe.org> <m8h8cv$7m3$1@dont-email.me> <m8hehg$p26$1@speranza.aioe.org>

Show all headers | View raw


Bill Cunningham <nospam@nspam.invalid> wrote:

> "John McCue" <jmccue@jmclin0.bstnma.east.verizon.net> wrote in

> > Check your if statements :)
> > Not sure if that is your issue but best to validate the
> > if statements, esp the equal ones.

> ...
> What do you mean validate IFs ?

He means that you are using "assignment" operators, not "comparison"
operators, in most of your if statements.  I.e.:

       if (pp = NULL) {

This assigns NULL to the variable pp.

You likely want:

      if (pp == NULL) {

which checks pp for equality to NULL.

Note, a way to get the compiler to complain about this style for you is
to reverse the two items in the if.  Write it this way:

  if (NULL == pp) {
or
  if (5 == variable) {

Then, if you leave off an = sign, you'll get a compile error about
invalid assignment.

Back to comp.os.linux.misc | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

pcap problem "Bill Cunningham" <nospam@nspam.invalid> - 2015-01-05 21:30 -0500
  Re: pcap problem John McCue <jmccue@jmclin0.bstnma.east.verizon.net> - 2015-01-06 18:09 +0000
    Re: pcap problem "Bill Cunningham" <nospam@nspam.invalid> - 2015-01-06 14:54 -0500
      Re: pcap problem Rich <rich@example.invalid> - 2015-01-06 20:05 +0000
        Re: pcap problem Richard Kettlewell <rjk@greenend.org.uk> - 2015-01-06 20:11 +0000
          Re: pcap problem Rich <rich@example.invalid> - 2015-01-06 21:22 +0000
          Re: pcap problem "Bill Cunningham" <nospam@nspam.invalid> - 2015-01-06 18:08 -0500
            Re: pcap problem Richard Kettlewell <rjk@greenend.org.uk> - 2015-01-07 09:20 +0000
      Re: pcap problem Mark Blair <mblair@quantumdata.com> - 2015-01-06 14:14 -0600
        Re: pcap problem "Bill Cunningham" <nospam@nspam.invalid> - 2015-01-06 18:05 -0500
        Re: pcap problem "Bill Cunningham" <nospam@nspam.invalid> - 2015-01-06 18:12 -0500
          Re: pcap problem Rich <rich@example.invalid> - 2015-01-06 23:37 +0000
            Re: pcap problem "Bill Cunningham" <nospam@nspam.invalid> - 2015-01-06 18:44 -0500

csiph-web