]> The Tcpdump Group git mirrors - libpcap/commit
Redo the URL parsing.
authorGuy Harris <[email protected]>
Tue, 5 Sep 2017 04:29:22 +0000 (21:29 -0700)
committerGuy Harris <[email protected]>
Tue, 5 Sep 2017 04:29:22 +0000 (21:29 -0700)
commit195c2e947cb599d16c77c18f6a4e810548beef3e
tree9ef3b89964143ea9e0367f336f383bc30badd038
parent311a688dc4a8b68fe9a902ffea3658ffbd657e42
Redo the URL parsing.

Have a pcap_parse_source routine that attempts to parse a string that
might be a URL or might just be a device, and that allocates strings for
the various components.

Use that in pcap_parsesrcstr().

This avoids using sscanf() (which causes warnings when compiled with
newer versions of MSVC, and which is a bit of a hackish way to parse
strings in any case), and also fixes the parsing of IPv6address as the
host (yes, they *can* contain alphabetic characters - the text format of
IPv6 addresses is made up of hex strings, so you can get a through f).

So, while we're at it, fix pcap_createsrcstr() to properly recognize
IPv6 addresses - just look for something containing colons, rather than
looking for something not containing letters.
pcap.c