Deleted Added
full compact
route6d.c (119038) route6d.c (119039)
1/* $FreeBSD: head/usr.sbin/route6d/route6d.c 119038 2003-08-17 17:34:09Z ume $ */
1/* $FreeBSD: head/usr.sbin/route6d/route6d.c 119039 2003-08-17 17:40:47Z ume $ */
2/* $KAME: route6d.c,v 1.64 2001/05/08 04:36:37 itojun Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

78
79#include "route6d.h"
80
81#define MAXFILTER 40
82
83#ifdef DEBUG
84#define INIT_INTERVAL6 6
85#else
2/* $KAME: route6d.c,v 1.64 2001/05/08 04:36:37 itojun Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

78
79#include "route6d.h"
80
81#define MAXFILTER 40
82
83#ifdef DEBUG
84#define INIT_INTERVAL6 6
85#else
86#define INIT_INTERVAL6 10 /* Wait to submit an initial riprequest. */
86#define INIT_INTERVAL6 10 /* Wait to submit an initial riprequest */
87#endif
88
89/* alignment constraint for routing socket */
90#define ROUNDUP(a) \
91 ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
92#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
93
94/*

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

133 struct iff *iff_next;
134};
135
136struct ifc *ifc;
137int nifc; /* number of valid ifc's */
138struct ifc **index2ifc;
139int nindex2ifc;
140struct ifc *loopifcp = NULL; /* pointing to loopback */
87#endif
88
89/* alignment constraint for routing socket */
90#define ROUNDUP(a) \
91 ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
92#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
93
94/*

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

133 struct iff *iff_next;
134};
135
136struct ifc *ifc;
137int nifc; /* number of valid ifc's */
138struct ifc **index2ifc;
139int nindex2ifc;
140struct ifc *loopifcp = NULL; /* pointing to loopback */
141int loopifindex = 0; /* ditto */
142fd_set sockvec; /* vector to select() for receiving */
143int rtsock; /* the routing socket */
144int ripsock; /* socket to send/receive RIP datagram */
145
146struct rip6 *ripbuf; /* packet buffer for sending */
147
148/*
149 * Maintain the routes in a linked list. When the number of the routes

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

384 fatal("No loopback found");
385 /*NOTREACHED*/
386 }
387#ifdef __FreeBSD__
388 sranddev();
389#else
390 srand((unsigned)(time(NULL)^(pid<<16)));
391#endif
141fd_set sockvec; /* vector to select() for receiving */
142int rtsock; /* the routing socket */
143int ripsock; /* socket to send/receive RIP datagram */
144
145struct rip6 *ripbuf; /* packet buffer for sending */
146
147/*
148 * Maintain the routes in a linked list. When the number of the routes

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

383 fatal("No loopback found");
384 /*NOTREACHED*/
385 }
386#ifdef __FreeBSD__
387 sranddev();
388#else
389 srand((unsigned)(time(NULL)^(pid<<16)));
390#endif
392 loopifindex = loopifcp->ifc_index;
393 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next)
394 ifrt(ifcp, 0);
395 filterconfig();
396 krtread(0);
397 if (dflag)
398 ifrtdump(0);
399
400 pid = getpid();

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

3068 rrt->rrt_info.rip6_dest = ftmp.iff_addr;
3069 rrt->rrt_info.rip6_plen = ftmp.iff_plen;
3070 rrt->rrt_info.rip6_metric = 1;
3071 rrt->rrt_info.rip6_tag = htons(routetag & 0xffff);
3072 rrt->rrt_gw = in6addr_loopback;
3073 rrt->rrt_flags = RTF_UP | RTF_REJECT;
3074 rrt->rrt_rflags = RRTF_AGGREGATE;
3075 rrt->rrt_t = 0;
391 for (ifcp = ifc; ifcp; ifcp = ifcp->ifc_next)
392 ifrt(ifcp, 0);
393 filterconfig();
394 krtread(0);
395 if (dflag)
396 ifrtdump(0);
397
398 pid = getpid();

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

3066 rrt->rrt_info.rip6_dest = ftmp.iff_addr;
3067 rrt->rrt_info.rip6_plen = ftmp.iff_plen;
3068 rrt->rrt_info.rip6_metric = 1;
3069 rrt->rrt_info.rip6_tag = htons(routetag & 0xffff);
3070 rrt->rrt_gw = in6addr_loopback;
3071 rrt->rrt_flags = RTF_UP | RTF_REJECT;
3072 rrt->rrt_rflags = RRTF_AGGREGATE;
3073 rrt->rrt_t = 0;
3076 rrt->rrt_index = loopifindex;
3074 rrt->rrt_index = loopifcp->ifc_index;
3077#if 0
3078 if (getroute(&rrt->rrt_info, &gw)) {
3079#if 0
3080 /*
3081 * When the address has already been registered in the
3082 * kernel routing table, it should be removed
3083 */
3084 delroute(&rrt->rrt_info, &gw);

--- 385 unchanged lines hidden ---
3075#if 0
3076 if (getroute(&rrt->rrt_info, &gw)) {
3077#if 0
3078 /*
3079 * When the address has already been registered in the
3080 * kernel routing table, it should be removed
3081 */
3082 delroute(&rrt->rrt_info, &gw);

--- 385 unchanged lines hidden ---