Commit 18582ed
MEDIUM: socket: add zero-terminated ABNS alternative
When an abstract unix socket is bound by HAProxy (using "abns@" prefix),
NUL bytes are appended at the end of its path until sun_path is filled
(for a total of 108 characters).
Here we add an alternative to pass only the non-NUL length of that path
to connect/bind calls, such that the effective path of the socket's name
is as humanly written. This may be useful to interconnect with existing
softwares that implement abstract sockets with this logic instead of the
default haproxy one.
This is achieved by implementing the "abnsz" socket prefix (instead of
"abns"), which stands for "zero-terminated ABNS". "abnsz" prefix may be
used anywhere "abns" is. Internally, haproxy uses the custom socket
family (AF_CUST_ABNS vs AF_CUST_ABNSZ) to differentiate default abns
sockets from zero-terminated ones.
Documentation was updated and regtest was added.
Fixes GH issues #977 and #2479
Co-authored-by: Aurelien DARRAGON <[email protected]>1 parent 43861e3 commit 18582ed
File tree
5 files changed
+84
-13
lines changed- doc
- include/haproxy
- reg-tests/server
- src
5 files changed
+84
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6073 | 6073 | | |
6074 | 6074 | | |
6075 | 6075 | | |
| 6076 | + | |
| 6077 | + | |
| 6078 | + | |
| 6079 | + | |
| 6080 | + | |
6076 | 6081 | | |
6077 | 6082 | | |
6078 | 6083 | | |
| |||
6165 | 6170 | | |
6166 | 6171 | | |
6167 | 6172 | | |
6168 | | - | |
6169 | | - | |
6170 | | - | |
6171 | | - | |
6172 | | - | |
| 6173 | + | |
| 6174 | + | |
| 6175 | + | |
| 6176 | + | |
| 6177 | + | |
| 6178 | + | |
6173 | 6179 | | |
6174 | 6180 | | |
6175 | 6181 | | |
| |||
11586 | 11592 | | |
11587 | 11593 | | |
11588 | 11594 | | |
| 11595 | + | |
| 11596 | + | |
| 11597 | + | |
| 11598 | + | |
| 11599 | + | |
11589 | 11600 | | |
11590 | 11601 | | |
11591 | 11602 | | |
| |||
11620 | 11631 | | |
11621 | 11632 | | |
11622 | 11633 | | |
11623 | | - | |
11624 | | - | |
11625 | | - | |
11626 | | - | |
11627 | | - | |
| 11634 | + | |
| 11635 | + | |
| 11636 | + | |
| 11637 | + | |
| 11638 | + | |
| 11639 | + | |
11628 | 11640 | | |
11629 | 11641 | | |
11630 | 11642 | | |
| |||
11721 | 11733 | | |
11722 | 11734 | | |
11723 | 11735 | | |
| 11736 | + | |
| 11737 | + | |
| 11738 | + | |
11724 | 11739 | | |
11725 | 11740 | | |
11726 | 11741 | | |
| |||
28564 | 28579 | | |
28565 | 28580 | | |
28566 | 28581 | | |
| 28582 | + | |
| 28583 | + | |
| 28584 | + | |
28567 | 28585 | | |
28568 | 28586 | | |
28569 | 28587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
788 | | - | |
789 | 788 | | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
790 | 797 | | |
791 | 798 | | |
792 | 799 | | |
| |||
| 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 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2684 | 2684 | | |
2685 | 2685 | | |
2686 | 2686 | | |
2687 | | - | |
2688 | 2687 | | |
2689 | 2688 | | |
2690 | 2689 | | |
2691 | 2690 | | |
2692 | 2691 | | |
2693 | 2692 | | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
2694 | 2703 | | |
2695 | 2704 | | |
2696 | 2705 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
0 commit comments