mirror of
https://git.freebsd.org/ports.git
synced 2025-04-29 01:56:37 -04:00
/usr/local/bin/ld: pty.o:(.bss+0x0): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: misc.o:(.bss+0x0): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: control.o:(.bss+0x0): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: avp.o:(.bss+0x0): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: call.o:(.bss+0x0): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: network.o:(.bss+0x140): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: avpsend.o:(.bss+0x0): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: scheduler.o:(.bss+0x8): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: file.o:(.bss+0x228): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: aaa.o:(.bss+0x0): multiple definition of `rand_source'; l2tpd.o:(.bss+0x530): first defined here /usr/local/bin/ld: control.o: in function `handle_special': control.c:(.text+0x220e): undefined reference to `check_control' /usr/local/bin/ld: control.o: in function `handle_packet': control.c:(.text+0x22d0): undefined reference to `check_payload' /usr/local/bin/ld: control.c:(.text+0x22e6): undefined reference to `expand_payload' /usr/local/bin/ld: control.c:(.text+0x231a): undefined reference to `check_control' /usr/local/bin/ld: control.c:(.text+0x2414): undefined reference to `write_packet' http://package18.nyi.freebsd.org/data/121amd64-default-PR244494/2020-06-10_18h04m44s/logs/errors/l2tpd-0.69_10.log PR: 246700
69 lines
2.1 KiB
C
69 lines
2.1 KiB
C
--- control.c.orig 2002-04-10 20:09:33 UTC
|
|
+++ control.c
|
|
@@ -16,8 +16,6 @@
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
-#include <netinet/in.h>
|
|
-#include <arpa/inet.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include "l2tp.h"
|
|
@@ -1076,7 +1074,7 @@ int control_finish (struct tunnel *t, struct call *c)
|
|
return 0;
|
|
}
|
|
|
|
-inline int check_control (const struct buffer *buf, struct tunnel *t,
|
|
+static inline int check_control (const struct buffer *buf, struct tunnel *t,
|
|
struct call *c)
|
|
{
|
|
/*
|
|
@@ -1212,7 +1210,7 @@ inline int check_control (const struct buffer *buf, st
|
|
return 0;
|
|
}
|
|
|
|
-inline int check_payload (struct buffer *buf, struct tunnel *t,
|
|
+static inline int check_payload (struct buffer *buf, struct tunnel *t,
|
|
struct call *c)
|
|
{
|
|
/*
|
|
@@ -1318,7 +1316,7 @@ inline int check_payload (struct buffer *buf, struct t
|
|
#endif
|
|
return 0;
|
|
}
|
|
-inline int expand_payload (struct buffer *buf, struct tunnel *t,
|
|
+static inline int expand_payload (struct buffer *buf, struct tunnel *t,
|
|
struct call *c)
|
|
{
|
|
/*
|
|
@@ -1498,7 +1496,7 @@ void send_zlb (void *data)
|
|
toss (buf);
|
|
}
|
|
|
|
-inline int write_packet (struct buffer *buf, struct tunnel *t, struct call *c,
|
|
+static inline int write_packet (struct buffer *buf, struct tunnel *t, struct call *c,
|
|
int convert)
|
|
{
|
|
/*
|
|
@@ -1582,6 +1580,12 @@ inline int write_packet (struct buffer *buf, struct tu
|
|
wbuf[pos++] = e;
|
|
for (x = 0; x < buf->len; x++)
|
|
{
|
|
+ // we must at least still have 3 bytes left in the worst case scenario:
|
|
+ // 1 for a possible escape, 1 for the value and 1 to end the PPP stream.
|
|
+ if(pos >= (sizeof(wbuf) - 4)) {
|
|
+ return -EINVAL;
|
|
+ }
|
|
+
|
|
e = *((char *) buf->start + x);
|
|
if ((e < 0x20) || (e == PPP_ESCAPE) || (e == PPP_FLAG))
|
|
{
|
|
@@ -1657,7 +1661,7 @@ void handle_special (struct buffer *buf, struct call *
|
|
}
|
|
}
|
|
|
|
-inline int handle_packet (struct buffer *buf, struct tunnel *t,
|
|
+int handle_packet (struct buffer *buf, struct tunnel *t,
|
|
struct call *c)
|
|
{
|
|
int res;
|