***********************************************************************/
static char const RCSID[] =
-"$Id: plugin.c,v 1.12 2004/11/04 10:07:37 paulus Exp $";
+"$Id: plugin.c,v 1.14 2005/08/25 10:51:27 paulus Exp $";
#define _GNU_SOURCE 1
#include "pppoe.h"
return conn->sessionSocket;
}
-static void
-PPPOESendConfig(int mtu,
- u_int32_t asyncmap,
- int pcomp,
- int accomp)
-{
- int sock;
- struct ifreq ifr;
-
- if (mtu > MAX_PPPOE_MTU) {
- warn("Couldn't increase MTU to %d", mtu);
- mtu = MAX_PPPOE_MTU;
- }
- sock = socket(AF_INET, SOCK_DGRAM, 0);
- if (sock < 0) {
- error("Couldn't create IP socket: %m");
- return;
- }
- strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
- ifr.ifr_mtu = mtu;
- if (ioctl(sock, SIOCSIFMTU, &ifr) < 0) {
- error("Couldn't set interface MTU to %d: %m", mtu);
- return;
- }
- (void) close (sock);
-}
-
-
static void
PPPOERecvConfig(int mru,
u_int32_t asyncmap,
int pcomp,
int accomp)
{
+#if 0 /* broken protocol, but no point harrassing the users I guess... */
if (mru > MAX_PPPOE_MTU)
warn("Couldn't increase MRU to %d", mru);
+#endif
}
/**********************************************************************
the_channel = &pppoe_channel;
modem = 0;
- lcp_allowoptions[0].neg_accompression = 0;
- lcp_wantoptions[0].neg_accompression = 0;
-
- lcp_allowoptions[0].neg_asyncmap = 0;
- lcp_wantoptions[0].neg_asyncmap = 0;
-
- lcp_allowoptions[0].neg_pcompression = 0;
- lcp_wantoptions[0].neg_pcompression = 0;
-
- ccp_allowoptions[0].deflate = 0 ;
- ccp_wantoptions[0].deflate = 0 ;
-
- ipcp_allowoptions[0].neg_vj=0;
- ipcp_wantoptions[0].neg_vj=0;
-
- ccp_allowoptions[0].bsd_compress = 0;
- ccp_wantoptions[0].bsd_compress = 0;
-
PPPOEInitDevice();
}
return 1;
rp_fatal(str);
}
+void pppoe_check_options(void)
+{
+ lcp_allowoptions[0].neg_accompression = 0;
+ lcp_wantoptions[0].neg_accompression = 0;
+
+ lcp_allowoptions[0].neg_asyncmap = 0;
+ lcp_wantoptions[0].neg_asyncmap = 0;
+
+ lcp_allowoptions[0].neg_pcompression = 0;
+ lcp_wantoptions[0].neg_pcompression = 0;
+
+ if (lcp_allowoptions[0].mru > MAX_PPPOE_MTU)
+ lcp_allowoptions[0].mru = MAX_PPPOE_MTU;
+ if (lcp_wantoptions[0].mru > MAX_PPPOE_MTU)
+ lcp_wantoptions[0].mru = MAX_PPPOE_MTU;
+
+ ccp_allowoptions[0].deflate = 0;
+ ccp_wantoptions[0].deflate = 0;
+
+ ipcp_allowoptions[0].neg_vj = 0;
+ ipcp_wantoptions[0].neg_vj = 0;
+
+ ccp_allowoptions[0].bsd_compress = 0;
+ ccp_wantoptions[0].bsd_compress = 0;
+}
struct channel pppoe_channel = {
options: Options,
process_extra_options: &PPPOEDeviceOptions,
- check_options: NULL,
+ check_options: pppoe_check_options,
connect: &PPPOEConnectDevice,
disconnect: &PPPOEDisconnectDevice,
establish_ppp: &generic_establish_ppp,
disestablish_ppp: &generic_disestablish_ppp,
- send_config: &PPPOESendConfig,
+ send_config: NULL,
recv_config: &PPPOERecvConfig,
close: NULL,
cleanup: NULL