mirror of https://github.com/dirtbags/moth.git
Bind cowcli to low port
This commit is contained in:
parent
46295762e3
commit
7ec7feea09
|
@ -11,6 +11,8 @@
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
#define DEBUG
|
||||||
|
|
||||||
int
|
int
|
||||||
bind_port(int fd, const struct in6_addr *addr, uint16_t port)
|
bind_port(int fd, const struct in6_addr *addr, uint16_t port)
|
||||||
{
|
{
|
||||||
|
@ -107,6 +109,12 @@ main(int argc, char *argv[])
|
||||||
* Set up socket
|
* Set up socket
|
||||||
*/
|
*/
|
||||||
sock = socket(AF_INET6, SOCK_DGRAM, 0);
|
sock = socket(AF_INET6, SOCK_DGRAM, 0);
|
||||||
|
if (-1 == bind_port(sock, &in6addr_any, 44)) {
|
||||||
|
perror("Binding UDP port 44");
|
||||||
|
#ifndef DEBUG
|
||||||
|
return EX_IOERR;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
char line[20];
|
char line[20];
|
||||||
|
|
Loading…
Reference in New Issue