-* Fri Mar 31 2006 Brendan O'Dea <bod@optus.net> 2.1.17
+* Wed Apr 5 2006 Brendan O'Dea <bod@optus.net> 2.1.17
- Fix IPCP length test to allow Terminate-Request (4 bytes).
- Send nsctl responses back using the correct source address (thanks ltd).
+- Similarly set the source for DAE responses; use bind_address when
+ handling forwarded packets on the master.
* Thu Feb 23 2006 Brendan O'Dea <bod@optus.net> 2.1.16
- Send configured magic-no in LCP EchoReq when LCP is opened.
// L2TPNS Clustering Stuff
-char const *cvs_id_cluster = "$Id: cluster.c,v 1.49 2005-12-05 14:10:42 bodea Exp $";
+char const *cvs_id_cluster = "$Id: cluster.c,v 1.50 2006-04-05 02:13:48 bodea Exp $";
#include <stdio.h>
#include <stdlib.h>
STAT(recv_forward);
if (type == C_FORWARD_DAE)
- processdae(p, s, &a, sizeof(a));
+ {
+ struct in_addr local;
+ local.s_addr = config->bind_address ? config->bind_address : my_address;
+ processdae(p, s, &a, sizeof(a), &local);
+ }
else
processudp(p, s, &a);
// Copyright (c) 2002 FireBrick (Andrews & Arnold Ltd / Watchfront Ltd) - GPL licenced
// vim: sw=8 ts=8
-char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.158 2006-04-05 01:50:33 bodea Exp $";
+char const *cvs_id_l2tpns = "$Id: l2tpns.c,v 1.159 2006-04-05 02:13:48 bodea Exp $";
#include <arpa/inet.h>
#include <assert.h>
addr.sin_port = htons(config->radius_dae_port);
daefd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
setsockopt(daefd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+ setsockopt(daefd, SOL_IP, IP_PKTINFO, &on, sizeof(on)); // recvfromto
if (bind(daefd, (void *) &addr, sizeof(addr)) < 0)
{
LOG(0, 0, 0, "Error in DAE bind: %s\n", strerror(errno));
case FD_TYPE_DAE: // DAE requests
alen = sizeof(addr);
- s = recvfrom(daefd, buf, sizeof(buf), MSG_WAITALL, (struct sockaddr *) &addr, &alen);
- if (s > 0) processdae(buf, s, &addr, alen);
+ s = recvfromto(daefd, buf, sizeof(buf), MSG_WAITALL, (struct sockaddr *) &addr, &alen, &local);
+ if (s > 0) processdae(buf, s, &addr, alen, &local);
n--;
break;
// L2TPNS Global Stuff
-// $Id: l2tpns.h,v 1.110 2006-03-27 03:01:08 bodea Exp $
+// $Id: l2tpns.h,v 1.111 2006-04-05 02:13:48 bodea Exp $
#ifndef __L2TPNS_H__
#define __L2TPNS_H__
void radiusretry(uint16_t r);
uint16_t radiusnew(sessionidt s);
void radiusclear(uint16_t r, sessionidt s);
-void processdae(uint8_t *buf, int len, struct sockaddr_in *addr, int alen);
+void processdae(uint8_t *buf, int len, struct sockaddr_in *addr, int alen, struct in_addr *local);
// l2tpns.c
%attr(644,root,root) /usr/share/man/man[58]/*
%changelog
-* Fri Mar 31 2006 Brendan O'Dea <bod@optus.net> 2.1.17-1
+* Wed Apr 5 2006 Brendan O'Dea <bod@optus.net> 2.1.17-1
- 2.1.17 release, see /usr/share/doc/l2tpns-2.1.17/Changes
// L2TPNS Radius Stuff
-char const *cvs_id_radius = "$Id: radius.c,v 1.47 2005-12-19 06:18:13 bodea Exp $";
+char const *cvs_id_radius = "$Id: radius.c,v 1.48 2006-04-05 02:13:48 bodea Exp $";
#include <time.h>
#include <stdio.h>
extern int daefd;
-void processdae(uint8_t *buf, int len, struct sockaddr_in *addr, int alen)
+void processdae(uint8_t *buf, int len, struct sockaddr_in *addr, int alen, struct in_addr *local)
{
int i, r_code, r_id, length, attribute_length;
uint8_t *packet, attribute;
LOG(3, 0, 0, "Sending DAE %s, id=%d\n", radius_code(r_code), r_id);
// send DAE response
- if (sendto(daefd, buf, len, MSG_DONTWAIT | MSG_NOSIGNAL, (struct sockaddr *) addr, alen) < 0)
+ if (sendtofrom(daefd, buf, len, MSG_DONTWAIT | MSG_NOSIGNAL, (struct sockaddr *) addr, alen, local) < 0)
LOG(0, 0, 0, "Error sending DAE response packet: %s\n", strerror(errno));
}