Commit a08d7be
committed
pmrfc3164: fix HOSTNAME parse for IPv6 address literals
Non-tech: IPv6 support in rfc3164 parsing so legacy pipelines keep
headers intact when devices send IPv6 addresses instead of DNS names.
Impact: user-visible bugfix; RFC3164 forwarding stays well-formed for
IPv6-only sources.
Before: an IPv6 literal in HOSTNAME broke parsing and misaligned the
forwarded header. After: valid IPv6 literals (optionally bracketed)
are accepted as HOSTNAME; TAG parsing remains in sync.
Technical: when normal hostname recognition fails, the parser scans
the next token up to space. If it contains a colon and validates via
inet_pton(AF_INET6), the token becomes HOSTNAME. Bracketed tokens are
accepted only when permit.squarebracketsinhostname is on. The parse
pointer advances past the token and any trailing space to preserve the
RFC3164 flow. Hostname size limits (CONF_HOSTNAME_MAXSIZE) remain.
A regression test (pmrfc3164-ipv6-hostname.sh) exercises both forms and
is added to tests/Makefile.am.
Fixes: rsyslog#3012
With the help of AI agents: Google Jules1 parent f4caae0 commit a08d7be
File tree
3 files changed
+99
-0
lines changed- tests
- tools
3 files changed
+99
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
2733 | 2734 | | |
2734 | 2735 | | |
2735 | 2736 | | |
| 2737 | + | |
2736 | 2738 | | |
2737 | 2739 | | |
2738 | 2740 | | |
2739 | 2741 | | |
2740 | 2742 | | |
| 2743 | + | |
2741 | 2744 | | |
| 2745 | + | |
2742 | 2746 | | |
| 2747 | + | |
2743 | 2748 | | |
| 2749 | + | |
2744 | 2750 | | |
| 2751 | + | |
2745 | 2752 | | |
| 2753 | + | |
2746 | 2754 | | |
| 2755 | + | |
2747 | 2756 | | |
| 2757 | + | |
2748 | 2758 | | |
| 2759 | + | |
2749 | 2760 | | |
| 2761 | + | |
2750 | 2762 | | |
| 2763 | + | |
2751 | 2764 | | |
| 2765 | + | |
2752 | 2766 | | |
| 2767 | + | |
2753 | 2768 | | |
| 2769 | + | |
2754 | 2770 | | |
| 2771 | + | |
2755 | 2772 | | |
| 2773 | + | |
2756 | 2774 | | |
| 2775 | + | |
2757 | 2776 | | |
| 2777 | + | |
2758 | 2778 | | |
| 2779 | + | |
2759 | 2780 | | |
| 2781 | + | |
2760 | 2782 | | |
| 2783 | + | |
2761 | 2784 | | |
| 2785 | + | |
2762 | 2786 | | |
| 2787 | + | |
2763 | 2788 | | |
| 2789 | + | |
| 2790 | + | |
2764 | 2791 | | |
2765 | 2792 | | |
2766 | 2793 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
66 | 93 | | |
67 | 94 | | |
68 | 95 | | |
| |||
430 | 457 | | |
431 | 458 | | |
432 | 459 | | |
| 460 | + | |
433 | 461 | | |
434 | 462 | | |
435 | 463 | | |
| |||
445 | 473 | | |
446 | 474 | | |
447 | 475 | | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
448 | 496 | | |
449 | 497 | | |
450 | 498 | | |
| |||
0 commit comments