projects
/
l2tpns.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improved load balancing algorithm.
[l2tpns.git]
/
l2tpns.c
diff --git
a/l2tpns.c
b/l2tpns.c
index
77c302c
..
9861e88
100644
(file)
--- a/
l2tpns.c
+++ b/
l2tpns.c
@@
-1413,7
+1413,7
@@
void processipout(uint8_t *buf, int len)
groupidt g;
sessiont *sp;
tunnelidt t;
groupidt g;
sessiont *sp;
tunnelidt t;
- in_addr_t ip;
+ in_addr_t ip
, ip_src
;
uint8_t *data = buf; // Keep a copy of the originals.
int size = len;
uint8_t *data = buf; // Keep a copy of the originals.
int size = len;
@@
-1446,10
+1446,11
@@
void processipout(uint8_t *buf, int len)
return;
}
return;
}
+ ip_src = *(uint32_t *)(buf + 12);
ip = *(uint32_t *)(buf + 16);
if ((g = grp_groupbyip(ip)))
{
ip = *(uint32_t *)(buf + 16);
if ((g = grp_groupbyip(ip)))
{
- s = grp_getnextsession(g, ip);
+ s = grp_getnextsession(g, ip
, ip_src
);
if (!s)
{
// Is this a packet for a session that doesn't exist?
if (!s)
{
// Is this a packet for a session that doesn't exist?
@@
-3248,7
+3249,7
@@
void processudp(uint8_t *buf, int len, struct sockaddr_in *addr, uint16_t indexu
// Set multilink options before sending initial LCP packet
sess_local[s].mp_mrru = 1614;
// Set multilink options before sending initial LCP packet
sess_local[s].mp_mrru = 1614;
- sess_local[s].mp_epdis = ntohl(config->iftun_
n_address[tunnel[t].indexudp] ? config->iftun_n_address[tunnel[t].indexudp]
: my_address);
+ sess_local[s].mp_epdis = ntohl(config->iftun_
address ? config->iftun_address
: my_address);
sendlcp(s, t);
change_state(s, lcp, RequestSent);
sendlcp(s, t);
change_state(s, lcp, RequestSent);
@@
-5491,7
+5492,7
@@
static void update_config()
while (*shost && (shost < e))
{
while (*shost && (shost < e))
{
- while ((n < e) && (*n == ' ' || *n == '\t')) n++;
+ while ((n < e) && (*n == ' ' || *n == '
,' || *n == '
\t')) n++;
i = 0;
while (n < e && (*n != ',') && (*n != '\t'))
i = 0;
while (n < e && (*n != ',') && (*n != '\t'))
@@
-5499,6
+5500,7
@@
static void update_config()
config->multi_n_hostname[config->nbmultihostname][i] = *n;
n++;i++;
}
config->multi_n_hostname[config->nbmultihostname][i] = *n;
n++;i++;
}
+
if (i > 0)
{
config->multi_n_hostname[config->nbmultihostname][i] = 0;
if (i > 0)
{
config->multi_n_hostname[config->nbmultihostname][i] = 0;