mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #105143 from aojea/netexec_optional_listen
agnhost: allow to disable udp listener on netexec
This commit is contained in:
commit
c4587a62f9
@ -417,6 +417,8 @@ It will also start a UDP server on the indicated UDP port that responds to the f
|
|||||||
- `echo <msg>`: Returns the given `<msg>`
|
- `echo <msg>`: Returns the given `<msg>`
|
||||||
- `clientip`: Returns the request's IP address
|
- `clientip`: Returns the request's IP address
|
||||||
|
|
||||||
|
The UDP server can be disabled by setting `--udp-port -1`.
|
||||||
|
|
||||||
Additionally, if (and only if) `--sctp-port` is passed, it will start an SCTP server on that port,
|
Additionally, if (and only if) `--sctp-port` is passed, it will start an SCTP server on that port,
|
||||||
responding to the same commands as the UDP server.
|
responding to the same commands as the UDP server.
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
2.33
|
2.34
|
||||||
|
@ -106,12 +106,14 @@ will be upgraded to HTTPS. The image has default, "localhost"-based cert/privkey
|
|||||||
If "--http-override" is set, the HTTP(S) server will always serve the override path & options,
|
If "--http-override" is set, the HTTP(S) server will always serve the override path & options,
|
||||||
ignoring the request URL.
|
ignoring the request URL.
|
||||||
|
|
||||||
It will also start a UDP server on the indicated UDP port that responds to the following commands:
|
It will also start a UDP server on the indicated UDP port and addresses that responds to the following commands:
|
||||||
|
|
||||||
- "hostname": Returns the server's hostname
|
- "hostname": Returns the server's hostname
|
||||||
- "echo <msg>": Returns the given <msg>
|
- "echo <msg>": Returns the given <msg>
|
||||||
- "clientip": Returns the request's IP address
|
- "clientip": Returns the request's IP address
|
||||||
|
|
||||||
|
The UDP server can be disabled by setting --udp-port to -1.
|
||||||
|
|
||||||
Additionally, if (and only if) --sctp-port is passed, it will start an SCTP server on that port,
|
Additionally, if (and only if) --sctp-port is passed, it will start an SCTP server on that port,
|
||||||
responding to the same commands as the UDP server.
|
responding to the same commands as the UDP server.
|
||||||
`,
|
`,
|
||||||
@ -168,14 +170,19 @@ func main(cmd *cobra.Command, args []string) {
|
|||||||
addRoutes(http.DefaultServeMux, exitCh)
|
addRoutes(http.DefaultServeMux, exitCh)
|
||||||
}
|
}
|
||||||
|
|
||||||
udpBindTo, err := parseAddresses(udpListenAddresses)
|
// UDP server
|
||||||
if err != nil {
|
if udpPort != -1 {
|
||||||
log.Fatal(err)
|
udpBindTo, err := parseAddresses(udpListenAddresses)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, address := range udpBindTo {
|
||||||
|
go startUDPServer(address, udpPort)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, address := range udpBindTo {
|
// SCTP server
|
||||||
go startUDPServer(address, udpPort)
|
|
||||||
}
|
|
||||||
if sctpPort != -1 {
|
if sctpPort != -1 {
|
||||||
go startSCTPServer(sctpPort)
|
go startSCTPServer(sctpPort)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user