Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent whitespace between IP and IPv6 #810

Open
jacobgb24 opened this issue Oct 30, 2019 · 2 comments
Open

Inconsistent whitespace between IP and IPv6 #810

jacobgb24 opened this issue Oct 30, 2019 · 2 comments
Assignees

Comments

@jacobgb24
Copy link
Contributor

jacobgb24 commented Oct 30, 2019

When outputting with ndo_vflag > 0 IPv4 addresses have a newline before the IPs while IPv6 do not.

Here's an example:

1523520922.254050 IP (tos 0x0, ttl 107, id 4816, offset 0, flags [none], proto UDP (17), length 74)
    @[email protected] > @[email protected]: [udp sum ok] 51092 A? example.com. (46)
1523520922.254978 IP6 (hlim 54, next-header UDP (17) payload length: 47) @[email protected] > @[email protected]: [udp sum ok]

This is a pretty minor issue, but it'd be nice if it was consistent. I wasn't sure if this was intentional or which way is preferred so that's why this is an issue instead of a pull request.

The newline comes from print-ip.c:468

Personally, I'd prefer a single line of output for easy parsing.

Forgot to mention: tcpdump version 4.9.2 and lippcap 1.8.1, but it doesn't look like the line in question has changed in newer versions.

@infrastation
Copy link
Member

I vaguely remember a similar request a few years ago. It would indeed be nice to have the amount of newlines consistent, but if you think how many existing scripts this change would break, it will not look such a good idea.

@infrastation
Copy link
Member

If a good solution is possible, tcpdump 5.0 would be a good occasion to apply it at the cost of formatting changes.

@infrastation infrastation self-assigned this Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants