Add param disable no spoof
This commit is contained in:
parent
f5354e1754
commit
ec1507a6c2
3 changed files with 3 additions and 1 deletions
1
l2tpns.c
1
l2tpns.c
|
|
@ -191,6 +191,7 @@ config_descriptt config_values[] = {
|
||||||
CONFIG("pppoe_service_name", pppoe_service_name, STRING),
|
CONFIG("pppoe_service_name", pppoe_service_name, STRING),
|
||||||
CONFIG("pppoe_ac_name", pppoe_ac_name, STRING),
|
CONFIG("pppoe_ac_name", pppoe_ac_name, STRING),
|
||||||
CONFIG("disable_sending_hello", disable_sending_hello, BOOL),
|
CONFIG("disable_sending_hello", disable_sending_hello, BOOL),
|
||||||
|
CONFIG("disable_no_spoof", disable_no_spoof, BOOL),
|
||||||
{ NULL, 0, 0, 0 }
|
{ NULL, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
1
l2tpns.h
1
l2tpns.h
|
|
@ -780,6 +780,7 @@ typedef struct
|
||||||
char pppoe_ac_name[64];
|
char pppoe_ac_name[64];
|
||||||
uint8_t pppoe_hwaddr[ETH_ALEN]; // MAC addr of interface pppoe to bind
|
uint8_t pppoe_hwaddr[ETH_ALEN]; // MAC addr of interface pppoe to bind
|
||||||
int disable_sending_hello; // Disable l2tp sending HELLO message for Apple compatibility.
|
int disable_sending_hello; // Disable l2tp sending HELLO message for Apple compatibility.
|
||||||
|
int disable_no_spoof; // Disable no spoof (permit load balancing client --> internet)
|
||||||
} configt;
|
} configt;
|
||||||
|
|
||||||
enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IPv4, IPv6 };
|
enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IPv4, IPv6 };
|
||||||
|
|
|
||||||
2
ppp.c
2
ppp.c
|
|
@ -1769,7 +1769,7 @@ void processipin(sessionidt s, tunnelidt t, uint8_t *p, uint16_t l)
|
||||||
if (!session[s].bundle || bundle[session[s].bundle].num_of_links < 2) // FIXME:
|
if (!session[s].bundle || bundle[session[s].bundle].num_of_links < 2) // FIXME:
|
||||||
{
|
{
|
||||||
// no spoof (do sessionbyip to handled statically routed subnets)
|
// no spoof (do sessionbyip to handled statically routed subnets)
|
||||||
if (ip != session[s].ip && sessionbyip(htonl(ip)) != s)
|
if (!config->disable_no_spoof && ip != session[s].ip && sessionbyip(htonl(ip)) != s)
|
||||||
{
|
{
|
||||||
LOG(4, s, t, "Dropping packet with spoofed IP %s\n", fmtaddr(htonl(ip), 0));
|
LOG(4, s, t, "Dropping packet with spoofed IP %s\n", fmtaddr(htonl(ip), 0));
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue