From de8bfff6c9d1b475046cc474193f731649ceda9c Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 24 Aug 2008 20:40:00 +0000 Subject: [PATCH] MFp4: Remove all the OtherBSD ifdefs. They are very out of date at this point. OtherBSD doesn't use this file verbatim, and they don't have FreeBSD ifdefs in their code. Reviewed by: bms@, joerg@ --- sys/net/if_spppsubr.c | 108 +----------------------------------------- 1 file changed, 2 insertions(+), 106 deletions(-) diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index cde005c1511e..c7814e53ccf5 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -23,19 +23,9 @@ #include -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 #include "opt_inet.h" #include "opt_inet6.h" #include "opt_ipx.h" -#endif - -#ifdef NetBSD1_3 -# if NetBSD1_3 > 6 -# include "opt_inet.h" -# include "opt_inet6.h" -# include "opt_iso.h" -# endif -#endif #include #include @@ -43,18 +33,12 @@ #include #include #include -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 #include -#endif #include #include #include -#if defined (__OpenBSD__) -#include -#else #include -#endif #include #include @@ -65,10 +49,6 @@ #include #include -#if defined (__NetBSD__) || defined (__OpenBSD__) -#include /* XXX for softnet */ -#endif - #include #include @@ -82,11 +62,7 @@ #include #endif -#if defined (__FreeBSD__) || defined (__OpenBSD__) -# include -#else -# include -#endif +#include #ifdef IPX #include @@ -95,12 +71,7 @@ #include -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 -# define IOCTL_CMD_T u_long -#else -# define IOCTL_CMD_T int -#endif - +#define IOCTL_CMD_T u_long #define MAXALIVECNT 3 /* max. alive packets */ /* @@ -261,13 +232,8 @@ struct cp { void (*scr)(struct sppp *sp); }; -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 && __FreeBSD_version < 501113 -#define SPP_FMT "%s%d: " -#define SPP_ARGS(ifp) (ifp)->if_name, (ifp)->if_unit -#else #define SPP_FMT "%s: " #define SPP_ARGS(ifp) (ifp)->if_xname -#endif #define SPPP_LOCK(sp) \ do { \ @@ -1422,11 +1388,7 @@ sppp_cisco_input(struct sppp *sp, struct mbuf *m) ++sp->pp_loopcnt; /* Generate new local sequence number */ -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 sp->pp_seq[IDX_LCP] = random(); -#else - sp->pp_seq[IDX_LCP] ^= time.tv_sec ^ time.tv_usec; -#endif break; } sp->pp_loopcnt = 0; @@ -2671,11 +2633,7 @@ sppp_lcp_RCN_nak(struct sppp *sp, struct lcp_header *h, int len) if (magic == ~sp->lcp.magic) { if (debug) log(-1, "magic glitch "); -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 sp->lcp.magic = random(); -#else - sp->lcp.magic = time.tv_sec + time.tv_usec; -#endif } else { sp->lcp.magic = magic; if (debug) @@ -2856,11 +2814,7 @@ sppp_lcp_scr(struct sppp *sp) if (sp->lcp.opts & (1 << LCP_OPT_MAGIC)) { if (! sp->lcp.magic) -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 sp->lcp.magic = random(); -#else - sp->lcp.magic = time.tv_sec + time.tv_usec; -#endif opt[i++] = LCP_OPT_MAGIC; opt[i++] = 6; opt[i++] = sp->lcp.magic >> 24; @@ -4383,15 +4337,7 @@ sppp_chap_scr(struct sppp *sp) /* Compute random challenge. */ ch = (u_long *)sp->myauth.challenge; -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 read_random(&seed, sizeof seed); -#else - { - struct timeval tv; - microtime(&tv); - seed = tv.tv_sec ^ tv.tv_usec; - } -#endif ch[0] = seed ^ random(); ch[1] = seed ^ random(); ch[2] = seed ^ random(); @@ -4900,17 +4846,7 @@ sppp_get_ip_addrs(struct sppp *sp, u_long *src, u_long *dst, u_long *srcmask) * aliases don't make any sense on a p2p link anyway. */ si = 0; -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) -#elif defined(__NetBSD__) || defined (__OpenBSD__) - for (ifa = TAILQ_FIRST(&ifp->if_addrlist); - ifa; - ifa = TAILQ_NEXT(ifa, ifa_list)) -#else - for (ifa = ifp->if_addrlist; - ifa; - ifa = ifa->ifa_next) -#endif if (ifa->ifa_addr->sa_family == AF_INET) { si = (struct sockaddr_in *)ifa->ifa_addr; sm = (struct sockaddr_in *)ifa->ifa_netmask; @@ -4949,17 +4885,7 @@ sppp_set_ip_addr(struct sppp *sp, u_long src) * aliases don't make any sense on a p2p link anyway. */ si = 0; -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) -#elif defined(__NetBSD__) || defined (__OpenBSD__) - for (ifa = TAILQ_FIRST(&ifp->if_addrlist); - ifa; - ifa = TAILQ_NEXT(ifa, ifa_list)) -#else - for (ifa = ifp->if_addrlist; - ifa; - ifa = ifa->ifa_next) -#endif { if (ifa->ifa_addr->sa_family == AF_INET) { @@ -4972,17 +4898,6 @@ sppp_set_ip_addr(struct sppp *sp, u_long src) if (ifa && si) { int error; -#if defined(__NetBSD__) && __NetBSD_Version__ >= 103080000 - struct sockaddr_in new_sin = *si; - - new_sin.sin_addr.s_addr = htonl(src); - error = in_ifinit(ifp, ifatoia(ifa), &new_sin, 1); - if(debug && error) - { - log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addr: in_ifinit " - " failed, error=%d\n", SPP_ARGS(ifp), error); - } -#else /* delete old route */ error = rtinit(ifa, (int)RTM_DELETE, RTF_HOST); if(debug && error) @@ -5004,7 +4919,6 @@ sppp_set_ip_addr(struct sppp *sp, u_long src) log(LOG_DEBUG, SPP_FMT "sppp_set_ip_addr: rtinit ADD failed, error=%d", SPP_ARGS(ifp), error); } -#endif } } @@ -5029,17 +4943,7 @@ sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src, struct in6_addr *dst, * aliases don't make any sense on a p2p link anyway. */ si = 0; -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) -#elif defined(__NetBSD__) || defined (__OpenBSD__) - for (ifa = ifp->if_addrlist.tqh_first; - ifa; - ifa = ifa->ifa_list.tqe_next) -#else - for (ifa = ifp->if_addrlist; - ifa; - ifa = ifa->ifa_next) -#endif if (ifa->ifa_addr->sa_family == AF_INET6) { si = (struct sockaddr_in6 *)ifa->ifa_addr; sm = (struct sockaddr_in6 *)ifa->ifa_netmask; @@ -5092,15 +4996,7 @@ sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src) */ sin6 = NULL; -#if defined(__FreeBSD__) && __FreeBSD__ >= 3 TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) -#elif defined(__NetBSD__) || defined (__OpenBSD__) - for (ifa = ifp->if_addrlist.tqh_first; - ifa; - ifa = ifa->ifa_list.tqe_next) -#else - for (ifa = ifp->if_addrlist; ifa; ifa = ifa->ifa_next) -#endif { if (ifa->ifa_addr->sa_family == AF_INET6) {