From: fendo Date: Sun, 10 Feb 2013 23:15:36 +0000 (+0100) Subject: Add param disable no spoof X-Git-Tag: 2.2.1-2fdn3.6~3 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/ec1507a6c2f477e81050e5540fceed50c7bf7432 Add param disable no spoof --- diff --git a/l2tpns.c b/l2tpns.c index ee9f30b..1a37a0a 100644 --- a/l2tpns.c +++ b/l2tpns.c @@ -191,6 +191,7 @@ config_descriptt config_values[] = { CONFIG("pppoe_service_name", pppoe_service_name, STRING), CONFIG("pppoe_ac_name", pppoe_ac_name, STRING), CONFIG("disable_sending_hello", disable_sending_hello, BOOL), + CONFIG("disable_no_spoof", disable_no_spoof, BOOL), { NULL, 0, 0, 0 } }; diff --git a/l2tpns.h b/l2tpns.h index 1d3339c..56f8fa1 100644 --- a/l2tpns.h +++ b/l2tpns.h @@ -780,6 +780,7 @@ typedef struct char pppoe_ac_name[64]; 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_no_spoof; // Disable no spoof (permit load balancing client --> internet) } configt; enum config_typet { INT, STRING, UNSIGNED_LONG, SHORT, BOOL, IPv4, IPv6 }; diff --git a/ppp.c b/ppp.c index a8a355d..893ceb9 100644 --- a/ppp.c +++ b/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: { // 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)); return;