X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpppol2tp%2Fpppol2tp.c;h=c1eaa9afeb88e23df5ecdc52fd51ca21cb1e0aa9;hb=bdd34ab1f2f87acb23c6d92feee7354ac53005ff;hp=1be0ad25b67cb1e0dca3a6ce4832c766ecd996fe;hpb=d98ab3805c818bfb58e20ee18e6488a851c1a90d;p=ppp.git diff --git a/pppd/plugins/pppol2tp/pppol2tp.c b/pppd/plugins/pppol2tp/pppol2tp.c index 1be0ad2..c1eaa9a 100644 --- a/pppd/plugins/pppol2tp/pppol2tp.c +++ b/pppd/plugins/pppol2tp/pppol2tp.c @@ -24,12 +24,6 @@ #include #include #include -#include "pppd.h" -#include "pathnames.h" -#include "fsm.h" -#include "lcp.h" -#include "ccp.h" -#include "ipcp.h" #include #include #include @@ -38,10 +32,12 @@ #include #include #include + #ifndef aligned_u64 /* should be defined in sys/types.h */ #define aligned_u64 unsigned long long __attribute__((aligned(8))) #endif + #include #include #include @@ -49,12 +45,20 @@ #include #include +#include +#include +#include +#include +#include +#include + + /* should be added to system's socket.h... */ #ifndef SOL_PPPOL2TP #define SOL_PPPOL2TP 273 #endif -const char pppd_version[] = VERSION; +const char pppd_version[] = PPPD_VERSION; static int setdevname_pppol2tp(char **argv); @@ -121,10 +125,10 @@ static int setdevname_pppol2tp(char **argv) char buffer[128]; struct sockaddr pppol2tp; } s; - int len = sizeof(s); + socklen_t len = sizeof(s); char **a; int tmp; - int tmp_len = sizeof(tmp); + socklen_t tmp_len = sizeof(tmp); if (device_got_set) return 0; @@ -203,8 +207,8 @@ static void send_config_pppol2tp(int mtu, int on = 1; int fd; char reorderto[16]; - char tid[8]; - char sid[8]; + char tid[12]; + char sid[12]; if (pppol2tp_ifname[0]) { struct ifreq ifr; @@ -237,10 +241,10 @@ static void send_config_pppol2tp(int mtu, sprintf(&reorderto[0], "%d ", pppol2tp_reorder_timeout); tid[0] = '\0'; if (pppol2tp_tunnel_id > 0) - sprintf(&tid[0], "%hu ", pppol2tp_tunnel_id); + sprintf(&tid[0], "%u ", pppol2tp_tunnel_id); sid[0] = '\0'; if (pppol2tp_session_id > 0) - sprintf(&sid[0], "%hu ", pppol2tp_session_id); + sprintf(&sid[0], "%u ", pppol2tp_session_id); dbglog("PPPoL2TP options: %s%s%s%s%s%s%s%s%sdebugmask %d", pppol2tp_recv_seq ? "recvseq " : "", @@ -505,20 +509,22 @@ void plugin_init(void) */ add_notifier(&ip_up_notifier, pppol2tp_ip_up, NULL); add_notifier(&ip_down_notifier, pppol2tp_ip_down, NULL); +#ifdef INET6 add_notifier(&ipv6_up_notifier, pppol2tp_ip_up, NULL); add_notifier(&ipv6_down_notifier, pppol2tp_ip_down, NULL); +#endif } struct channel pppol2tp_channel = { - options: pppol2tp_options, - process_extra_options: NULL, - check_options: &pppol2tp_check_options, - connect: &connect_pppol2tp, - disconnect: &disconnect_pppol2tp, - establish_ppp: &generic_establish_ppp, - disestablish_ppp: &generic_disestablish_ppp, - send_config: &send_config_pppol2tp, - recv_config: &recv_config_pppol2tp, - close: NULL, - cleanup: NULL + .options = pppol2tp_options, + .process_extra_options = NULL, + .check_options = &pppol2tp_check_options, + .connect = &connect_pppol2tp, + .disconnect = &disconnect_pppol2tp, + .establish_ppp = &generic_establish_ppp, + .disestablish_ppp = &generic_disestablish_ppp, + .send_config = &send_config_pppol2tp, + .recv_config = &recv_config_pppol2tp, + .close = NULL, + .cleanup = NULL };