ether.c (78410) | ether.c (79854) |
---|---|
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/usr.sbin/ppp/ether.c 78410 2001-06-18 14:59:36Z brian $ | 26 * $FreeBSD: head/usr.sbin/ppp/ether.c 79854 2001-07-18 09:33:45Z 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> --- 555 unchanged lines hidden (view full) --- 590 ngc.ourhook, ngc.path, ngc.peerhook); 591 if (NgSendMsg(dev->cs, ".:", NGM_GENERIC_COOKIE, 592 NGM_CONNECT, &ngc, sizeof ngc) < 0) { 593 log_Printf(LogWARN, "Cannot connect PPPoE and socket netgraph " 594 "nodes: %s\n", strerror(errno)); 595 return ether_Abandon(dev, p); 596 } 597 | 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> --- 555 unchanged lines hidden (view full) --- 590 ngc.ourhook, ngc.path, ngc.peerhook); 591 if (NgSendMsg(dev->cs, ".:", NGM_GENERIC_COOKIE, 592 NGM_CONNECT, &ngc, sizeof ngc) < 0) { 593 log_Printf(LogWARN, "Cannot connect PPPoE and socket netgraph " 594 "nodes: %s\n", strerror(errno)); 595 return ether_Abandon(dev, p); 596 } 597 |
598 /* Bring the Ethernet interface up */ 599 path[ifacelen] = '\0'; /* Remove the trailing ':' */ 600 if (!iface_SetFlags(path, IFF_UP)) 601 log_Printf(LogWARN, "%s: Failed to set the IFF_UP flag on %s\n", 602 p->link.name, path); 603 |
|
598 /* And finally, request a connection to the given provider */ 599 600 data = (struct ngpppoe_init_data *)alloca(sizeof *data + providerlen); 601 snprintf(data->hook, sizeof data->hook, "%s", dev->hook); 602 memcpy(data->data, provider, providerlen); 603 data->data_len = providerlen; 604 605 snprintf(connectpath, sizeof connectpath, ".:%s", dev->hook); --- 64 unchanged lines hidden (view full) --- 670 dev->connected = CARRIER_OK; 671 *dev->hook = '\0'; 672 } 673 } 674 } 675 676 if (dev) { 677 physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNCNOACF); | 604 /* And finally, request a connection to the given provider */ 605 606 data = (struct ngpppoe_init_data *)alloca(sizeof *data + providerlen); 607 snprintf(data->hook, sizeof data->hook, "%s", dev->hook); 608 memcpy(data->data, provider, providerlen); 609 data->data_len = providerlen; 610 611 snprintf(connectpath, sizeof connectpath, ".:%s", dev->hook); --- 64 unchanged lines hidden (view full) --- 676 dev->connected = CARRIER_OK; 677 *dev->hook = '\0'; 678 } 679 } 680 } 681 682 if (dev) { 683 physical_SetupStack(p, dev->dev.name, PHYSICAL_FORCE_SYNCNOACF); |
678 679 if (path != NULL) { 680 /* Mark the interface as UP if it's not already */ 681 682 path[ifacelen] = '\0'; /* Remove the trailing ':' */ 683 if (!iface_SetFlags(path, IFF_UP)) 684 log_Printf(LogWARN, "%s: Failed to set the IFF_UP flag on %s\n", 685 p->link.name, path); 686 } 687 | |
688 return &dev->dev; 689 } 690 691 return NULL; 692} | 684 return &dev->dev; 685 } 686 687 return NULL; 688} |