Deleted Added
full compact
pppoed.c (66602) pppoed.c (68032)
1/*-
2 * Copyright (c) 1999 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1999 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/libexec/pppoed/pppoed.c 66602 2000-10-03 20:41:00Z brian $
26 * $FreeBSD: head/libexec/pppoed/pppoed.c 68032 2000-10-31 02:46:12Z brian $
27 */
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <sys/un.h>
32#include <netinet/in.h>
33#include <arpa/inet.h>
34#include <netdb.h>

--- 190 unchanged lines hidden (view full) ---

225 if (NgSendMsg(cs, ".:", NGM_GENERIC_COOKIE,
226 NGM_CONNECT, ngc, sizeof *ngc) < 0) {
227 perror("Cannot CONNECT PPPoE and socket nodes");
228 return EX_OSERR;
229 }
230
231 plen = strlen(provider);
232
27 */
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <sys/un.h>
32#include <netinet/in.h>
33#include <arpa/inet.h>
34#include <netdb.h>

--- 190 unchanged lines hidden (view full) ---

225 if (NgSendMsg(cs, ".:", NGM_GENERIC_COOKIE,
226 NGM_CONNECT, ngc, sizeof *ngc) < 0) {
227 perror("Cannot CONNECT PPPoE and socket nodes");
228 return EX_OSERR;
229 }
230
231 plen = strlen(provider);
232
233 data = (struct ngpppoe_init_data *)alloca(sizeof *data + plen + 1);
233 data = (struct ngpppoe_init_data *)alloca(sizeof *data + plen);
234 snprintf(data->hook, sizeof data->hook, "%s", ngc->peerhook);
235 strcpy(data->data, provider);
234 snprintf(data->hook, sizeof data->hook, "%s", ngc->peerhook);
235 strcpy(data->data, provider);
236 data->data_len = plen;
237
238 spath = (char *)alloca(strlen(ngc->peerhook) + 3);
239 strcpy(spath, ".:");
240 strcpy(spath + 2, ngc->ourhook);
241
242 if (debug) {
243 if (provider)
244 fprintf(stderr, "Sending PPPOE_LISTEN to %s, provider %s\n",

--- 73 unchanged lines hidden (view full) ---

318 if (NgSendMsg(cs, ".:", NGM_SOCKET_COOKIE,
319 NGM_SOCK_CMD_NOLINGER, NULL, 0) < 0) {
320 syslog(LOG_ERR, "Cannot send NGM_SOCK_CMD_NOLINGER: %m");
321 _exit(EX_OSERR);
322 }
323
324 /* Put the PPPoE node into OFFER mode */
325 slen = strlen(acname);
236
237 spath = (char *)alloca(strlen(ngc->peerhook) + 3);
238 strcpy(spath, ".:");
239 strcpy(spath + 2, ngc->ourhook);
240
241 if (debug) {
242 if (provider)
243 fprintf(stderr, "Sending PPPOE_LISTEN to %s, provider %s\n",

--- 73 unchanged lines hidden (view full) ---

317 if (NgSendMsg(cs, ".:", NGM_SOCKET_COOKIE,
318 NGM_SOCK_CMD_NOLINGER, NULL, 0) < 0) {
319 syslog(LOG_ERR, "Cannot send NGM_SOCK_CMD_NOLINGER: %m");
320 _exit(EX_OSERR);
321 }
322
323 /* Put the PPPoE node into OFFER mode */
324 slen = strlen(acname);
326 data = (struct ngpppoe_init_data *)alloca(sizeof *data + slen + 1);
325 data = (struct ngpppoe_init_data *)alloca(sizeof *data + slen);
327 snprintf(data->hook, sizeof data->hook, "%s", ngc.ourhook);
328 strcpy(data->data, acname);
326 snprintf(data->hook, sizeof data->hook, "%s", ngc.ourhook);
327 strcpy(data->data, acname);
329 data->data_len = slen;
330
331 path = (char *)alloca(strlen(ngc.ourhook) + 3);
332 strcpy(path, ".:");
333 strcpy(path + 2, ngc.ourhook);
334
335 syslog(LOG_INFO, "Offering to %s as access concentrator %s",
336 path, acname);
337 if (NgSendMsg(cs, path, NGM_PPPOE_COOKIE, NGM_PPPOE_OFFER,

--- 287 unchanged lines hidden ---
328
329 path = (char *)alloca(strlen(ngc.ourhook) + 3);
330 strcpy(path, ".:");
331 strcpy(path + 2, ngc.ourhook);
332
333 syslog(LOG_INFO, "Offering to %s as access concentrator %s",
334 path, acname);
335 if (NgSendMsg(cs, path, NGM_PPPOE_COOKIE, NGM_PPPOE_OFFER,

--- 287 unchanged lines hidden ---