public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Marek Lindner <mareklindner@neomailbox.ch>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Antonio Quartulli <antonio@open-mesh.com>,
	Antonio Quartulli <antonio@meshcoding.com>
Subject: Re: [B.A.T.M.A.N.] [PATCHv4] batctl: tcpdump - parse TVLV containers
Date: Sat, 01 Nov 2014 21:59:41 +0800	[thread overview]
Message-ID: <6288964.lM668JhyGs@diderot> (raw)
In-Reply-To: <1408547097-23491-1-git-send-email-antonio@meshcoding.com>

[-- Attachment #1: Type: text/plain, Size: 1613 bytes --]

On Wednesday 20 August 2014 17:04:57 Antonio Quartulli wrote:
> @@ -494,14 +632,32 @@ static void dump_batman_iv_ogm(unsigned char
> *packet_buff, ssize_t buff_len, int printf("BAT %s: ",
>                get_name_by_macaddr((struct ether_addr
> *)batman_ogm_packet->orig, read_opt)); 
> -       printf("OGM IV via neigh %s, seq %u, tq %3d, ttl %2d, v %d, flags
> [%c%c%c], length %zu\n", +       tvlv_len =
> ntohs(batman_ogm_packet->tvlv_len);
> +       printf("OGM IV via neigh %s, seq %u, tq %3d, ttl %2d, v %d, flags
> [%c%c%c], length %zu, tvlv_len %zu\n", get_name_by_macaddr((struct
> ether_addr *)ether_header->ether_shost, read_opt),
> ntohl(batman_ogm_packet->seqno), batman_ogm_packet->tq,
> batman_ogm_packet->ttl, batman_ogm_packet->version,
> (batman_ogm_packet->flags & BATADV_NOT_BEST_NEXT_HOP ? 'N' : '.'),
> (batman_ogm_packet->flags & BATADV_DIRECTLINK ? 'D' : '.'),
> (batman_ogm_packet->flags & BATADV_PRIMARIES_FIRST_HOP ? 'F' : '.'),
> -              (size_t)buff_len - sizeof(struct ether_header));
> +              check_len, tvlv_len);
> +
> +       check_len -= sizeof(struct batadv_ogm_packet);
> +       LEN_CHECK(check_len, tvlv_len, "BAT OGM TVLV (containers)");

    CC tcpdump.o
tcpdump.c: In function ‘dump_batman_iv_ogm’:
tcpdump.c:59:24: warning: comparison between signed and unsigned integer 
expressions [-Wsign-compare]
 if ((size_t)(buff_len) < (check_len)) { \
                        ^
tcpdump.c:646:2: note: in expansion of macro ‘LEN_CHECK’
  LEN_CHECK(check_len, tvlv_len, "BAT OGM TVLV (containers)");
  ^

Cheers,
Marek


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

      reply	other threads:[~2014-11-01 13:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-20 15:04 [B.A.T.M.A.N.] [PATCHv4] batctl: tcpdump - parse TVLV containers Antonio Quartulli
2014-11-01 13:59 ` Marek Lindner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6288964.lM668JhyGs@diderot \
    --to=mareklindner@neomailbox.ch \
    --cc=antonio@meshcoding.com \
    --cc=antonio@open-mesh.com \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox