lookup the l2tpd connection using the src ip

This commit is contained in:
Alexander Couzens 2016-10-23 21:40:34 +02:00
parent 0e71714f7f
commit 3a566f2b05
1 changed files with 7 additions and 0 deletions

View File

@ -671,6 +671,13 @@ static int l2tp_ip_read_cb(struct osmo_fd *ofd, unsigned int what)
msgb_put(msg, rc);
/* FIXME: resolve l2tpd_connection somewhere ? */
l2c = l2tpd_cc_find_by_sockaddr(l2i, ss, sizeof(*ss));
if (!l2c) {
/* create a new connection */
LOGP(DL2TP, LOGL_ERROR, "New l2tp connection: %s\n", );
l2c = l2tpd_cc_alloc(l2i);
memcpy(l2c->remote.ss, &ss, sizeof(*ss));
}
return l2tp_rcvmsg(l2c, msg);
}