Commit a961ad1
committed
Merge bitcoin/bitcoin#30202: netbase: extend CreateSock() to support creating arbitrary sockets
1245d13 netbase: extend CreateSock() to support creating arbitrary sockets (Vasil Dimov)
Pull request description:
Allow the callers of `CreateSock()` to pass all 3 arguments to the `socket(2)` syscall. This makes it possible to create sockets of any domain/type/protocol. In addition to extending arguments, some extra safety checks were put in place.
The need for this came up during the discussion in bitcoin/bitcoin#30043 (comment)
ACKs for top commit:
achow101:
ACK 1245d13
tdb3:
re ACK 1245d13
theStack:
re-ACK 1245d13
Tree-SHA512: cc86b56121293ac98959aed0ed77812d20702ed7029b5a043586f46e74295779c5354bb0d5f9e80be6c29e535df980d34c1dbf609064fb7ea3e5ca0f0ed54d6bFile tree
6 files changed
+33
-33
lines changed- src
- test
- fuzz
6 files changed
+33
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3029 | 3029 | | |
3030 | 3030 | | |
3031 | 3031 | | |
3032 | | - | |
| 3032 | + | |
3033 | 3033 | | |
3034 | 3034 | | |
3035 | 3035 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
| 490 | + | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | | - | |
498 | | - | |
| 493 | + | |
499 | 494 | | |
500 | 495 | | |
501 | | - | |
| 496 | + | |
502 | 497 | | |
503 | 498 | | |
504 | 499 | | |
505 | 500 | | |
506 | 501 | | |
507 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
508 | 507 | | |
509 | 508 | | |
510 | 509 | | |
| |||
529 | 528 | | |
530 | 529 | | |
531 | 530 | | |
532 | | - | |
| 531 | + | |
533 | 532 | | |
534 | 533 | | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
539 | 540 | | |
| 541 | + | |
540 | 542 | | |
541 | 543 | | |
542 | 544 | | |
543 | | - | |
| 545 | + | |
544 | 546 | | |
545 | 547 | | |
546 | 548 | | |
| |||
609 | 611 | | |
610 | 612 | | |
611 | 613 | | |
612 | | - | |
| 614 | + | |
613 | 615 | | |
614 | 616 | | |
615 | 617 | | |
| |||
637 | 639 | | |
638 | 640 | | |
639 | 641 | | |
640 | | - | |
| 642 | + | |
641 | 643 | | |
642 | 644 | | |
643 | 645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
266 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
267 | 269 | | |
268 | 270 | | |
269 | | - | |
| 271 | + | |
270 | 272 | | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
274 | | - | |
| 276 | + | |
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
| |||
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
| 71 | + | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
136 | | - | |
137 | | - | |
138 | | - | |
| 135 | + | |
139 | 136 | | |
140 | 137 | | |
141 | 138 | | |
| |||
172 | 169 | | |
173 | 170 | | |
174 | 171 | | |
175 | | - | |
176 | | - | |
177 | 172 | | |
178 | 173 | | |
179 | 174 | | |
0 commit comments