route.c (36285) | route.c (36832) |
---|---|
1/* 2 * PPP Routing related Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1994, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * | 1/* 2 * PPP Routing related Module 3 * 4 * Written by Toshiharu OHNO (tony-o@iij.ad.jp) 5 * 6 * Copyright (C) 1994, Internet Initiative Japan, Inc. All rights reserverd. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the Internet Initiative Japan, Inc. The name of the 14 * IIJ may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * |
20 * $Id: route.c,v 1.42.2.25 1998/05/16 21:19:00 brian Exp $ | 20 * $Id: route.c,v 1.45 1998/05/21 21:48:10 brian Exp $ |
21 * 22 */ 23 24#include <sys/types.h> 25#include <sys/socket.h> 26#include <net/if_types.h> 27#include <net/route.h> 28#include <net/if.h> --- 257 unchanged lines hidden (view full) --- 286 mib[2] = 0; 287 mib[3] = 0; 288 mib[4] = NET_RT_DUMP; 289 mib[5] = 0; 290 if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { 291 log_Printf(LogERROR, "route_Show: sysctl: estimate: %s\n", strerror(errno)); 292 return (1); 293 } | 21 * 22 */ 23 24#include <sys/types.h> 25#include <sys/socket.h> 26#include <net/if_types.h> 27#include <net/route.h> 28#include <net/if.h> --- 257 unchanged lines hidden (view full) --- 286 mib[2] = 0; 287 mib[3] = 0; 288 mib[4] = NET_RT_DUMP; 289 mib[5] = 0; 290 if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { 291 log_Printf(LogERROR, "route_Show: sysctl: estimate: %s\n", strerror(errno)); 292 return (1); 293 } |
294 if (needed < 0) 295 return (1); | |
296 sp = malloc(needed); 297 if (sp == NULL) 298 return (1); 299 if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) { 300 log_Printf(LogERROR, "route_Show: sysctl: getroute: %s\n", strerror(errno)); 301 free(sp); 302 return (1); 303 } --- 56 unchanged lines hidden (view full) --- 360 mib[3] = 0; 361 mib[4] = NET_RT_DUMP; 362 mib[5] = 0; 363 if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { 364 log_Printf(LogERROR, "route_IfDelete: sysctl: estimate: %s\n", 365 strerror(errno)); 366 return; 367 } | 294 sp = malloc(needed); 295 if (sp == NULL) 296 return (1); 297 if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) { 298 log_Printf(LogERROR, "route_Show: sysctl: getroute: %s\n", strerror(errno)); 299 free(sp); 300 return (1); 301 } --- 56 unchanged lines hidden (view full) --- 358 mib[3] = 0; 359 mib[4] = NET_RT_DUMP; 360 mib[5] = 0; 361 if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) { 362 log_Printf(LogERROR, "route_IfDelete: sysctl: estimate: %s\n", 363 strerror(errno)); 364 return; 365 } |
368 if (needed < 0) 369 return; | |
370 371 sp = malloc(needed); 372 if (sp == NULL) 373 return; 374 375 if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) { 376 log_Printf(LogERROR, "route_IfDelete: sysctl: getroute: %s\n", 377 strerror(errno)); --- 184 unchanged lines hidden --- | 366 367 sp = malloc(needed); 368 if (sp == NULL) 369 return; 370 371 if (sysctl(mib, 6, sp, &needed, NULL, 0) < 0) { 372 log_Printf(LogERROR, "route_IfDelete: sysctl: getroute: %s\n", 373 strerror(errno)); --- 184 unchanged lines hidden --- |