1 diff -Naur ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c
2 --- ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c 2006-05-21 08:44:41.000000000 -0400
3 +++ ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:22:22.000000000 -0400
6 struct sockaddr_atmpvc addr;
7 extern struct stat devstat;
11 - //info("PPPoATM setdevname_pppoatm: '%s'", cp);
13 memset(&addr, 0, sizeof addr);
14 if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr),
15 - T2A_PVC | T2A_NAME) < 0) {
17 - info("atm does not recognize: %s", cp);
18 + T2A_PVC | T2A_NAME | T2A_WILDCARD) < 0) {
20 + info("cannot parse the ATM address: %s", cp);
23 - if (!doit) return 1;
24 - //if (!dev_set_ok()) return -1;
29 memcpy(&pvcaddr, &addr, sizeof pvcaddr);
30 strlcpy(devnam, cp, sizeof devnam);
31 devstat.st_mode = S_IFSOCK;
33 lcp_allowoptions[0].neg_asyncmap = 0;
34 lcp_wantoptions[0].neg_pcompression = 0;
36 - info("PPPoATM setdevname_pppoatm - SUCCESS:%s", cp);
41 static void set_line_discipline_pppoatm(int fd)
43 struct atm_backend_ppp be;
45 be.backend_num = ATM_BACKEND_PPP;
47 be.encaps = PPPOATM_ENCAPS_VC;
49 be.encaps = PPPOATM_ENCAPS_LLC;
51 be.encaps = PPPOATM_ENCAPS_AUTODETECT;
53 if (ioctl(fd, ATM_SETBACKEND, &be) < 0)
54 fatal("ioctl(ATM_SETBACKEND): %m");
61 if (mtu > pppoatm_max_mtu)
62 error("Couldn't increase MTU to %d", mtu);
64 sock = socket(AF_INET, SOCK_DGRAM, 0);
66 fatal("Couldn't create IP socket: %m");
68 strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
70 if (ioctl(sock, SIOCSIFMTU, (caddr_t) &ifr) < 0)
71 fatal("ioctl(SIOCSIFMTU): %m");
72 - (void) close (sock);
76 static void recv_config_pppoa(int mru,
79 void plugin_init(void)
81 -#if defined(__linux__)
83 extern int new_style_driver; /* From sys-linux.c */
84 if (!ppp_available() && !new_style_driver)
85 fatal("Kernel doesn't support ppp_generic - "
88 fatal("No PPPoATM support on this OS");
90 - info("PPPoATM plugin_init");
91 add_options(pppoa_options);
94 struct channel pppoa_channel = {
95 options: pppoa_options,
96 process_extra_options: NULL,
97 diff -Naur ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c
98 --- ppp-2.4.4.orig/pppd/plugins/pppoatm/pppoatm.c 2006-05-21 08:44:41.000000000 -0400
99 +++ ppp-2.4.4/pppd/plugins/pppoatm/pppoatm.c 2009-05-07 16:22:22.000000000 -0400
102 struct sockaddr_atmpvc addr;
103 extern struct stat devstat;
107 - //info("PPPoATM setdevname_pppoatm: '%s'", cp);
109 memset(&addr, 0, sizeof addr);
110 if (text2atm(cp, (struct sockaddr *) &addr, sizeof(addr),
111 - T2A_PVC | T2A_NAME) < 0) {
113 - info("atm does not recognize: %s", cp);
114 + T2A_PVC | T2A_NAME | T2A_WILDCARD) < 0) {
116 + info("cannot parse the ATM address: %s", cp);
119 - if (!doit) return 1;
120 - //if (!dev_set_ok()) return -1;
125 memcpy(&pvcaddr, &addr, sizeof pvcaddr);
126 strlcpy(devnam, cp, sizeof devnam);
127 devstat.st_mode = S_IFSOCK;
129 lcp_allowoptions[0].neg_asyncmap = 0;
130 lcp_wantoptions[0].neg_pcompression = 0;
132 - info("PPPoATM setdevname_pppoatm - SUCCESS:%s", cp);
137 static void set_line_discipline_pppoatm(int fd)
139 struct atm_backend_ppp be;
141 be.backend_num = ATM_BACKEND_PPP;
143 be.encaps = PPPOATM_ENCAPS_VC;
145 be.encaps = PPPOATM_ENCAPS_LLC;
147 be.encaps = PPPOATM_ENCAPS_AUTODETECT;
149 if (ioctl(fd, ATM_SETBACKEND, &be) < 0)
150 fatal("ioctl(ATM_SETBACKEND): %m");
152 @@ -175,16 +178,19 @@
157 if (mtu > pppoatm_max_mtu)
158 error("Couldn't increase MTU to %d", mtu);
160 sock = socket(AF_INET, SOCK_DGRAM, 0);
162 fatal("Couldn't create IP socket: %m");
164 strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
166 if (ioctl(sock, SIOCSIFMTU, (caddr_t) &ifr) < 0)
167 fatal("ioctl(SIOCSIFMTU): %m");
168 - (void) close (sock);
172 static void recv_config_pppoa(int mru,
175 void plugin_init(void)
177 -#if defined(__linux__)
179 extern int new_style_driver; /* From sys-linux.c */
180 if (!ppp_available() && !new_style_driver)
181 fatal("Kernel doesn't support ppp_generic - "
184 fatal("No PPPoATM support on this OS");
186 - info("PPPoATM plugin_init");
187 add_options(pppoa_options);
190 struct channel pppoa_channel = {
191 options: pppoa_options,
192 process_extra_options: NULL,