Deleted Added
full compact
bundle.c (50479) bundle.c (50867)
1/*-
2 * Copyright (c) 1998 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) 1998 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/bundle.c 50479 1999-08-28 01:35:59Z peter $
26 * $FreeBSD: head/usr.sbin/ppp/bundle.c 50867 1999-09-04 00:00:21Z brian $
27 */
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <netinet/in.h>
32#include <net/if.h>
33#include <net/if_tun.h> /* For TUNSIFMODE & TUNSLMODE */
34#include <arpa/inet.h>

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

406 nlinks++;
407
408 if (nlinks) {
409 queued = r ? bundle_FillQueues(bundle) : ip_QueueLen(&bundle->ncp.ipcp);
410
411 if (r && (bundle->phase == PHASE_NETWORK ||
412 bundle->phys_type.all & PHYS_AUTO)) {
413 /* enough surplus so that we can tell if we're getting swamped */
27 */
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <netinet/in.h>
32#include <net/if.h>
33#include <net/if_tun.h> /* For TUNSIFMODE & TUNSLMODE */
34#include <arpa/inet.h>

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

406 nlinks++;
407
408 if (nlinks) {
409 queued = r ? bundle_FillQueues(bundle) : ip_QueueLen(&bundle->ncp.ipcp);
410
411 if (r && (bundle->phase == PHASE_NETWORK ||
412 bundle->phys_type.all & PHYS_AUTO)) {
413 /* enough surplus so that we can tell if we're getting swamped */
414 if (queued < 20) {
414 if (queued < 30) {
415 /* Not enough - select() for more */
416 if (bundle->choked.timer.state == TIMER_RUNNING)
417 timer_Stop(&bundle->choked.timer); /* Not needed any more */
418 FD_SET(bundle->dev.fd, r);
419 if (*n < bundle->dev.fd + 1)
420 *n = bundle->dev.fd + 1;
421 log_Printf(LogTIMER, "%s: fdset(r) %d\n", TUN_NAME, bundle->dev.fd);
422 result++;

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

784 radius_Destroy(&bundle->radius);
785#endif
786
787 /* Again, these are all DATALINK_CLOSED unless we're abending */
788 dl = bundle->links;
789 while (dl)
790 dl = datalink_Destroy(dl);
791
415 /* Not enough - select() for more */
416 if (bundle->choked.timer.state == TIMER_RUNNING)
417 timer_Stop(&bundle->choked.timer); /* Not needed any more */
418 FD_SET(bundle->dev.fd, r);
419 if (*n < bundle->dev.fd + 1)
420 *n = bundle->dev.fd + 1;
421 log_Printf(LogTIMER, "%s: fdset(r) %d\n", TUN_NAME, bundle->dev.fd);
422 result++;

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

784 radius_Destroy(&bundle->radius);
785#endif
786
787 /* Again, these are all DATALINK_CLOSED unless we're abending */
788 dl = bundle->links;
789 while (dl)
790 dl = datalink_Destroy(dl);
791
792 ipcp_Destroy(&bundle->ncp.ipcp);
793
792 close(bundle->dev.fd);
793 bundle_UnlockTun(bundle);
794
795 /* In case we never made PHASE_NETWORK */
796 bundle_Notify(bundle, EX_ERRDEAD);
797
798 iface_Destroy(bundle->iface);
799 bundle->iface = NULL;

--- 939 unchanged lines hidden ---
794 close(bundle->dev.fd);
795 bundle_UnlockTun(bundle);
796
797 /* In case we never made PHASE_NETWORK */
798 bundle_Notify(bundle, EX_ERRDEAD);
799
800 iface_Destroy(bundle->iface);
801 bundle->iface = NULL;

--- 939 unchanged lines hidden ---